-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #166 from RightCapitalHQ/feature/remove-unnecessar…
…y-and-deprecated-rules feat: remove unnecessary and deprecated rules
- Loading branch information
Showing
27 changed files
with
1,198 additions
and
5,591 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@rightcapital-eslint-config-base-533ee8bb-43e2-4aac-98aa-0743da157aa8.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"comment": "feat: remove unnecessary rules, migrate deprecated rules and tweak configs", | ||
"type": "major", | ||
"packageName": "@rightcapital/eslint-config-base", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@rightcapital-eslint-config-javascript-6fbc77dd-536a-44c3-86a8-18473a1fc2e3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"comment": "feat: remove unnecessary rules, migrate deprecated rules and tweak configs", | ||
"type": "major", | ||
"packageName": "@rightcapital/eslint-config-javascript", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@rightcapital-eslint-config-typescript-bd60cf26-8ff8-4d56-8f3f-beda1d170181.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"comment": "feat: remove unnecessary rules, migrate deprecated rules and tweak configs", | ||
"type": "major", | ||
"packageName": "@rightcapital/eslint-config-typescript", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
...ge/@rightcapital-eslint-config-typescript-react-552d208c-9bb9-490a-9443-a528bfa11cfe.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"comment": "feat: remove unnecessary rules, migrate deprecated rules and tweak configs", | ||
"type": "major", | ||
"packageName": "@rightcapital/eslint-config-typescript-react", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,7 @@ | |
"main": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"files": [ | ||
"lib/index.js", | ||
"lib/index.d.ts" | ||
"lib" | ||
], | ||
"scripts": { | ||
"prebuild": "pnpm run clean", | ||
|
@@ -24,12 +23,13 @@ | |
}, | ||
"dependencies": { | ||
"@rushstack/eslint-patch": "1.10.3", | ||
"@stylistic/eslint-plugin-js": "2.3.0", | ||
"confusing-browser-globals": "1.0.11", | ||
"eslint-import-resolver-typescript": "3.6.1", | ||
"eslint-plugin-import": "npm:[email protected]", | ||
"eslint-plugin-n": "17.9.0", | ||
"eslint-plugin-simple-import-sort": "12.1.0", | ||
"eslint-plugin-unicorn": "54.0.0", | ||
"semver": "7.6.2" | ||
"eslint-plugin-unicorn": "54.0.0" | ||
}, | ||
"devDependencies": { | ||
"@rightcapital/tsconfig": "workspace:*", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,8 @@ import type { Linter } from 'eslint'; | |
// extracted from [email protected] | ||
// https://github.com/airbnb/javascript/blob/eslint-config-airbnb-base-v15.0.0/packages/eslint-config-airbnb-base/rules/best-practices.js | ||
const config: Linter.Config = { | ||
plugins: ['unicorn'], | ||
rules: { | ||
// enforces getter/setter pairs in objects | ||
// https://eslint.org/docs/rules/accessor-pairs | ||
'accessor-pairs': 'off', | ||
|
||
// enforces return statements in callbacks of array's methods | ||
// https://eslint.org/docs/rules/array-callback-return | ||
'array-callback-return': ['error', { allowImplicit: true }], | ||
|
@@ -16,26 +13,13 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/block-scoped-var | ||
'block-scoped-var': 'error', | ||
|
||
// specify the maximum cyclomatic complexity allowed in a program | ||
// https://eslint.org/docs/rules/complexity | ||
complexity: ['off', 20], | ||
|
||
// enforce that class methods use "this" | ||
// https://eslint.org/docs/rules/class-methods-use-this | ||
'class-methods-use-this': [ | ||
'error', | ||
{ | ||
exceptMethods: [], | ||
}, | ||
], | ||
|
||
// require return statements to either always or never specify values | ||
// https://eslint.org/docs/rules/consistent-return | ||
'consistent-return': 'error', | ||
|
||
// specify curly brace conventions for all control statements | ||
// https://eslint.org/docs/rules/curly | ||
curly: ['error', 'multi-line'], // multiline | ||
curly: ['error', 'all'], | ||
|
||
// require default case in switch statements | ||
// https://eslint.org/docs/rules/default-case | ||
|
@@ -45,17 +29,10 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/default-case-last | ||
'default-case-last': 'error', | ||
|
||
// https://eslint.org/docs/rules/default-param-last | ||
'default-param-last': 'error', | ||
|
||
// encourages use of dot notation whenever possible | ||
// https://eslint.org/docs/rules/dot-notation | ||
'dot-notation': ['error', { allowKeywords: true }], | ||
|
||
// enforces consistent newlines before or after dots | ||
// https://eslint.org/docs/rules/dot-location | ||
'dot-location': ['error', 'property'], | ||
|
||
// require the use of === and !== | ||
// https://eslint.org/docs/rules/eqeqeq | ||
eqeqeq: ['error', 'always', { null: 'ignore' }], | ||
|
@@ -88,10 +65,6 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/no-constructor-return | ||
'no-constructor-return': 'error', | ||
|
||
// disallow division operators explicitly at beginning of regular expression | ||
// https://eslint.org/docs/rules/no-div-regex | ||
'no-div-regex': 'off', | ||
|
||
// disallow else after a return in an if | ||
// https://eslint.org/docs/rules/no-else-return | ||
'no-else-return': ['error', { allowElseIf: false }], | ||
|
@@ -109,10 +82,6 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/no-empty-pattern | ||
'no-empty-pattern': 'error', | ||
|
||
// disallow comparisons to null without a type-checking operator | ||
// https://eslint.org/docs/rules/no-eq-null | ||
'no-eq-null': 'off', | ||
|
||
// disallow use of eval() | ||
// https://eslint.org/docs/rules/no-eval | ||
'no-eval': 'error', | ||
|
@@ -133,42 +102,14 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/no-fallthrough | ||
'no-fallthrough': 'error', | ||
|
||
// disallow the use of leading or trailing decimal points in numeric literals | ||
// https://eslint.org/docs/rules/no-floating-decimal | ||
'no-floating-decimal': 'error', | ||
|
||
// disallow reassignments of native objects or read-only globals | ||
// https://eslint.org/docs/rules/no-global-assign | ||
'no-global-assign': ['error', { exceptions: [] }], | ||
|
||
// deprecated in favor of no-global-assign | ||
// https://eslint.org/docs/rules/no-native-reassign | ||
'no-native-reassign': 'off', | ||
|
||
// disallow implicit type conversions | ||
// https://eslint.org/docs/rules/no-implicit-coercion | ||
'no-implicit-coercion': [ | ||
'off', | ||
{ | ||
boolean: false, | ||
number: true, | ||
string: true, | ||
allow: [], | ||
}, | ||
], | ||
|
||
// disallow var and named functions in global scope | ||
// https://eslint.org/docs/rules/no-implicit-globals | ||
'no-implicit-globals': 'off', | ||
|
||
// disallow use of eval()-like methods | ||
// https://eslint.org/docs/rules/no-implied-eval | ||
'no-implied-eval': 'error', | ||
|
||
// disallow this keywords outside of classes or class-like objects | ||
// https://eslint.org/docs/rules/no-invalid-this | ||
'no-invalid-this': 'off', | ||
|
||
// disallow usage of __iterator__ property | ||
// https://eslint.org/docs/rules/no-iterator | ||
'no-iterator': 'error', | ||
|
@@ -185,27 +126,6 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/no-loop-func | ||
'no-loop-func': 'error', | ||
|
||
// disallow magic numbers | ||
// https://eslint.org/docs/rules/no-magic-numbers | ||
'no-magic-numbers': [ | ||
'off', | ||
{ | ||
ignore: [], | ||
ignoreArrayIndexes: true, | ||
enforceConst: true, | ||
detectObjects: false, | ||
}, | ||
], | ||
|
||
// disallow use of multiple spaces | ||
// https://eslint.org/docs/rules/no-multi-spaces | ||
'no-multi-spaces': [ | ||
'error', | ||
{ | ||
ignoreEOLComments: false, | ||
}, | ||
], | ||
|
||
// disallow use of multiline strings | ||
// https://eslint.org/docs/rules/no-multi-str | ||
'no-multi-str': 'error', | ||
|
@@ -353,10 +273,6 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/no-throw-literal | ||
'no-throw-literal': 'error', | ||
|
||
// disallow unmodified conditions of loops | ||
// https://eslint.org/docs/rules/no-unmodified-loop-condition | ||
'no-unmodified-loop-condition': 'off', | ||
|
||
// disallow usage of expressions in statement position | ||
// https://eslint.org/docs/rules/no-unused-expressions | ||
'no-unused-expressions': [ | ||
|
@@ -372,10 +288,6 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/no-unused-labels | ||
'no-unused-labels': 'error', | ||
|
||
// disallow unnecessary .call() and .apply() | ||
// https://eslint.org/docs/rules/no-useless-call | ||
'no-useless-call': 'off', | ||
|
||
// Disallow unnecessary catch clauses | ||
// https://eslint.org/docs/rules/no-useless-catch | ||
'no-useless-catch': 'error', | ||
|
@@ -396,13 +308,6 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/no-void | ||
'no-void': 'error', | ||
|
||
// disallow usage of configurable warning terms in comments: e.g. todo | ||
// https://eslint.org/docs/rules/no-warning-comments | ||
'no-warning-comments': [ | ||
'off', | ||
{ terms: ['todo', 'fixme', 'xxx'], location: 'start' }, | ||
], | ||
|
||
// disallow use of the with statement | ||
// https://eslint.org/docs/rules/no-with | ||
'no-with': 'error', | ||
|
@@ -411,10 +316,6 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/prefer-promise-reject-errors | ||
'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }], | ||
|
||
// Suggest using named capture group in regular expression | ||
// https://eslint.org/docs/rules/prefer-named-capture-group | ||
'prefer-named-capture-group': 'off', | ||
|
||
// https://eslint.org/docs/rules/prefer-regex-literals | ||
'prefer-regex-literals': [ | ||
'error', | ||
|
@@ -427,25 +328,19 @@ const config: Linter.Config = { | |
// https://eslint.org/docs/rules/radix | ||
radix: 'error', | ||
|
||
// require `await` in `async function` (note: this is a horrible rule that should never be used) | ||
// https://eslint.org/docs/rules/require-await | ||
'require-await': 'off', | ||
|
||
// Enforce the use of u flag on RegExp | ||
// https://eslint.org/docs/rules/require-unicode-regexp | ||
'require-unicode-regexp': 'off', | ||
|
||
// requires to declare all vars on top of their containing scope | ||
// https://eslint.org/docs/rules/vars-on-top | ||
'vars-on-top': 'error', | ||
|
||
// require immediate function invocation to be wrapped in parentheses | ||
// https://eslint.org/docs/rules/wrap-iife.html | ||
'wrap-iife': ['error', 'outside', { functionPrototypeMethods: false }], | ||
|
||
// require or disallow Yoda conditions | ||
// https://eslint.org/docs/rules/yoda | ||
yoda: 'error', | ||
|
||
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md | ||
'unicorn/prefer-node-protocol': 'error', | ||
|
||
// https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/text-encoding-identifier-case.md | ||
'unicorn/text-encoding-identifier-case': 'error', | ||
}, | ||
}; | ||
|
||
|
Oops, something went wrong.