eslint-config-beslogic 3.2.0 → 3.2.2
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/.dprint.jsonc +1 -1
- package/CHANGELOG.md +14 -2
- package/angular.js +3 -2
- package/extra-strict.js +2 -0
- package/package.json +1 -1
- package/tsconfig.json +2 -2
- package/typescript.js +6 -0
package/.dprint.jsonc
CHANGED
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
|
|
4
4
|
{
|
|
5
5
|
// https://dprint.dev/config/#extending-a-different-configuration-file
|
|
6
|
-
"extends": "https://raw.githubusercontent.com/BesLogic/shared-configs/main
|
|
6
|
+
"extends": "https://raw.githubusercontent.com/BesLogic/shared-configs/main/.dprint-json-like.jsonc",
|
|
7
7
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.2.2
|
|
4
|
+
|
|
5
|
+
- Disabled `unicorn/no-useless-switch-case` in extra-strict preset as it conflicts with `considerDefaultExhaustiveForUnions`
|
|
6
|
+
- Relaxed `prefer-arrow/prefer-arrow-functions` for `**/*[.-]service.ts` files as we expected `@Injectable` to have lifecycle methods
|
|
7
|
+
|
|
8
|
+
## 3.2.1
|
|
9
|
+
|
|
10
|
+
- Disabled `@typescript-eslint/no-misused-spread`:\
|
|
11
|
+
Still a handful of false-positives and I couldn't get the configuration working.\
|
|
12
|
+
Especially annoying with autogenerated API when spreading class instance
|
|
13
|
+
with readonly properties as its contructor object.\
|
|
14
|
+
ie: `new Myclass({...someInstance, overwritten_prop: "foo"})`\
|
|
15
|
+
NOTE: If fixed, we'd still only want this in extra-strict config.
|
|
16
|
+
|
|
3
17
|
## 3.2.0
|
|
4
18
|
|
|
5
19
|
- Migrated from `eslint-plugin-import` to `eslint-plugin-import-x@^4.2.1` for simpler configs and performance improvement.
|
|
@@ -73,7 +87,6 @@
|
|
|
73
87
|
}
|
|
74
88
|
```
|
|
75
89
|
|
|
76
|
-
```
|
|
77
90
|
`eslint-plugin-sonarjs@2` added a ton of rules, a lot of which duplicates base ESLint rules and other plugins we have. _**Please report those you find**_
|
|
78
91
|
|
|
79
92
|
### Changes
|
|
@@ -284,4 +297,3 @@
|
|
|
284
297
|
- Changed the maximum line length from `120` to `100`
|
|
285
298
|
- Split language-specific `editor.defaultFormatter` to work around
|
|
286
299
|
<https://github.com/microsoft/vscode/issues/168411>
|
|
287
|
-
```
|
package/angular.js
CHANGED
|
@@ -49,7 +49,7 @@ const typeDefinitionOverride = typescriptConfig
|
|
|
49
49
|
.overrides
|
|
50
50
|
?.find(override => override.files === "*.d.ts")
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const noAutofixPreferArrowFunctionsConfig = javascriptConfig
|
|
53
53
|
.rules
|
|
54
54
|
?.["no-autofix/prefer-arrow/prefer-arrow-functions"]
|
|
55
55
|
?.[1]
|
|
@@ -296,6 +296,7 @@ module.exports = {
|
|
|
296
296
|
"*[.-]component.ts",
|
|
297
297
|
"*[.-]directive.ts",
|
|
298
298
|
"*[.-]interceptor.ts",
|
|
299
|
+
"**/*[.-]service.ts", // @Injectable
|
|
299
300
|
"*[.-]pipes.ts"
|
|
300
301
|
],
|
|
301
302
|
"rules": {
|
|
@@ -306,7 +307,7 @@ module.exports = {
|
|
|
306
307
|
"no-autofix/prefer-arrow/prefer-arrow-functions": [
|
|
307
308
|
"error",
|
|
308
309
|
{
|
|
309
|
-
...
|
|
310
|
+
...noAutofixPreferArrowFunctionsConfig,
|
|
310
311
|
// https://github.com/TristonJ/eslint-plugin-prefer-arrow/issues/17
|
|
311
312
|
"classPropertiesAllowed": false
|
|
312
313
|
}
|
package/extra-strict.js
CHANGED
|
@@ -70,6 +70,8 @@ module.exports = {
|
|
|
70
70
|
"allowNullish": false
|
|
71
71
|
}
|
|
72
72
|
],
|
|
73
|
+
// Unconfigurable and conflicts with `considerDefaultExhaustiveForUnions: true` (set in v4)
|
|
74
|
+
"unicorn/no-useless-switch-case": "off",
|
|
73
75
|
|
|
74
76
|
/*
|
|
75
77
|
* @typescript-eslint rules that require strictNullChecks
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-beslogic",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "ESLint rules, plugins and configs used at Beslogic",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"// dependencies": "Run for ourselves when we install dependencies w/o running npm i afterward",
|
package/tsconfig.json
CHANGED
package/typescript.js
CHANGED
|
@@ -208,6 +208,12 @@ module.exports = {
|
|
|
208
208
|
"ignoreTypeIndexes": true
|
|
209
209
|
}
|
|
210
210
|
],
|
|
211
|
+
// Still a handful of false-positives and I couldn't get the configuration working.
|
|
212
|
+
// Especially annoying with autogenerated API when spreading class instance
|
|
213
|
+
// with readonly properties as its contructor object.
|
|
214
|
+
// ie: `new Myclass({...someInstance, overwritten_prop: "foo"})`
|
|
215
|
+
// NOTE: If fixed, we'd still only want this in extra-strict config.
|
|
216
|
+
"@typescript-eslint/no-misused-spread": "off",
|
|
211
217
|
"@typescript-eslint/no-misused-promises": [
|
|
212
218
|
"error",
|
|
213
219
|
{
|