From: Tom Hughes Date: Mon, 10 Feb 2025 20:13:37 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/pull/5643' X-Git-Tag: live~153 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/6edb8dae058979f9c5cb198ad4f7af3f700ba84b?hp=-c Merge remote-tracking branch 'upstream/pull/5643' --- 6edb8dae058979f9c5cb198ad4f7af3f700ba84b diff --combined config/eslint.js index 1bf65695b,f21c87938..2dcd0d5a1 --- a/config/eslint.js +++ b/config/eslint.js @@@ -6,14 -6,6 +6,14 @@@ const stylisticJs = require("@stylistic module.exports = [ js.configs.recommended, erb.configs.recommended, + { + ignores: [ + "app/assets/javascripts/i18n/", + "coverage/assets/", + "public/assets/", + "vendor/" + ] + }, { plugins: { "@stylistic": stylisticJs @@@ -43,6 -35,7 +43,7 @@@ reportUnusedDisableDirectives: "off" }, rules: { + /* eslint sort-keys: ["warn"] */ "@stylistic/array-bracket-newline": ["error", "consistent"], "@stylistic/array-bracket-spacing": "error", "@stylistic/block-spacing": "error", @@@ -55,23 -48,25 +56,25 @@@ "@stylistic/eol-last": "error", "@stylistic/func-call-spacing": "error", "@stylistic/indent": ["error", 2, { - SwitchCase: 1, - VariableDeclarator: "first", + CallExpression: { arguments: "first" }, FunctionDeclaration: { parameters: "first" }, FunctionExpression: { parameters: "first" }, - CallExpression: { arguments: "first" } + SwitchCase: 1, + VariableDeclarator: "first" }], "@stylistic/key-spacing": "error", "@stylistic/keyword-spacing": "error", + "@stylistic/max-statements-per-line": "error", "@stylistic/no-floating-decimal": "error", "@stylistic/no-mixed-operators": "error", - "@stylistic/no-multiple-empty-lines": "error", "@stylistic/no-multi-spaces": "error", + "@stylistic/no-multiple-empty-lines": "error", "@stylistic/no-trailing-spaces": "error", "@stylistic/no-whitespace-before-property": "error", "@stylistic/object-curly-newline": ["error", { consistent: true }], "@stylistic/object-curly-spacing": ["error", "always"], "@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }], + "@stylistic/one-var-declaration-per-line": "error", "@stylistic/operator-linebreak": ["error", "after"], "@stylistic/padded-blocks": ["error", "never"], "@stylistic/quote-props": ["error", "consistent-as-needed", { keywords: true, numbers: true }], @@@ -99,6 -94,7 +102,7 @@@ "no-caller": "error", "no-console": "warn", "no-div-regex": "error", + "no-else-return": ["error", { allowElseIf: false }], "no-eq-null": "error", "no-eval": "error", "no-extend-native": "error", @@@ -109,8 -105,8 +113,8 @@@ "no-implied-eval": "error", "no-invalid-this": "error", "no-iterator": "error", - "no-labels": "error", "no-label-var": "error", + "no-labels": "error", "no-lone-blocks": "error", "no-lonely-if": "error", "no-loop-func": "error", @@@ -134,12 -130,14 +138,14 @@@ "no-unneeded-ternary": "error", "no-unused-expressions": "off", "no-unused-vars": ["error", { caughtErrors: "none" }], + "no-use-before-define": ["error", { functions: false }], "no-useless-call": "error", "no-useless-concat": "error", "no-useless-return": "error", - "no-use-before-define": ["error", { functions: false }], "no-void": "error", "no-warning-comments": "warn", + "operator-assignment": "error", + "prefer-object-spread": "error", "radix": ["error", "always"], "yoda": "error" }