-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [#174293075,#174458516] Migrate from tslint to eslint (#2169)
* start porting from tslint to eslint and upgrade prettier * configure prettier and clean eslint config * add tslint ignore * refine settings * fix eslint * fix eslint * fix eslint * fix lint * migrate to default import image comply with eslint * fix lint * fix ban types * fix eslint * fix import order * fix danger * fix danger * replace operator * prettify all with the latest version * add missing rule "spaced-comment" * add missing rules * update rules * add missing rules * add missing rules * add arrow-body-style * restore array rule * add missing rules * add no-floating-promises rule * no-unused-expression * complete mapping rules for @typescript-eslint * rename lint-typescript to eslint in circleci * add missing rules * add functional rules * add sonar * remove tslint * remove unused plugin * missing yarn lock * merge Dangerfile.ts * [#174293075] lint fixes Co-authored-by: Matteo Boschi <[email protected]>
- Loading branch information
1 parent
f1a4432
commit 1cc7335
Showing
329 changed files
with
2,360 additions
and
2,718 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
locales/locales.ts | ||
ts/utils/__tests__/xss.test.ts | ||
definitions/* |
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,93 @@ | ||
module.exports = { | ||
root: true, | ||
extends: [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
"plugin:sonarjs/recommended", | ||
"prettier", | ||
"prettier/@typescript-eslint" | ||
], | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "tsconfig.json", | ||
sourceType: "module" | ||
}, | ||
plugins: ["@typescript-eslint", "react", "import", "functional", "sonarjs"], | ||
rules: { | ||
"no-case-declarations": "off", | ||
"no-inner-declarations": "off", | ||
"prefer-const": "error", | ||
curly: "error", | ||
"spaced-comment": ["error", "always", { block: { balanced: true } }], | ||
radix: "error", | ||
"one-var": ["error", "never"], | ||
"object-shorthand": "error", | ||
"no-var": "error", | ||
"no-param-reassign": "error", | ||
"no-underscore-dangle": "error", | ||
"no-undef-init": "error", | ||
"no-throw-literal": "error", | ||
"no-new-wrappers": "error", | ||
"no-eval": "error", | ||
"no-console": "error", | ||
"no-caller": "error", | ||
"no-bitwise": "error", | ||
eqeqeq: ["error", "smart"], | ||
"max-classes-per-file": ["error", 1], | ||
"guard-for-in": "error", | ||
complexity: "error", | ||
"arrow-body-style": "error", | ||
"import/order": "error", | ||
"@typescript-eslint/no-unused-vars": "off", | ||
// Enable if we want to enforce the return type for all the functions | ||
"@typescript-eslint/explicit-module-boundary-types": "off", | ||
"@typescript-eslint/no-inferrable-types": "off", | ||
// TODO: added for compatibility. Removing this line we have to remove all the any usage in the code | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/array-type": [ | ||
"error", | ||
{ | ||
default: "generic" | ||
} | ||
], | ||
"@typescript-eslint/await-thenable": "error", | ||
"@typescript-eslint/consistent-type-assertions": "error", | ||
"@typescript-eslint/dot-notation": "error", | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"error", | ||
{ | ||
multiline: { | ||
delimiter: "semi", | ||
requireLast: true | ||
}, | ||
singleline: { | ||
delimiter: "semi", | ||
requireLast: false | ||
} | ||
} | ||
], | ||
"@typescript-eslint/no-floating-promises": "error", | ||
"no-unused-expressions": "off", | ||
"@typescript-eslint/no-unused-expressions": ["error"], | ||
"@typescript-eslint/prefer-function-type": "error", | ||
"@typescript-eslint/restrict-plus-operands": "error", | ||
semi: "off", | ||
"@typescript-eslint/semi": ["error"], | ||
"@typescript-eslint/unified-signatures": "error", | ||
"react/prop-types": "off", | ||
"react/display-name": "off", | ||
"react/jsx-key": "error", | ||
"react/jsx-no-bind": ["error", { allowArrowFunctions: true }], | ||
"functional/no-let": "error", | ||
"functional/immutable-data": "error", | ||
"sonarjs/no-small-switch": "off", | ||
"sonarjs/no-duplicate-string": "off" | ||
}, | ||
settings: { | ||
react: { | ||
version: "detect" | ||
} | ||
} | ||
}; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
10.13.0 | ||
10.18.0 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
module.exports = { | ||
bracketSpacing: false, | ||
jsxBracketSameLine: true, | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
trailingComma: "none", | ||
arrowParens: "avoid", | ||
parser: "typescript" | ||
}; |
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
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
Oops, something went wrong.