mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 19:28:39 +00:00
enforce consistent object brace spacing (#1376)
This commit is contained in:
@@ -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,
|
||||
|
@@ -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() {
|
||||
|
8
katex.js
8
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
|
||||
|
@@ -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
|
||||
|
@@ -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<*>) =>
|
||||
|
@@ -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";
|
||||
|
@@ -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
|
||||
|
@@ -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";
|
||||
|
||||
|
@@ -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: "|"},
|
||||
]);
|
||||
});
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -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)),
|
||||
|
@@ -1,5 +1,5 @@
|
||||
// @flow
|
||||
const { targets, createConfig } = require('./webpack.common');
|
||||
const {targets, createConfig} = require('./webpack.common');
|
||||
const path = require('path');
|
||||
const PORT = 7936;
|
||||
|
||||
|
Reference in New Issue
Block a user