@metamask/eslint-config-typescript 11.1.0 → 12.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/README.md +5 -4
- package/package.json +7 -7
- package/src/index.js +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [12.1.0]
|
|
10
|
+
### Changed
|
|
11
|
+
- Add support for typescript 5.0.x, 5.1.x ([#288](https://github.com/MetaMask/eslint-config/pull/288))
|
|
12
|
+
|
|
13
|
+
## [12.0.0]
|
|
14
|
+
### Added
|
|
15
|
+
- **BREAKING:** Add rule to enforce generic parameters have a length of at least 3 characters ([#292](https://github.com/MetaMask/eslint-config/pull/292))
|
|
16
|
+
- **BREAKING:** Enable `@typescript-eslint/consistent-type-imports` rule ([#284](https://github.com/MetaMask/eslint-config/pull/284))
|
|
17
|
+
- **BREAKING:** Enable `@typescript-eslint/prefer-enum-initializers` rule ([#269](https://github.com/MetaMask/eslint-config/pull/269))
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
- **BREAKING:** Update peer dependency `@metamask/eslint-config` to v12
|
|
21
|
+
- Disable naming convention for properties that require quotes ([#293](https://github.com/MetaMask/eslint-config/pull/293))
|
|
22
|
+
|
|
9
23
|
## [11.1.0]
|
|
10
24
|
### Changed
|
|
11
25
|
- Exclude test files from package ([#266](https://github.com/MetaMask/eslint-config/pull/266))
|
|
@@ -93,7 +107,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
93
107
|
- To continue extending this config, install this package and update your `.eslintrc.js` `extends` array to include `@metamask/eslint-config-typescript` instead of `@metamask/eslint-config/typescript`.
|
|
94
108
|
- Update `eslint` and other ESLint peer dependencies ([#151](https://github.com/MetaMask/eslint-config/pull/151))
|
|
95
109
|
|
|
96
|
-
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/
|
|
110
|
+
[Unreleased]: https://github.com/MetaMask/eslint-config/compare/v12.1.0...HEAD
|
|
111
|
+
[12.1.0]: https://github.com/MetaMask/eslint-config/compare/v12.0.0...v12.1.0
|
|
112
|
+
[12.0.0]: https://github.com/MetaMask/eslint-config/compare/v11.1.0...v12.0.0
|
|
97
113
|
[11.1.0]: https://github.com/MetaMask/eslint-config/compare/v11.0.2...v11.1.0
|
|
98
114
|
[11.0.2]: https://github.com/MetaMask/eslint-config/compare/v11.0.0...v11.0.2
|
|
99
115
|
[11.0.0]: https://github.com/MetaMask/eslint-config/compare/v10.0.0...v11.0.0
|
package/README.md
CHANGED
|
@@ -6,15 +6,16 @@ MetaMask's [TypeScript](https://www.typescriptlang.org) ESLint configuration.
|
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
yarn add --dev \
|
|
9
|
-
@metamask/eslint-config@^
|
|
10
|
-
@metamask/eslint-config-typescript@^
|
|
9
|
+
@metamask/eslint-config@^12.0.0 \
|
|
10
|
+
@metamask/eslint-config-typescript@^12.0.0 \
|
|
11
11
|
@typescript-eslint/eslint-plugin@^5.42.1 \
|
|
12
12
|
@typescript-eslint/parser@^5.42.1 \
|
|
13
13
|
eslint@^8.27.0 \
|
|
14
14
|
eslint-config-prettier@^8.5.0 \
|
|
15
|
-
eslint-plugin-import@^2.
|
|
16
|
-
eslint-plugin-jsdoc@^
|
|
15
|
+
eslint-plugin-import@^2.27.5 \
|
|
16
|
+
eslint-plugin-jsdoc@^41.1.2 \
|
|
17
17
|
eslint-plugin-prettier@^4.2.1 \
|
|
18
|
+
eslint-plugin-promise@^6.1.1 \
|
|
18
19
|
prettier@^2.7.1
|
|
19
20
|
```
|
|
20
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask/eslint-config-typescript",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "Shareable MetaMask ESLint config for TypeScript.",
|
|
5
5
|
"homepage": "https://github.com/MetaMask/eslint-config#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -24,23 +24,23 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@metamask/auto-changelog": "^3.0.0",
|
|
27
|
-
"@metamask/eslint-config": "^
|
|
27
|
+
"@metamask/eslint-config": "^12.0.0",
|
|
28
28
|
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
|
29
29
|
"@typescript-eslint/parser": "^5.42.1",
|
|
30
30
|
"eslint": "^8.27.0",
|
|
31
31
|
"eslint-config-prettier": "^8.5.0",
|
|
32
|
-
"eslint-plugin-import": "^2.
|
|
33
|
-
"eslint-plugin-jsdoc": "^
|
|
32
|
+
"eslint-plugin-import": "^2.27.5",
|
|
33
|
+
"eslint-plugin-jsdoc": "^41.1.2",
|
|
34
34
|
"eslint-plugin-prettier": "^4.2.1",
|
|
35
35
|
"prettier": "^2.7.1",
|
|
36
|
-
"typescript": "
|
|
36
|
+
"typescript": "^5.1.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@metamask/eslint-config": "^
|
|
39
|
+
"@metamask/eslint-config": "^12.0.0",
|
|
40
40
|
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
|
41
41
|
"@typescript-eslint/parser": "^5.42.1",
|
|
42
42
|
"eslint": "^8.27.0",
|
|
43
|
-
"typescript": "~4.8.4"
|
|
43
|
+
"typescript": "~4.8.4 || ~5.0 || ~5.1"
|
|
44
44
|
},
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=14.0.0"
|
package/src/index.js
CHANGED
|
@@ -42,6 +42,7 @@ module.exports = {
|
|
|
42
42
|
'@typescript-eslint/array-type': 'error',
|
|
43
43
|
'@typescript-eslint/consistent-type-assertions': 'error',
|
|
44
44
|
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
45
|
+
'@typescript-eslint/consistent-type-imports': 'error',
|
|
45
46
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
46
47
|
'@typescript-eslint/no-namespace': [
|
|
47
48
|
'error',
|
|
@@ -109,6 +110,14 @@ module.exports = {
|
|
|
109
110
|
selector: 'typeLike',
|
|
110
111
|
format: ['PascalCase'],
|
|
111
112
|
},
|
|
113
|
+
{
|
|
114
|
+
selector: 'typeParameter',
|
|
115
|
+
format: ['PascalCase'],
|
|
116
|
+
custom: {
|
|
117
|
+
regex: '^.{3,}',
|
|
118
|
+
match: true,
|
|
119
|
+
},
|
|
120
|
+
},
|
|
112
121
|
{
|
|
113
122
|
selector: 'variable',
|
|
114
123
|
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
|
|
@@ -119,11 +128,26 @@ module.exports = {
|
|
|
119
128
|
format: ['camelCase', 'PascalCase'],
|
|
120
129
|
leadingUnderscore: 'allow',
|
|
121
130
|
},
|
|
131
|
+
{
|
|
132
|
+
selector: [
|
|
133
|
+
'classProperty',
|
|
134
|
+
'objectLiteralProperty',
|
|
135
|
+
'typeProperty',
|
|
136
|
+
'classMethod',
|
|
137
|
+
'objectLiteralMethod',
|
|
138
|
+
'typeMethod',
|
|
139
|
+
'accessor',
|
|
140
|
+
'enumMember',
|
|
141
|
+
],
|
|
142
|
+
format: null,
|
|
143
|
+
modifiers: ['requiresQuotes'],
|
|
144
|
+
},
|
|
122
145
|
],
|
|
123
146
|
'@typescript-eslint/no-meaningless-void-operator': 'error',
|
|
124
147
|
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
|
|
125
148
|
'@typescript-eslint/no-unnecessary-qualifier': 'error',
|
|
126
149
|
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
|
|
150
|
+
'@typescript-eslint/prefer-enum-initializers': 'error',
|
|
127
151
|
'@typescript-eslint/prefer-includes': 'error',
|
|
128
152
|
'@typescript-eslint/prefer-nullish-coalescing': 'error',
|
|
129
153
|
'@typescript-eslint/prefer-readonly': 'error',
|