eslint-config-conventions 5.0.0 → 7.0.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/.eslintrc.json +11 -11
- package/README.md +7 -7
- package/package.json +26 -24
package/.eslintrc.json
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"no-duplicate-imports": "error",
|
|
35
35
|
"no-empty-character-class": "error",
|
|
36
36
|
"no-empty-pattern": "error",
|
|
37
|
+
"no-empty-static-block": "error",
|
|
37
38
|
"no-ex-assign": "error",
|
|
38
39
|
"no-fallthrough": "error",
|
|
39
40
|
"no-func-assign": "error",
|
|
@@ -42,6 +43,7 @@
|
|
|
42
43
|
"no-irregular-whitespace": "error",
|
|
43
44
|
"no-loss-of-precision": "error",
|
|
44
45
|
"no-misleading-character-class": "error",
|
|
46
|
+
"no-new-native-nonconstructor": "error",
|
|
45
47
|
"no-new-symbol": "error",
|
|
46
48
|
"no-obj-calls": "error",
|
|
47
49
|
"no-promise-executor-return": "error",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"no-unsafe-negation": "error",
|
|
60
62
|
"no-unsafe-optional-chaining": "error",
|
|
61
63
|
"no-unused-private-class-members": "error",
|
|
62
|
-
"no-unused-vars": "error",
|
|
64
|
+
"no-unused-vars": ["error", { "varsIgnorePattern": "^_" }],
|
|
63
65
|
"no-use-before-define": [
|
|
64
66
|
"error",
|
|
65
67
|
{
|
|
@@ -166,6 +168,7 @@
|
|
|
166
168
|
}
|
|
167
169
|
],
|
|
168
170
|
"import/no-named-default": "error",
|
|
171
|
+
"import/no-empty-named-blocks": "error",
|
|
169
172
|
|
|
170
173
|
"promise/param-names": "error",
|
|
171
174
|
"promise/no-new-statics": "error",
|
|
@@ -181,7 +184,8 @@
|
|
|
181
184
|
"unicorn/no-this-assignment": "error",
|
|
182
185
|
"unicorn/no-zero-fractions": "error",
|
|
183
186
|
"unicorn/prefer-node-protocol": "error",
|
|
184
|
-
"unicorn/throw-new-error": "error"
|
|
187
|
+
"unicorn/throw-new-error": "error",
|
|
188
|
+
"unicorn/no-typeof-undefined": "error"
|
|
185
189
|
},
|
|
186
190
|
"overrides": [
|
|
187
191
|
{
|
|
@@ -197,7 +201,10 @@
|
|
|
197
201
|
"no-loss-of-precision": "off",
|
|
198
202
|
"@typescript-eslint/no-loss-of-precision": "error",
|
|
199
203
|
"no-unused-vars": "off",
|
|
200
|
-
"@typescript-eslint/no-unused-vars":
|
|
204
|
+
"@typescript-eslint/no-unused-vars": [
|
|
205
|
+
"error",
|
|
206
|
+
{ "varsIgnorePattern": "^_" }
|
|
207
|
+
],
|
|
201
208
|
"no-use-before-define": "off",
|
|
202
209
|
"@typescript-eslint/no-use-before-define": [
|
|
203
210
|
"error",
|
|
@@ -241,13 +248,7 @@
|
|
|
241
248
|
"error",
|
|
242
249
|
{ "default": "array-simple" }
|
|
243
250
|
],
|
|
244
|
-
"@typescript-eslint/
|
|
245
|
-
"error",
|
|
246
|
-
{
|
|
247
|
-
"assertionStyle": "as",
|
|
248
|
-
"objectLiteralTypeAssertions": "never"
|
|
249
|
-
}
|
|
250
|
-
],
|
|
251
|
+
"@typescript-eslint/ban-types": "error",
|
|
251
252
|
"@typescript-eslint/consistent-type-definitions": [
|
|
252
253
|
"error",
|
|
253
254
|
"interface"
|
|
@@ -308,7 +309,6 @@
|
|
|
308
309
|
"ignoreMixedLogicalExpressions": false
|
|
309
310
|
}
|
|
310
311
|
],
|
|
311
|
-
"@typescript-eslint/prefer-optional-chain": "error",
|
|
312
312
|
"@typescript-eslint/prefer-readonly": "error",
|
|
313
313
|
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
314
314
|
"@typescript-eslint/prefer-ts-expect-error": "error",
|
package/README.md
CHANGED
|
@@ -40,10 +40,10 @@ Here is an example, but use it only for reference, because your decisions regard
|
|
|
40
40
|
|
|
41
41
|
```sh
|
|
42
42
|
npm install --save-dev \
|
|
43
|
-
eslint@^8.
|
|
44
|
-
eslint-plugin-import@^2.
|
|
45
|
-
eslint-plugin-promise@^6.
|
|
46
|
-
eslint-plugin-unicorn@^
|
|
43
|
+
eslint@^8.33.0 \
|
|
44
|
+
eslint-plugin-import@^2.27.5 \
|
|
45
|
+
eslint-plugin-promise@^6.1.1 \
|
|
46
|
+
eslint-plugin-unicorn@^45.0.2 \
|
|
47
47
|
eslint-config-conventions@latest
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -109,7 +109,7 @@ echo {}> .prettierrc.json
|
|
|
109
109
|
```jsonc
|
|
110
110
|
{
|
|
111
111
|
"scripts": {
|
|
112
|
-
"lint:
|
|
112
|
+
"lint:eslint": "eslint \"**/*.{js,jsx,ts,tsx}\" --ignore-path \".gitignore\"",
|
|
113
113
|
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\""
|
|
114
114
|
}
|
|
115
115
|
}
|
|
@@ -118,9 +118,9 @@ echo {}> .prettierrc.json
|
|
|
118
118
|
### Usage
|
|
119
119
|
|
|
120
120
|
```sh
|
|
121
|
-
npm run lint:
|
|
121
|
+
npm run lint:eslint
|
|
122
122
|
# or to apply automatic fixes to code
|
|
123
|
-
npm run lint:
|
|
123
|
+
npm run lint:eslint -- --fix
|
|
124
124
|
|
|
125
125
|
# Validate code formatting in all supported languages by Prettier
|
|
126
126
|
npm run lint:prettier
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-conventions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"public": true,
|
|
5
5
|
"description": "ESLint shareable config to enforce strict conventions and good code quality.",
|
|
6
6
|
"author": "Divlo <contact@divlo.fr>",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"lint:commit": "commitlint",
|
|
36
36
|
"lint:editorconfig": "editorconfig-checker",
|
|
37
37
|
"lint:markdown": "markdownlint-cli2",
|
|
38
|
-
"lint:
|
|
38
|
+
"lint:eslint": "eslint \"**/*.{js,jsx,ts,tsx}\" -c \"eslintrc.json\"",
|
|
39
39
|
"lint:prettier": "prettier \".\" --check --ignore-path \".gitignore\"",
|
|
40
40
|
"lint:staged": "lint-staged",
|
|
41
41
|
"test": "tap",
|
|
@@ -45,30 +45,32 @@
|
|
|
45
45
|
"postpublish": "pinst --enable"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"eslint": "^8.
|
|
49
|
-
"eslint-plugin-import": "^2.
|
|
50
|
-
"eslint-plugin-promise": "^6.
|
|
51
|
-
"eslint-plugin-unicorn": "^
|
|
48
|
+
"eslint": "^8.33.0",
|
|
49
|
+
"eslint-plugin-import": "^2.27.5",
|
|
50
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
51
|
+
"eslint-plugin-unicorn": "^45.0.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@commitlint/cli": "17.
|
|
55
|
-
"@commitlint/config-conventional": "17.
|
|
56
|
-
"@
|
|
57
|
-
"@types/
|
|
58
|
-
"@
|
|
59
|
-
"@typescript-eslint/
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"eslint
|
|
63
|
-
"eslint-plugin-
|
|
64
|
-
"eslint-plugin-
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
54
|
+
"@commitlint/cli": "17.4.2",
|
|
55
|
+
"@commitlint/config-conventional": "17.4.2",
|
|
56
|
+
"@tsconfig/strictest": "1.0.2",
|
|
57
|
+
"@types/eslint": "8.21.0",
|
|
58
|
+
"@types/tap": "15.0.8",
|
|
59
|
+
"@typescript-eslint/eslint-plugin": "5.51.0",
|
|
60
|
+
"@typescript-eslint/parser": "5.51.0",
|
|
61
|
+
"editorconfig-checker": "5.0.1",
|
|
62
|
+
"eslint": "8.33.0",
|
|
63
|
+
"eslint-plugin-import": "2.27.5",
|
|
64
|
+
"eslint-plugin-promise": "6.1.1",
|
|
65
|
+
"eslint-plugin-unicorn": "45.0.2",
|
|
66
|
+
"husky": "8.0.3",
|
|
67
|
+
"lint-staged": "13.1.0",
|
|
68
|
+
"markdownlint-cli2": "0.6.0",
|
|
69
|
+
"markdownlint-rule-relative-links": "1.1.1",
|
|
68
70
|
"pinst": "3.0.0",
|
|
69
|
-
"prettier": "2.
|
|
70
|
-
"semantic-release": "
|
|
71
|
-
"tap": "16.3.
|
|
72
|
-
"typescript": "4.
|
|
71
|
+
"prettier": "2.8.3",
|
|
72
|
+
"semantic-release": "20.1.0",
|
|
73
|
+
"tap": "16.3.4",
|
|
74
|
+
"typescript": "4.9.5"
|
|
73
75
|
}
|
|
74
76
|
}
|