Skip to content

Commit

Permalink
migrate all deprecated style rules to @stylistic
Browse files Browse the repository at this point in the history
  • Loading branch information
iamnapo committed Apr 3, 2024
1 parent 8346417 commit 27bf36c
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 27 deletions.
28 changes: 18 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,25 @@ module.exports = {
node: true,
},
extends: ["airbnb/base", "plugin:ava/recommended", "plugin:unicorn/recommended"],
plugins: ["ava", "unicorn"],
plugins: ["ava", "unicorn", "@stylistic"],
reportUnusedDisableDirectives: true,
rules: {
"array-callback-return": ["error", { allowImplicit: true }],
"class-methods-use-this": "off",
"func-names": ["error", "never"],
"function-paren-newline": ["error", "consistent"],
"function-paren-newline": "off",
"global-require": "off",
"import/extensions": ["error", "ignorePackages"],
"import/no-anonymous-default-export": "error",
"import/no-duplicates": ["error", { considerQueryString: true, "prefer-inline": true }],
"import/order": ["error", { "newlines-between": "always" }],
"import/prefer-default-export": "off",
indent: ["error", "tab", { SwitchCase: 1 }],
"max-len": ["error", { code: 130, tabWidth: 2, ignoreUrls: true, ignoreRegExpLiterals: true, ignoreStrings: true, ignoreTemplateLiterals: true }],
indent: "off",
"no-await-in-loop": "off",
"no-console": "off",
"no-implicit-coercion": "error",
"no-mixed-operators": "error",
"no-multiple-empty-lines": ["error", { max: 1 }],
"no-mixed-operators": "off",
"no-multiple-empty-lines": "off",
"no-negated-condition": "error",
"no-nested-ternary": "off",
"no-param-reassign": "off",
Expand All @@ -38,18 +37,27 @@ module.exports = {
"no-unused-vars": ["error", { args: "after-used", ignoreRestSiblings: true, vars: "all", varsIgnorePattern: "^_" }],
"no-use-before-define": ["error", { functions: false }],
"object-curly-newline": "off",
"padding-line-between-statements": ["error", { blankLine: "always", prev: "multiline-block-like", next: "*" }],
"padding-line-between-statements": "off",
"prefer-destructuring": "off",
"prefer-regex-literals": "error",
quotes: ["error", "double"],
quotes: "off",
"require-await": "error",
"space-before-function-paren": ["error", { anonymous: "always", named: "never", asyncArrow: "always" }],
"space-before-function-paren": "off",
"unicorn/consistent-destructuring": "error",
"unicorn/no-array-callback-reference": "off",
"unicorn/no-nested-ternary": "off",
"unicorn/no-null": "off",
"unicorn/prefer-switch": ["error", { emptyDefaultCase: "do-nothing-comment" }],
"unicorn/prevent-abbreviations": "off",
"wrap-iife": ["error", "inside", { functionPrototypeMethods: true }],
"wrap-iife": "off",
"@stylistic/function-paren-newline": ["error", "consistent"],
"@stylistic/indent": ["error", "tab", { SwitchCase: 1 }],
"@stylistic/max-len": ["error", { code: 130, tabWidth: 2, ignoreUrls: true, ignoreRegExpLiterals: true, ignoreStrings: true, ignoreTemplateLiterals: true }],
"@stylistic/no-mixed-operators": "error",
"@stylistic/no-multiple-empty-lines": ["error", { max: 1 }],
"@stylistic/padding-line-between-statements": ["error", { blankLine: "always", prev: "multiline-block-like", next: "*" }],
"@stylistic/quotes": ["error", "double"],
"@stylistic/space-before-function-paren": ["error", { anonymous: "always", named: "never", asyncArrow: "always" }],
"@stylistic/wrap-iife": ["error", "inside", { functionPrototypeMethods: true }],
},
};
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,22 @@
}
},
"dependencies": {
"@rushstack/eslint-patch": "^1.7.2",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"@rushstack/eslint-patch": "^1.10.1",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.1.0",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-plugin-ava": "^14.0.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-unicorn": "^51.0.1"
"eslint-plugin-unicorn": "^52.0.0"
},
"devDependencies": {
"eslint": "^8.56.0",
"typescript": "^5.3.3"
"@stylistic/eslint-plugin": "^1.7.0",
"eslint": "^8.57.0",
"typescript": "^5.4.3"
},
"peerDependencies": {
"eslint": "^8.0.0",
Expand Down
24 changes: 15 additions & 9 deletions typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,34 @@ module.exports = {
"airbnb-typescript/base",
"plugin:@typescript-eslint/recommended-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:@stylistic/disable-legacy",
],
plugins: ["@typescript-eslint"],
parserOptions: {
project: true,
},
rules: {
indent: "off",
"no-void": ["error", { allowAsStatement: true }],
quotes: ["off"],
"@stylistic/brace-style": "error",
"@stylistic/comma-dangle": ["error", "always-multiline"],
"@stylistic/comma-spacing": "error",
"@stylistic/func-call-spacing": "error",
"@stylistic/keyword-spacing": "error",
"@stylistic/lines-between-class-members": "error",
"@stylistic/member-delimiter-style": ["error", { multiline: { delimiter: "semi", requireLast: true }, singleline: { delimiter: "semi", requireLast: false } }],
"@stylistic/no-extra-semi": "error",
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/semi": "error",
"@stylistic/space-before-blocks": "error",
"@stylistic/space-before-function-paren": "error",
"@stylistic/space-infix-ops": "error",
"@stylistic/type-annotation-spacing": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/consistent-type-imports": [
"error",
{ disallowTypeAnnotations: false, fixStyle: "inline-type-imports" },
],
"@typescript-eslint/indent": ["error", "tab", { SwitchCase: 1 }],
"@typescript-eslint/member-delimiter-style": [
"error",
{ multiline: { delimiter: "semi", requireLast: true }, singleline: { delimiter: "semi", requireLast: false } },
],
"@typescript-eslint/no-import-type-side-effects": "error",
"@typescript-eslint/prefer-nullish-coalescing": ["error", { ignoreConditionalTests: true, ignorePrimitives: { number: true, bigint: true } }],
"@typescript-eslint/quotes": ["error", "double"],
"@typescript-eslint/type-annotation-spacing": "error",
},
};

0 comments on commit 27bf36c

Please sign in to comment.