Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
chore: rename deprecated rules
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreDemailly committed Jul 2, 2024
1 parent 58f2298 commit 0a23898
Show file tree
Hide file tree
Showing 10 changed files with 170 additions and 144 deletions.
22 changes: 22 additions & 0 deletions config.eslint.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Import Node.js Dependencies
import path from "node:path";
import { fileURLToPath } from "node:url";

// Import Third-party Dependencies
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname
});

export default [
...compat.extends("@nodesecure/eslint-config"), {
languageOptions: {
parserOptions: {
requireConfigFile: false
}
}
}];
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const extendedRules = [
join(kRootRulesDir, "possible-errors.js"),
join(kRootRulesDir, "best-practices.js"),
join(kRootRulesDir, "styles.js"),
join(kRootRulesDir, "ecmascript6.js")
join(kRootRulesDir, "ecmascript6.js"),
join(kRootRulesDir, "eslintv9.js"),
join(kRootRulesDir, "variables.js"),
];
if (useTypeScript) {
extendedRules.push(join(kRootRulesDir, "typescript.js"));
Expand All @@ -34,8 +36,12 @@ if (useTypeScript) {
}

module.exports = {
plugins: ["@stylistic/js"],
env: {
node: true
},
extends: extendsRequired,
parser,
parserOptions,
rules
rules,
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@babel/eslint-parser": "^7.24.7",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.6.0",
"@stylistic/eslint-plugin-js": "^2.3.0",
"@typescript-eslint/eslint-plugin": "8.0.0-alpha.40",
"@typescript-eslint/parser": "8.0.0-alpha.40",
"eslint": "^9.6.0"
Expand Down
20 changes: 10 additions & 10 deletions src/best-practices.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const rules = {
// See: https://eslint.org/docs/rules/default-case
"default-case": "off",

// See: https://eslint.org/docs/rules/dot-location
"dot-location": ["error", "property"],
// See: https://eslint.style/rules/js/dot-location
"@stylistic/js/dot-location": ["error", "property"],

// See: https://eslint.org/docs/rules/dot-notation
"dot-notation": "error",
Expand Down Expand Up @@ -80,8 +80,8 @@ const rules = {
// See: https://eslint.org/docs/rules/no-fallthrough
"no-fallthrough": "error",

// See: https://eslint.org/docs/rules/no-floating-decimal
"no-floating-decimal": "error",
// See: https://eslint.style/rules/js/no-floating-decimal
"@stylistic/js/no-floating-decimal": "error",

// See: https://eslint.org/docs/rules/no-global-assign
"no-global-assign": "error",
Expand Down Expand Up @@ -113,8 +113,8 @@ const rules = {
// See: https://eslint.org/docs/rules/no-magic-numbers
"no-magic-numbers": "off",

// See: https://eslint.org/docs/rules/no-multi-spaces
"no-multi-spaces": "error",
// See: https://eslint.style/rules/no-multi-spaces
"@stylistic/js/no-multi-spaces": "error",

// See: https://eslint.org/docs/rules/no-multi-str
"no-multi-str": "error",
Expand Down Expand Up @@ -149,8 +149,8 @@ const rules = {
// See: https://eslint.org/docs/rules/no-return-assign
"no-return-assign": ["error", "except-parens"],

// See: https://eslint.org/docs/rules/no-return-await
"no-return-await": "off",
// See: https://eslint.style/rules/jsno-return-await
"@stylistic/js/no-return-await": "off",

// See: https://eslint.org/docs/rules/no-script-url
"no-script-url": "error",
Expand Down Expand Up @@ -212,8 +212,8 @@ const rules = {
// See: https://eslint.org/docs/rules/vars-on-top
"vars-on-top": "error",

// See: https://eslint.org/docs/rules/wrap-iife
"wrap-iife": "error",
// See: https://eslint.style/rules/js/wrap-iife
"@stylistic/js/wrap-iife": "error",

// See: https://eslint.org/docs/rules/yoda
"yoda": "error"
Expand Down
28 changes: 14 additions & 14 deletions src/ecmascript6.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ const rules = {
// See: https://eslint.org/docs/rules/arrow-body-style
"arrow-body-style": ["error", "as-needed", { "requireReturnForObjectLiteral": true }],

// See: https://eslint.org/docs/rules/arrow-parens
"arrow-parens": ["error", "always"],
// See: https://eslint.style/rules/arrow-parens
"@stylistic/js/arrow-parens": ["error", "always"],

// See: https://eslint.org/docs/rules/arrow-spacing
"arrow-spacing": "error",
// See: https://eslint.style/rules/arrow-spacing
"@stylistic/js/arrow-spacing": "error",

// See: https://eslint.org/docs/rules/constructor-super
"constructor-super": "error",

// See: https://eslint.org/docs/rules/generator-star-spacing
"generator-star-spacing": ["error", { "before": false, "after": true }],
// See: https://eslint.style/rules/enerator-star-spacing
"@stylistic/js/generator-star-spacing": ["error", { "before": false, "after": true }],

// See: https://eslint.org/docs/rules/no-class-assign
"no-class-assign": "error",

// See: https://eslint.org/docs/rules/no-confusing-arrow
"no-confusing-arrow": ["error", { "allowParens": true }],
// See: https://eslint.style/rules/js/no-confusing-arrow
"@stylistic/js/no-confusing-arrow": ["error", { "allowParens": true }],

// See: https://eslint.org/docs/rules/no-const-assign
"no-const-assign": "error",
Expand Down Expand Up @@ -80,20 +80,20 @@ const rules = {
// See: https://eslint.org/docs/rules/require-yield
"require-yield": "error",

// See: https://eslint.org/docs/rules/rest-spread-spacing
"rest-spread-spacing": ["error", "never"],
// See: https://eslint.style/rules/js/rest-spread-spacing
"@stylistic/js/rest-spread-spacing": ["error", "never"],

// See: https://eslint.org/docs/rules/sort-imports
"sort-imports": "off",

// See: https://eslint.org/docs/rules/symbol-description
"symbol-description": "error",

// See: https://eslint.org/docs/rules/template-curly-spacing
"template-curly-spacing": "error",
// See: https://eslint.style/rules/js/rtemplate-curly-spacing
"@stylistic/js/template-curly-spacing": "error",

// See: https://eslint.org/docs/rules/yield-star-spacing
"yield-star-spacing": ["error", { "before": false, "after": true }]
// See: https://eslint.style/rules/js/ryield-star-spacing
"@stylistic/js/yield-star-spacing": ["error", { "before": false, "after": true }]
};

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion src/eslintv9.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const rules = {
"prefer-named-capture-group": "off",
"prefer-object-has-own": "error",
"prefer-regex-literals": "off",
"strict": "safe"
"strict": "off"
};

module.exports = { rules };
8 changes: 4 additions & 4 deletions src/possible-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ const rules = {
// See: https://eslint.org/docs/rules/no-extra-boolean-cast
"no-extra-boolean-cast": "error",

// See: https://eslint.org/docs/rules/no-extra-parens
"no-extra-parens": "off",
// See: https://eslint.style/rules/js/no-extra-parens
"@stylistic/js/no-extra-parens": "off",

// See: https://eslint.org/docs/rules/no-extra-semi
"no-extra-semi": "error",
// See: https://eslint.style/rules/js/no-extra-semi
"@stylistic/js/no-extra-semi": "error",

// See: https://eslint.org/docs/rules/no-func-assign
"no-func-assign": "error",
Expand Down
Loading

0 comments on commit 0a23898

Please sign in to comment.