Skip to content

Commit

Permalink
Update @typescript-eslint parser and plugin (#230)
Browse files Browse the repository at this point in the history
The packages `@typescript-eslint/parser` and
`@typescript-eslint/plugin` have been updated from v4 to v5.

We are affected only by the changes to the recommended configuration.
The rule `@typescript-eslint/explicit-module-boundary-types` is no
longer recommended, so we don't have to explicitly disable it anymore.
There are two new recommended rules:
`@typescript-eslint/no-loss-of-precision` [1] and
`@typescript-eslint/no-unnecessary-type-constraint` [2].

Both of these new rules seem useful, so they have been left enabled.

[1]: https://typescript-eslint.io/rules/no-loss-of-precision
[2]: https://typescript-eslint.io/rules/no-unnecessary-type-constraint
  • Loading branch information
Gudahtt authored Aug 15, 2022
1 parent 88cb0e8 commit 7023c31
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 64 deletions.
4 changes: 2 additions & 2 deletions packages/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ MetaMask's [TypeScript](https://www.typescriptlang.org) ESLint configuration.
yarn add --dev \
@metamask/eslint-config@^9.0.0 \
@metamask/eslint-config-typescript@^9.0.1 \
@typescript-eslint/eslint-plugin@^4.20.0 \
@typescript-eslint/parser@^4.20.0 \
@typescript-eslint/eslint-plugin@^5.33.0 \
@typescript-eslint/parser@^5.33.0 \
eslint@^7.23.0 \
eslint-config-prettier@^8.1.0 \
eslint-plugin-import@^2.22.1 \
Expand Down
8 changes: 4 additions & 4 deletions packages/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
"homepage": "https://github.com/MetaMask/eslint-config#readme",
"devDependencies": {
"@metamask/eslint-config": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"eslint": "^7.23.0",
"typescript": "^4.0.7"
},
"peerDependencies": {
"@metamask/eslint-config": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^4.20.0",
"@typescript-eslint/parser": "^4.20.0",
"@typescript-eslint/eslint-plugin": "^5.33.0",
"@typescript-eslint/parser": "^5.33.0",
"eslint": "^7.23.0",
"typescript": "^4.0.7"
}
Expand Down
4 changes: 3 additions & 1 deletion packages/typescript/rules-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/default-param-last": "error",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-dupe-class-members": "error",
"@typescript-eslint/no-empty-function": "error",
Expand All @@ -15,6 +14,7 @@
"@typescript-eslint/no-extra-non-null-assertion": "error",
"@typescript-eslint/no-extra-semi": "off",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-loss-of-precision": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": [
"error",
Expand All @@ -33,6 +33,7 @@
}
],
"@typescript-eslint/no-this-alias": "error",
"@typescript-eslint/no-unnecessary-type-constraint": "error",
"@typescript-eslint/no-unused-expressions": [
"error",
{
Expand Down Expand Up @@ -85,6 +86,7 @@
"no-extra-semi": "off",
"no-func-assign": "off",
"no-import-assign": "off",
"no-loss-of-precision": "off",
"no-new-symbol": "off",
"no-obj-calls": "off",
"no-redeclare": "off",
Expand Down
1 change: 0 additions & 1 deletion packages/typescript/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ module.exports = {
'@typescript-eslint/array-type': 'error',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-namespace': [
'error',
Expand Down
Loading

0 comments on commit 7023c31

Please sign in to comment.