@metamask/eslint-config-typescript
Advanced tools
Comparing version 10.0.0 to 11.0.0
@@ -9,5 +9,13 @@ # Changelog | ||
## [11.0.0] | ||
### Added | ||
- **BREAKING:** Add rules that require type information ([#250](https://github.com/MetaMask/eslint-config/pull/250)) | ||
- This requires setting some parser options. See the README for more details. | ||
- **BREAKING:** Bump all ESLint dependencies to the latest version ([#252](https://github.com/MetaMask/eslint-config/pull/252)) | ||
- This includes peer dependencies. | ||
- **BREAKING:** Forbid TypeScript's private modifier in favour of hash names ([#244](https://github.com/MetaMask/eslint-config/pull/244)) | ||
## [10.0.0] | ||
### Changed | ||
- **(BREAKING)** Update ESLint from v7 to v8 ([#233](https://github.com/MetaMask/eslint-config/pull/233)) | ||
- **BREAKING:** Update ESLint from v7 to v8 ([#233](https://github.com/MetaMask/eslint-config/pull/233)) | ||
- This is breaking because `eslint` is a `peerDependency`. | ||
@@ -19,3 +27,3 @@ - Four new rules have been added: | ||
- [`no-useless-backreference`](https://eslint.org/docs/latest/rules/no-useless-backreference) | ||
- **(BREAKING)** Update `@typescript-eslint` parser and plugin ([#230](https://github.com/MetaMask/eslint-config/pull/230)) | ||
- **BREAKING:** Update `@typescript-eslint` parser and plugin ([#230](https://github.com/MetaMask/eslint-config/pull/230)) | ||
- This is breaking because these two packages are `peerDependencies` | ||
@@ -25,4 +33,4 @@ - There are two new rules: | ||
- [`@typescript-eslint/no-unnecessary-type-constraint`](https://typescript-eslint.io/rules/no-unnecessary-type-constraint). | ||
- **(BREAKING)** Update minimium Node.js version to v14 ([#225](https://github.com/MetaMask/eslint-config/pull/225)) | ||
- **(BREAKING)** Forbid TypeScript interfaces ([#216](https://github.com/MetaMask/eslint-config/pull/216)) | ||
- **BREAKING:** Update minimium Node.js version to v14 ([#225](https://github.com/MetaMask/eslint-config/pull/225)) | ||
- **BREAKING:** Forbid TypeScript interfaces ([#216](https://github.com/MetaMask/eslint-config/pull/216)) | ||
- Ignore rest siblings for `no-unused-vars` ([#213](https://github.com/MetaMask/eslint-config/pull/213)) | ||
@@ -38,6 +46,6 @@ - This makes the `no-unused-vars` rule more permissive | ||
### Added | ||
- **BREAKING** Add JSDoc ESLint rules ([#203](https://github.com/MetaMask/eslint-config/pull/203)) | ||
- **BREAKING:** Add JSDoc ESLint rules ([#203](https://github.com/MetaMask/eslint-config/pull/203)) | ||
### Changed | ||
- **BREAKING** Disable `no-throw-literal` and enable `@typescript-eslint/no-throw-literal` ([#201](https://github.com/MetaMask/eslint-config/pull/201)) | ||
- **BREAKING:** Disable `no-throw-literal` and enable `@typescript-eslint/no-throw-literal` ([#201](https://github.com/MetaMask/eslint-config/pull/201)) | ||
- This rule requires type information, which requires [additional project setup](https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md). | ||
@@ -48,3 +56,3 @@ - Note: This change has been undone in v9.0.1. You can ignore this change if you're updating to v9.0.1 or greater. | ||
### Changed | ||
- ***BREAKING*** The peer dependency `@metamask/eslint-config` has been updated from v7 to v8. | ||
- **BREAKING:** The peer dependency `@metamask/eslint-config` has been updated from v7 to v8. | ||
@@ -59,3 +67,3 @@ ## [7.0.1] | ||
### Changed | ||
- **(BREAKING)** Update `@typescript/no-shadow` config ([#168](https://github.com/MetaMask/eslint-config/pull/168)) | ||
- **BREAKING:** Update `@typescript/no-shadow` config ([#168](https://github.com/MetaMask/eslint-config/pull/168)) | ||
- Use recommended `eslint-plugin-import` rule sets ([#184](https://github.com/MetaMask/eslint-config/pull/184)) | ||
@@ -71,5 +79,5 @@ - This only removed or disabled rules, and is not breaking. | ||
### Changed | ||
- **(BREAKING)** Set minimum Node.js version to `^12.0.0` ([#144](https://github.com/MetaMask/eslint-config/pull/144)) | ||
- **(BREAKING)** Set ECMAScript version to `es2020`/`11` ([#150](https://github.com/MetaMask/eslint-config/pull/150)) | ||
- **(BREAKING)** Enable all rules recommended by the `@typescript-eslint` plugin ([#156](https://github.com/MetaMask/eslint-config/pull/156)) | ||
- **BREAKING:** Set minimum Node.js version to `^12.0.0` ([#144](https://github.com/MetaMask/eslint-config/pull/144)) | ||
- **BREAKING:** Set ECMAScript version to `es2020`/`11` ([#150](https://github.com/MetaMask/eslint-config/pull/150)) | ||
- **BREAKING:** Enable all rules recommended by the `@typescript-eslint` plugin ([#156](https://github.com/MetaMask/eslint-config/pull/156)) | ||
- This amounted to setting the following core ESLint rules to `error`: | ||
@@ -86,3 +94,4 @@ - [no-var](https://eslint.org/docs/7.0.0/rules/no-var) | ||
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...HEAD | ||
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v11.0.0...HEAD | ||
[11.0.0]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...v11.0.0 | ||
[10.0.0]: https://github.com/MetaMask/eslint-config/compare/v9.0.1...v10.0.0 | ||
@@ -89,0 +98,0 @@ [9.0.1]: https://github.com/MetaMask/eslint-config/compare/v9.0.0...v9.0.1 |
{ | ||
"name": "@metamask/eslint-config-typescript", | ||
"version": "10.0.0", | ||
"version": "11.0.0", | ||
"description": "Shareable MetaMask ESLint config for TypeScript.", | ||
"main": "src/index.js", | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/", | ||
"access": "public" | ||
"homepage": "https://github.com/MetaMask/eslint-config#readme", | ||
"bugs": { | ||
"url": "https://github.com/MetaMask/eslint-config/issues" | ||
}, | ||
"files": [ | ||
"src/" | ||
], | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"scripts": { | ||
"test": "eslint .", | ||
"publish": "npm publish" | ||
}, | ||
"repository": { | ||
@@ -25,25 +14,38 @@ "type": "git", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/MetaMask/eslint-config/issues" | ||
"main": "src/index.js", | ||
"files": [ | ||
"src/" | ||
], | ||
"scripts": { | ||
"lint:changelog": "auto-changelog validate", | ||
"publish": "npm publish", | ||
"test": "eslint ." | ||
}, | ||
"homepage": "https://github.com/MetaMask/eslint-config#readme", | ||
"devDependencies": { | ||
"@metamask/eslint-config": "^10.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.33.0", | ||
"@typescript-eslint/parser": "^5.33.0", | ||
"eslint": "^8.21.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"@metamask/auto-changelog": "^3.0.0", | ||
"@metamask/eslint-config": "^11.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.42.1", | ||
"@typescript-eslint/parser": "^5.42.1", | ||
"eslint": "^8.27.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-import": "^2.26.0", | ||
"eslint-plugin-jsdoc": "^39.2.9", | ||
"eslint-plugin-jsdoc": "^39.6.2", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.0.7" | ||
"prettier": "^2.7.1", | ||
"typescript": "~4.8.4" | ||
}, | ||
"peerDependencies": { | ||
"@metamask/eslint-config": "^10.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.33.0", | ||
"@typescript-eslint/parser": "^5.33.0", | ||
"eslint": "^8.21.0", | ||
"typescript": "^4.0.7" | ||
"@metamask/eslint-config": "^11.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.42.1", | ||
"@typescript-eslint/parser": "^5.42.1", | ||
"eslint": "^8.27.0", | ||
"typescript": "~4.8.4" | ||
}, | ||
"engines": { | ||
"node": ">=14.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org/" | ||
} | ||
} |
@@ -9,13 +9,12 @@ # `@metamask/eslint-config-typescript` | ||
yarn add --dev \ | ||
@metamask/eslint-config@^9.0.0 \ | ||
@metamask/eslint-config-typescript@^9.0.1 \ | ||
@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 \ | ||
eslint-plugin-jsdoc@^39.2.9 \ | ||
eslint-plugin-prettier@^3.3.1 \ | ||
prettier@^2.2.1 | ||
@metamask/eslint-config@^11.0.0 \ | ||
@metamask/eslint-config-typescript@^11.0.0 \ | ||
@typescript-eslint/eslint-plugin@^5.42.1 \ | ||
@typescript-eslint/parser@^5.42.1 \ | ||
eslint@^8.27.0 \ | ||
eslint-config-prettier@^8.5.0 \ | ||
eslint-plugin-import@^2.26.0 \ | ||
eslint-plugin-jsdoc@^39.6.2 \ | ||
eslint-plugin-prettier@^4.2.1 \ | ||
prettier@^2.7.1 | ||
``` | ||
@@ -45,3 +44,9 @@ | ||
], | ||
// This is required for rules that use type information. | ||
// See here for more information: https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/TYPED_LINTING.md | ||
parserOptions: { | ||
tsconfigRootDir: __dirname, | ||
}, | ||
}; | ||
``` |
@@ -18,2 +18,8 @@ module.exports = { | ||
sourceType: 'module', | ||
// This enables support for linting rules that require type information. We | ||
// assume that the project has a `tsconfig.json` file in the directory where | ||
// ESLint is being run. | ||
tsconfigRootDir: process.cwd(), | ||
project: ['./tsconfig.json'], | ||
}, | ||
@@ -25,2 +31,3 @@ | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'plugin:import/typescript', | ||
@@ -63,2 +70,68 @@ ], | ||
// Recommended rules that require type information | ||
'@typescript-eslint/no-unsafe-argument': 'off', | ||
'@typescript-eslint/no-unsafe-assignment': 'off', | ||
'@typescript-eslint/no-unsafe-call': 'off', | ||
'@typescript-eslint/no-unsafe-member-access': 'off', | ||
'@typescript-eslint/no-unsafe-return': 'off', | ||
// Our rules that require type information | ||
'@typescript-eslint/consistent-type-exports': 'error', | ||
'@typescript-eslint/naming-convention': [ | ||
'error', | ||
{ | ||
selector: 'default', | ||
format: ['camelCase'], | ||
leadingUnderscore: 'allow', | ||
trailingUnderscore: 'forbid', | ||
}, | ||
{ | ||
selector: 'enumMember', | ||
format: ['PascalCase'], | ||
}, | ||
{ | ||
selector: 'interface', | ||
format: ['PascalCase'], | ||
custom: { | ||
regex: '^I[A-Z]', | ||
match: false, | ||
}, | ||
}, | ||
{ | ||
selector: 'objectLiteralMethod', | ||
format: ['camelCase', 'PascalCase', 'UPPER_CASE'], | ||
}, | ||
{ | ||
selector: 'objectLiteralProperty', | ||
format: ['camelCase', 'PascalCase', 'UPPER_CASE'], | ||
}, | ||
{ | ||
selector: 'typeLike', | ||
format: ['PascalCase'], | ||
}, | ||
{ | ||
selector: 'variable', | ||
format: ['camelCase', 'UPPER_CASE', 'PascalCase'], | ||
leadingUnderscore: 'allow', | ||
}, | ||
], | ||
'@typescript-eslint/no-meaningless-void-operator': 'error', | ||
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', | ||
'@typescript-eslint/no-unnecessary-qualifier': 'error', | ||
'@typescript-eslint/no-unnecessary-type-arguments': 'error', | ||
'@typescript-eslint/prefer-includes': 'error', | ||
'@typescript-eslint/prefer-nullish-coalescing': 'error', | ||
'@typescript-eslint/prefer-readonly': 'error', | ||
'@typescript-eslint/prefer-reduce-type-parameter': 'error', | ||
'@typescript-eslint/prefer-string-starts-ends-with': 'error', | ||
'@typescript-eslint/promise-function-async': 'error', | ||
'@typescript-eslint/restrict-template-expressions': [ | ||
'error', | ||
{ | ||
allowBoolean: true, | ||
allowNumber: true, | ||
}, | ||
], | ||
'@typescript-eslint/switch-exhaustiveness-check': 'error', | ||
'default-param-last': 'off', | ||
@@ -71,3 +144,3 @@ '@typescript-eslint/default-param-last': 'error', | ||
'no-throw-literal': 'off', | ||
// '@typescript-eslint/no-throw-literal' is left disabled because it requires type information | ||
'@typescript-eslint/no-throw-literal': 'error', | ||
@@ -102,3 +175,13 @@ 'no-unused-expressions': 'off', | ||
'jsdoc/valid-types': 'off', | ||
// Prefer hash names over TypeScript's `private` modifier. | ||
'no-restricted-syntax': [ | ||
'error', | ||
{ | ||
selector: | ||
"PropertyDefinition[accessibility='private'], MethodDefinition[accessibility='private'], TSParameterProperty[accessibility='private']", | ||
message: 'Use a hash name instead.', | ||
}, | ||
], | ||
}, | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17167
7
189
51
11