From d25ab4b4b387b163555f5fa8e3e0bcb99d4ed778 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Tue, 6 May 2025 22:13:03 -0700 Subject: [PATCH] Sync eslint with client Mostly this is relevant for `context.tr` tagged lines to be unlimited length. --- eslint-ps-standard.mjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/eslint-ps-standard.mjs b/eslint-ps-standard.mjs index d06725bb51..38c7965cf3 100644 --- a/eslint-ps-standard.mjs +++ b/eslint-ps-standard.mjs @@ -68,7 +68,7 @@ export const defaultRules = { "@stylistic/max-len": ["warn", { "code": 120, "tabWidth": 0, // DO NOT EDIT DIRECTLY: see bottom of file for source - "ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const |readonly )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:Utils\\.html|(?:this\\.)?(?:room\\.)?tr|\\$\\()?['\"`/]", + "ignorePattern": "^\\s*(?:\\/\\/ \\s*)?(?:(?:export )?(?:let |const |readonly )?[a-zA-Z0-9_$.]+(?: \\+?=>? )|[a-zA-Z0-9$]+: \\[?|(?:return |throw )?(?:new )?(?:[a-zA-Z0-9$.]+\\()?)?(?:[A-Za-z0-9.]+|\\$\\()?['\"`/]", }], "prefer-const": ["warn", { "destructuring": "all" }], @@ -90,6 +90,7 @@ export const defaultRules = { "no-extend-native": "error", "no-extra-bind": "warn", "no-extra-label": "warn", + "no-constant-condition": "warn", "no-eval": "error", "no-implied-eval": "error", "no-inner-declarations": ["error", "functions"], @@ -99,11 +100,10 @@ export const defaultRules = { "no-return-assign": "error", "no-self-compare": "error", "no-sequences": "error", - "no-shadow": "error", + "no-shadow": "warn", "no-template-curly-in-string": "error", "no-throw-literal": "warn", "no-unmodified-loop-condition": "error", - "no-unreachable": "warn", // best way to read first key of object // "no-unreachable-loop": "error", // ternary is used to convert callbacks to Promises @@ -175,6 +175,7 @@ export const defaultRules = { "@stylistic/jsx-one-expression-per-line": "off", "@stylistic/jsx-max-props-per-line": "off", "@stylistic/jsx-function-call-newline": "off", + "@stylistic/jsx-child-element-spacing": "error", "no-restricted-syntax": ["error", { selector: "CallExpression[callee.name='Symbol']", message: "Annoying to serialize, just use a string" }, ], @@ -269,7 +270,7 @@ export const defaultRulesTSChecked = { // style // ===== "@typescript-eslint/no-unnecessary-type-arguments": "error", - "@typescript-eslint/restrict-plus-operands": ["warn", { + "@typescript-eslint/restrict-plus-operands": ["error", { allowBoolean: false, allowNullish: false, allowNumberAndString: false, allowRegExp: false, }], "@typescript-eslint/restrict-template-expressions": ["error", { @@ -317,7 +318,7 @@ export const defaultRulesES3 = { ignoreRestSiblings: true, }], "no-restricted-syntax": ["error", - { selector: "TaggedTemplateExpression", message: "Hard to compile down to ES3" }, + { selector: "TaggedTemplateExpression", message: "Not supported by ES3" }, { selector: "CallExpression[callee.name='Symbol']", message: "Annoying to serialize, just use a string" }, ], @@ -345,7 +346,7 @@ export const defaultRulesES3TSChecked = { ...defaultRulesTSChecked, "radix": "off", "no-restricted-globals": ["error", "Proxy", "Reflect", "Symbol", "WeakSet", "WeakMap", "Set", "Map"], - "no-restricted-syntax": ["error", "TaggedTemplateExpression", "YieldExpression", "AwaitExpression", "BigIntLiteral"], + "no-restricted-syntax": ["error", "YieldExpression", "AwaitExpression", "BigIntLiteral"], }; /** @@ -423,9 +424,8 @@ SOURCE FOR IGNOREPATTERN (compile with https://regexfree.k55.io/ ) )? ( - Utils\.html - | - (this\.)?(room\.)?tr + # tagged template + [A-Za-z0-9\.]+ | \$\( )?