diff --git a/.eslintrc b/.eslintrc index 943f8676..7543ba04 100644 --- a/.eslintrc +++ b/.eslintrc @@ -46,6 +46,7 @@ "no-useless-call": 2, "no-var": 2, "no-with": 2, + "object-curly-spacing": [2, "never"], "one-var": [2, "never"], "prefer-const": 2, "prefer-spread": 0, // re-enable once we use es6 @@ -64,7 +65,6 @@ // --------------------------------------- // TODO(csilvers): enable these if/when community agrees on it. "prefer-arrow-callback": 0, - "object-curly-spacing": [0, "always"], // Might be nice to turn this on one day, but since we don't // use jsdoc anywhere it seems silly to require it yet. "valid-jsdoc": 0, diff --git a/dockers/Screenshotter/screenshotter.js b/dockers/Screenshotter/screenshotter.js index 7017d57e..3264fe06 100644 --- a/dockers/Screenshotter/screenshotter.js +++ b/dockers/Screenshotter/screenshotter.js @@ -132,7 +132,7 @@ function cmd() { const args = Array.prototype.slice.call(arguments); const cmd = args.shift(); return childProcess.execFileSync( - cmd, args, { encoding: "utf-8" }).replace(/\n$/, ""); + cmd, args, {encoding: "utf-8"}).replace(/\n$/, ""); } function guessDockerIPs() { diff --git a/katex.js b/katex.js index d8fe19d8..cb8cd494 100644 --- a/katex.js +++ b/katex.js @@ -11,7 +11,7 @@ import ParseError from "./src/ParseError"; import Settings from "./src/Settings"; -import { buildTree, buildHTMLTree } from "./src/buildTree"; +import {buildTree, buildHTMLTree} from "./src/buildTree"; import parseTree from "./src/parseTree"; import buildCommon from "./src/buildCommon"; import domTree from "./src/domTree"; @@ -20,10 +20,10 @@ import utils from "./src/utils"; import type {SettingsOptions} from "./src/Settings"; import type ParseNode from "./src/ParseNode"; -import { defineSymbol } from './src/symbols'; -import { defineMacro } from './src/macros'; +import {defineSymbol} from './src/symbols'; +import {defineMacro} from './src/macros'; -import { version } from "./package.json"; +import {version} from "./package.json"; /** * Parse and build an expression, and place that expression in the DOM node diff --git a/src/Parser.js b/src/Parser.js index 069d7417..90b27113 100644 --- a/src/Parser.js +++ b/src/Parser.js @@ -4,20 +4,20 @@ import functions from "./functions"; import environments from "./environments"; import MacroExpander from "./MacroExpander"; -import symbols, { extraLatin } from "./symbols"; -import { validUnit } from "./units"; -import { supportedCodepoint } from "./unicodeScripts"; +import symbols, {extraLatin} from "./symbols"; +import {validUnit} from "./units"; +import {supportedCodepoint} from "./unicodeScripts"; import unicodeAccents from "./unicodeAccents"; import unicodeSymbols from "./unicodeSymbols"; import ParseNode from "./ParseNode"; import ParseError from "./ParseError"; -import { combiningDiacriticalMarksEndRegex } from "./Lexer.js"; +import {combiningDiacriticalMarksEndRegex} from "./Lexer.js"; import Settings from "./Settings"; -import { Token } from "./Token"; +import {Token} from "./Token"; -import type { Mode, ArgType, BreakToken } from "./types"; -import type { FunctionContext, FunctionSpec } from "./defineFunction"; -import type { EnvSpec } from "./defineEnvironment"; +import type {Mode, ArgType, BreakToken} from "./types"; +import type {FunctionContext, FunctionSpec} from "./defineFunction"; +import type {EnvSpec} from "./defineEnvironment"; /** * This file contains the parser used to parse out a TeX expression from the diff --git a/src/Settings.js b/src/Settings.js index e79287b2..91a01090 100644 --- a/src/Settings.js +++ b/src/Settings.js @@ -10,7 +10,7 @@ import ParseError from "./ParseError.js"; import ParseNode from "./ParseNode"; import {Token} from "./Token"; -import type { MacroMap } from "./macros"; +import type {MacroMap} from "./macros"; export type StrictFunction = (errorCode: string, errorMsg: string, token?: Token | ParseNode<*>) => diff --git a/src/domTree.js b/src/domTree.js index 1810bbb4..bcb6250b 100644 --- a/src/domTree.js +++ b/src/domTree.js @@ -8,7 +8,7 @@ * * Similar functions for working with MathML nodes exist in mathMLTree.js. */ -import { scriptFromCodepoint } from "./unicodeScripts"; +import {scriptFromCodepoint} from "./unicodeScripts"; import utils from "./utils"; import svgGeometry from "./svgGeometry"; import type Options from "./Options"; diff --git a/src/fontMetrics.js b/src/fontMetrics.js index 744e7887..16944d52 100644 --- a/src/fontMetrics.js +++ b/src/fontMetrics.js @@ -1,7 +1,7 @@ // @flow -import { supportedCodepoint } from "./unicodeScripts"; +import {supportedCodepoint} from "./unicodeScripts"; -import type { Mode } from "./types"; +import type {Mode} from "./types"; /** * This file contains metrics regarding fonts and individual symbols. The sigma diff --git a/src/functions/cr.js b/src/functions/cr.js index 472ebcbc..eff73fb2 100644 --- a/src/functions/cr.js +++ b/src/functions/cr.js @@ -4,7 +4,7 @@ import defineFunction from "../defineFunction"; import buildCommon from "../buildCommon"; import mathMLTree from "../mathMLTree"; -import { calculateSize } from "../units"; +import {calculateSize} from "../units"; import ParseError from "../ParseError"; import {assertNodeType} from "../ParseNode"; diff --git a/test/katex-spec.js b/test/katex-spec.js index 5c846c85..a103ee5b 100644 --- a/test/katex-spec.js +++ b/test/katex-spec.js @@ -2307,7 +2307,7 @@ describe("An array environment", function() { const parse = getParsed("\\begin{array}r1\\\\20\\end{array}"); expect(parse[0].type).toBe("array"); expect(parse[0].value.cols).toEqual([ - { type: "align", align: "r" }, + {type: "align", align: "r"}, ]); }); @@ -2315,12 +2315,12 @@ describe("An array environment", function() { const parse = getParsed("\\begin{array}{|l||c|}\\end{array}"); expect(parse[0].type).toBe("array"); expect(parse[0].value.cols).toEqual([ - { type: "separator", separator: "|" }, - { type: "align", align: "l" }, - { type: "separator", separator: "|" }, - { type: "separator", separator: "|" }, - { type: "align", align: "c" }, - { type: "separator", separator: "|" }, + {type: "separator", separator: "|"}, + {type: "align", align: "l"}, + {type: "separator", separator: "|"}, + {type: "separator", separator: "|"}, + {type: "align", align: "c"}, + {type: "separator", separator: "|"}, ]); }); diff --git a/test/screenshotter/ss_data.js b/test/screenshotter/ss_data.js index cdc2b2f1..943bca32 100644 --- a/test/screenshotter/ss_data.js +++ b/test/screenshotter/ss_data.js @@ -21,7 +21,7 @@ for (const key in dict) { if (dict.hasOwnProperty(key)) { let itm = dict[key]; if (typeof itm === "string") { - itm = dict[key] = { tex: itm }; + itm = dict[key] = {tex: itm}; } const query = {}; queryKeys.forEach(function(key) { diff --git a/webpack.config.js b/webpack.config.js index 76361276..74fd18de 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,5 @@ // @flow -const { targets, createConfig } = require('./webpack.common'); +const {targets, createConfig} = require('./webpack.common'); module.exports = [ // dev minify ...targets.map(target => createConfig(target, false, false)), diff --git a/webpack.dev.js b/webpack.dev.js index 715f97cf..11e927b4 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -1,5 +1,5 @@ // @flow -const { targets, createConfig } = require('./webpack.common'); +const {targets, createConfig} = require('./webpack.common'); const path = require('path'); const PORT = 7936;