diff --git a/eslint.config.mjs b/eslint.config.mjs index af9bac3dd9..71dc25e22b 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -12,6 +12,7 @@ import js from "@eslint/js"; import eslint from "eslint"; import { FlatCompat } from "@eslint/eslintrc"; import { fixupConfigRules } from "@eslint/compat"; +import stylistic from "@stylistic/eslint-plugin"; import esx from "eslint-plugin-es-x" /** @type {import("eslint").Linter.Config} */ @@ -56,61 +57,63 @@ js.configs.recommended, sourceType: "commonjs", }, + plugins: { + "@stylistic": stylistic + }, + rules: { - "array-bracket-newline": "off", - "array-bracket-spacing": "off", + "@stylistic/array-bracket-newline": "off", + "@stylistic/array-bracket-spacing": "off", "array-callback-return": "off", - "array-element-newline": "off", + "@stylistic/array-element-newline": "off", "arrow-body-style": "error", - "arrow-parens": ["error", "as-needed"], - "arrow-spacing": ["error", { + "@stylistic/arrow-parens": ["error", "as-needed"], + "@stylistic/arrow-spacing": ["error", { after: true, before: true, }], "block-scoped-var": "off", - "block-spacing": "off", - "brace-style": "off", + "@stylistic/block-spacing": "off", + "@stylistic/brace-style": "off", "callback-return": "off", camelcase: "off", "capitalized-comments": "off", "class-methods-use-this": "error", - "comma-dangle": "off", - "comma-spacing": "off", - "comma-style": "off", + "@stylistic/comma-dangle": "off", + "@stylistic/comma-spacing": "off", + "@stylistic/comma-style": "off", complexity: "off", - "computed-property-spacing": "off", + "@stylistic/computed-property-spacing": "off", "consistent-return": "off", "consistent-this": "off", curly: "off", "default-case": "off", "default-case-last": "error", "default-param-last": "error", - "dot-location": "off", + "@stylistic/dot-location": "off", "dot-notation": "off", - "eol-last": "off", + "@stylistic/eol-last": "off", eqeqeq: "off", - "func-call-spacing": "off", + "@stylistic/func-call-spacing": "off", "func-name-matching": "off", "func-names": "off", "func-style": "off", - "function-call-argument-newline": "off", - "function-paren-newline": "off", - "generator-star-spacing": "error", + "@stylistic/function-call-argument-newline": "off", + "@stylistic/function-paren-newline": "off", + "@stylistic/generator-star-spacing": "error", "global-require": "off", "grouped-accessor-pairs": "error", "guard-for-in": "off", "handle-callback-err": "off", - "id-blacklist": "error", "id-denylist": "error", "id-length": "off", "id-match": "error", - "implicit-arrow-linebreak": "error", - indent: "off", - "indent-legacy": "off", + "@stylistic/implicit-arrow-linebreak": "error", + "@stylistic/indent": "off", "init-declarations": "off", - "jsx-quotes": "error", - "key-spacing": "off", - "keyword-spacing": ["error", { + "@stylistic/jsx-quotes": "error", + "@stylistic/key-spacing": "off", + "@stylistic/keyword-spacing": ["error", { before: true, after: false, overrides: { @@ -122,34 +125,33 @@ js.configs.recommended, try: { after: true }, }, }], - "line-comment-position": "off", - "linebreak-style": "off", - "lines-around-comment": "off", - "lines-around-directive": "off", - "lines-between-class-members": "error", + "@stylistic/line-comment-position": "off", + "@stylistic/linebreak-style": "off", + "@stylistic/lines-around-comment": "off", + "@stylistic/lines-around-directive": "off", + "@stylistic/lines-between-class-members": "error", "max-classes-per-file": "error", "max-depth": "off", - "max-len": "off", + "@stylistic/max-len": "off", "max-lines": "off", "max-lines-per-function": "off", "max-nested-callbacks": "error", "max-params": "off", "max-statements": "off", - "max-statements-per-line": "off", - "multiline-comment-style": "off", - "multiline-ternary": "off", - "new-parens": "off", - "newline-after-var": "off", - "newline-before-return": "off", - "newline-per-chained-call": "off", + "@stylistic/max-statements-per-line": "off", + "@stylistic/multiline-comment-style": "off", + "@stylistic/multiline-ternary": "off", + "@stylistic/new-parens": "off", + "@stylistic/newline-after-var": "off", + "@stylistic/newline-before-return": "off", + "@stylistic/newline-per-chained-call": "off", "no-alert": "off", "no-array-constructor": "off", "no-await-in-loop": "error", "no-bitwise": "off", "no-buffer-constructor": "off", "no-caller": "error", - "no-catch-shadow": "off", - "no-confusing-arrow": "error", + "@stylistic/no-confusing-arrow": "error", "no-console": "off", "no-constant-condition": ["error", { checkLoops: false }], "no-constructor-return": "error", @@ -163,8 +165,8 @@ js.configs.recommended, "no-extend-native": "off", "no-extra-bind": "off", "no-extra-label": "off", - "no-extra-parens": "off", - "no-floating-decimal": "off", + "@stylistic/no-extra-parens": "off", + "@stylistic/no-floating-decimal": "off", "no-implicit-coercion": ["error", { boolean: false, number: false, @@ -182,19 +184,19 @@ js.configs.recommended, "no-loop-func": "off", "no-loss-of-precision": "error", "no-magic-numbers": "off", - "no-mixed-operators": "off", + "@stylistic/no-mixed-operators": "off", "no-mixed-requires": "off", "no-multi-assign": "off", - "no-multi-spaces": "off", + "@stylistic/no-multi-spaces": "off", "no-multi-str": "error", - "no-multiple-empty-lines": "off", - "no-native-reassign": "off", + "@stylistic/no-multiple-empty-lines": "off", + "@stylistic/no-native-reassign": "off", "no-negated-condition": "off", - "no-negated-in-lhs": "error", + "no-unsafe-negation": "error", "no-nested-ternary": "off", "no-new": "off", "no-new-func": "off", - "no-new-object": "off", + "no-object-constructor": "off", "no-new-require": "error", "no-new-wrappers": "error", "no-octal-escape": "error", @@ -212,18 +214,17 @@ js.configs.recommended, "no-restricted-properties": "error", "no-restricted-syntax": "error", "no-return-assign": "off", - "no-return-await": "off", "no-script-url": "off", "no-self-compare": "off", "no-sequences": "off", "no-shadow": "off", - "no-spaced-func": "off", + "@stylistic/no-spaced-func": "off", "no-sync": "off", - "no-tabs": "off", + "@stylistic/no-tabs": "off", "no-template-curly-in-string": "error", "no-ternary": "off", "no-throw-literal": "off", - "no-trailing-spaces": "off", + "@stylistic/no-trailing-spaces": "off", "no-undef-init": "off", "no-undefined": "off", "no-underscore-dangle": "off", @@ -242,18 +243,18 @@ js.configs.recommended, "no-var": "off", "no-void": "off", "no-warning-comments": "off", - "no-whitespace-before-property": "error", - "nonblock-statement-body-position": ["error", "any"], - "object-curly-newline": "off", - "object-curly-spacing": "off", - "object-property-newline": "off", + "@stylistic/no-whitespace-before-property": "error", + "@stylistic/nonblock-statement-body-position": ["error", "any"], + "@stylistic/object-curly-newline": "off", + "@stylistic/object-curly-spacing": "off", + "@stylistic/object-property-newline": "off", "object-shorthand": "off", "one-var": "off", - "one-var-declaration-per-line": "off", + "@stylistic/one-var-declaration-per-line": "off", "operator-assignment": "off", - "operator-linebreak": "off", - "padded-blocks": "off", - "padding-line-between-statements": "error", + "@stylistic/operator-linebreak": "off", + "@stylistic/padded-blocks": "off", + "@stylistic/padding-line-between-statements": "error", "prefer-arrow-callback": "off", "prefer-const": "off", "prefer-destructuring": "off", @@ -262,52 +263,51 @@ js.configs.recommended, "prefer-numeric-literals": "error", "prefer-object-spread": "off", "prefer-promise-reject-errors": "error", - "prefer-reflect": "off", "prefer-regex-literals": "off", "prefer-rest-params": "off", "prefer-spread": "off", "prefer-template": "off", - "quote-props": "off", - quotes: ["error", "double", { avoidEscape: true }], + "@stylistic/quote-props": "off", + "@stylistic/quotes": ["error", "double", { avoidEscape: true }], radix: "off", "require-atomic-updates": "error", "require-await": "error", "require-jsdoc": "off", "require-unicode-regexp": "off", - "rest-spread-spacing": "error", - semi: "off", - "semi-spacing": "off", - "semi-style": "off", + "@stylistic/rest-spread-spacing": "error", + "@stylistic/semi": "off", + "@stylistic/semi-spacing": "off", + "@stylistic/semi-style": "off", "sort-imports": "error", "sort-keys": "off", "sort-vars": "off", - "space-before-blocks": "off", - "space-before-function-paren": "off", - "space-in-parens": "off", - "space-infix-ops": "off", - "space-unary-ops": "off", - "spaced-comment": "off", + "@stylistic/space-before-blocks": "off", + "@stylistic/space-before-function-paren": "off", + "@stylistic/space-in-parens": "off", + "@stylistic/space-infix-ops": "off", + "@stylistic/space-unary-ops": "off", + "@stylistic/spaced-comment": "off", strict: "off", - "switch-colon-spacing": "off", + "@stylistic/switch-colon-spacing": "off", "symbol-description": "error", - "template-curly-spacing": "error", - "template-tag-spacing": "error", + "@stylistic/template-curly-spacing": "error", + "@stylistic/template-tag-spacing": "error", "unicode-bom": ["error", "never"], "valid-jsdoc": "off", "valid-typeof": ["error", { requireStringLiterals: false }], "vars-on-top": "off", - "wrap-iife": "off", - "wrap-regex": "off", - "yield-star-spacing": "error", + "@stylistic/wrap-iife": "off", + "@stylistic/wrap-regex": "off", + "@stylistic/yield-star-spacing": "error", yoda: "off", // temporary rules "no-useless-escape": "off", "no-unused-vars": "off", "no-empty": "off", - "no-extra-semi": "off", + "@stylistic/no-extra-semi": "off", "no-redeclare": "off", "no-control-regex": "off", - "no-mixed-spaces-and-tabs": "off", + "@stylistic/no-mixed-spaces-and-tabs": "off", "no-extra-boolean-cast": "off", "no-prototype-builtins": "off", "no-undef": "off", diff --git a/package.json b/package.json index f9702b0b58..4b78323224 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,9 @@ "@eslint/js": "9.36.0", "eslint": "9.36.0", "eslint-plugin-es-x": "9.1.0", + "@stylistic/eslint-plugin": "5.4.0", "globals": "16.4.0" }, - "bundleDependencies": [], "license": "BSD", "engines": { "node": ">=0.8.2"