eslint-config-beslogic 4.1.0 → 4.2.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 +11 -0
- package/extra-strict.mjs +8 -1
- package/javascript.mjs +2 -4
- package/package.json +1 -1
- package/typescript.mjs +17 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
- `@typescript-eslint/no-floating-promises` is now ignored on `i18next.changeLanguage` as it is known to not throw and already `console.warn` itself
|
|
6
|
+
- In `extra-strict` preset, `@typescript-eslint/no-floating-promises`doesn't ignore voided promises, forcing a comment to explain
|
|
7
|
+
- Disabled `@typescript-eslint/no-misused-spread`:\
|
|
8
|
+
Still a handful of false-positives and I couldn't get the configuration working.\
|
|
9
|
+
Especially annoying with autogenerated API when spreading class instance
|
|
10
|
+
with readonly properties as its contructor object.\
|
|
11
|
+
ie: `new Myclass({...someInstance, overwritten_prop: "foo"})`\
|
|
12
|
+
NOTE: If fixed, we'd still only want this in extra-strict config.
|
|
13
|
+
|
|
3
14
|
## 4.1.0
|
|
4
15
|
|
|
5
16
|
- Migrated from `eslint-plugin-import` to `eslint-plugin-import-x@^4.2.1` for performance and better support.
|
package/extra-strict.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import tseslint from "typescript-eslint"
|
|
5
5
|
|
|
6
6
|
import { jestFilePatterns, resolveModuleLocation } from "./lib/utils.mjs"
|
|
7
|
-
import { restrictTemplateExpressionsConfig } from "./typescript.mjs"
|
|
7
|
+
import { noFloatingPromisesKnownSafeCalls, restrictTemplateExpressionsConfig } from "./typescript.mjs"
|
|
8
8
|
|
|
9
9
|
// These extra strict configs are not only for Angular. User may be using a different framework
|
|
10
10
|
const hasAngularEslintTemplate = !!resolveModuleLocation("@angular-eslint/eslint-plugin-template")
|
|
@@ -56,6 +56,13 @@ export default tseslint.config(
|
|
|
56
56
|
],
|
|
57
57
|
"@typescript-eslint/no-unsafe-type-assertion": "error",
|
|
58
58
|
|
|
59
|
+
"@typescript-eslint/no-floating-promises": [
|
|
60
|
+
"error",
|
|
61
|
+
{
|
|
62
|
+
"ignoreVoid": false, // Don't even ignore voided promises. Force a comment explaining.
|
|
63
|
+
"allowForKnownSafeCalls": noFloatingPromisesKnownSafeCalls
|
|
64
|
+
}
|
|
65
|
+
],
|
|
59
66
|
"@typescript-eslint/related-getter-setter-pairs": "error",
|
|
60
67
|
"@typescript-eslint/restrict-template-expressions": [
|
|
61
68
|
"error",
|
package/javascript.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import restrictedGlobals from "confusing-browser-globals"
|
|
|
8
8
|
import gitignore from "eslint-config-flat-gitignore"
|
|
9
9
|
import autofix from "eslint-plugin-autofix"
|
|
10
10
|
import extraRules from "eslint-plugin-extra-rules"
|
|
11
|
-
import
|
|
11
|
+
import * as pluginImportX from "eslint-plugin-import-x"
|
|
12
12
|
import noAutofix from "eslint-plugin-no-autofix"
|
|
13
13
|
import noRelativeImportPaths from "eslint-plugin-no-relative-import-paths"
|
|
14
14
|
import preferArrow from "eslint-plugin-prefer-arrow"
|
|
@@ -179,9 +179,7 @@ export default tseslint.config(
|
|
|
179
179
|
sonarjs.configs.recommended,
|
|
180
180
|
unicorn.configs["flat/all"],
|
|
181
181
|
regexp.configs["flat/recommended"],
|
|
182
|
-
|
|
183
|
-
-- https://github.com/un-ts/eslint-plugin-import-x/issues/285 */
|
|
184
|
-
eslintPluginImportX.flatConfigs.recommended,
|
|
182
|
+
pluginImportX.flatConfigs.recommended,
|
|
185
183
|
comments.recommended,
|
|
186
184
|
{
|
|
187
185
|
"plugins": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-beslogic",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
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/typescript.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { fixupConfigRules } from "@eslint/compat"
|
|
|
8
8
|
import { FlatCompat } from "@eslint/eslintrc"
|
|
9
9
|
import js from "@eslint/js"
|
|
10
10
|
import tsParser from "@typescript-eslint/parser"
|
|
11
|
-
import
|
|
11
|
+
import * as pluginImportX from "eslint-plugin-import-x"
|
|
12
12
|
import globals from "globals"
|
|
13
13
|
import tseslint from "typescript-eslint"
|
|
14
14
|
|
|
@@ -64,6 +64,11 @@ export const restrictTemplateExpressionsConfig = {
|
|
|
64
64
|
// ]
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
export const noFloatingPromisesKnownSafeCalls = [
|
|
68
|
+
// Doesn't throw and already console.warn itself
|
|
69
|
+
{ "from": "package", "package": "i18next", "name": "changeLanguage" }
|
|
70
|
+
]
|
|
71
|
+
|
|
67
72
|
export default tseslint.config(
|
|
68
73
|
{
|
|
69
74
|
"files": [
|
|
@@ -74,9 +79,7 @@ export default tseslint.config(
|
|
|
74
79
|
...tseslint.configs.all,
|
|
75
80
|
// https://github.com/cartant/eslint-plugin-etc/issues/74
|
|
76
81
|
fixupConfigRules(compat.extends("plugin:etc/recommended")),
|
|
77
|
-
|
|
78
|
-
-- https://github.com/un-ts/eslint-plugin-import-x/issues/285 */
|
|
79
|
-
eslintPluginImportX.flatConfigs.typescript
|
|
82
|
+
pluginImportX.flatConfigs.typescript
|
|
80
83
|
],
|
|
81
84
|
"languageOptions": {
|
|
82
85
|
"parser": tsParser,
|
|
@@ -198,6 +201,10 @@ export default tseslint.config(
|
|
|
198
201
|
"import-x/no-deprecated": "off",
|
|
199
202
|
"import/no-deprecated": "off",
|
|
200
203
|
"sonarjs/deprecation": "off",
|
|
204
|
+
"@typescript-eslint/no-floating-promises": [
|
|
205
|
+
"error",
|
|
206
|
+
{ "allowForKnownSafeCalls": noFloatingPromisesKnownSafeCalls }
|
|
207
|
+
],
|
|
201
208
|
// Explicit types rules complicates things uselessly and are redundant
|
|
202
209
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
203
210
|
"@typescript-eslint/explicit-member-accessibility": [
|
|
@@ -235,6 +242,12 @@ export default tseslint.config(
|
|
|
235
242
|
"error",
|
|
236
243
|
{ "checksVoidReturn": false }
|
|
237
244
|
],
|
|
245
|
+
// Still a handful of false-positives and I couldn't get the configuration working.
|
|
246
|
+
// Especially annoying with autogenerated API when spreading class instance
|
|
247
|
+
// with readonly properties as its contructor object.
|
|
248
|
+
// ie: `new Myclass({...someInstance, overwritten_prop: "foo"})`
|
|
249
|
+
// NOTE: If fixed, we'd still only want this in extra-strict config.
|
|
250
|
+
"@typescript-eslint/no-misused-spread": "off",
|
|
238
251
|
"@typescript-eslint/no-restricted-imports": [
|
|
239
252
|
"error",
|
|
240
253
|
{
|