eslint-config-beslogic 3.1.4 → 3.2.1

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.2.1
4
+
5
+ - Disabled `@typescript-eslint/no-misused-spread`:\
6
+ Still a handful of false-positives and I couldn't get the configuration working.\
7
+ Especially annoying with autogenerated API when spreading class instance
8
+ with readonly properties as its contructor object.\
9
+ ie: `new Myclass({...someInstance, overwritten_prop: "foo"})`\
10
+ NOTE: If fixed, we'd still only want this in extra-strict config.
11
+
12
+ ## 3.2.0
13
+
14
+ - Migrated from `eslint-plugin-import` to `eslint-plugin-import-x@^4.2.1` for simpler configs and performance improvement.
15
+ - This also forces `eslint` to version `8.57` or above
16
+
3
17
  ## 3.1.4
4
18
 
5
19
  - Pinned `eslint-plugin-unicorn` to `>=49.0 && <57`
package/javascript.js CHANGED
@@ -43,7 +43,7 @@ module.exports = {
43
43
  "plugin:sonarjs/recommended-legacy", // "legacy" is for ESLint v8 compatibility
44
44
  "plugin:unicorn/all",
45
45
  "plugin:regexp/all",
46
- "plugin:import/recommended",
46
+ "plugin:import-x/recommended",
47
47
  "plugin:@eslint-community/eslint-comments/recommended"
48
48
  ],
49
49
  "env": {
@@ -427,26 +427,26 @@ module.exports = {
427
427
  // - no-useless-react-setstate
428
428
 
429
429
  /*
430
- * import settings (https://github.com/import-js/eslint-plugin-import#rules)
430
+ * import settings (https://github.com/un-ts/eslint-plugin-import-x#rules)
431
431
  */
432
- "import/consistent-type-specifier-style": [
432
+ "import-x/consistent-type-specifier-style": [
433
433
  "error",
434
434
  "prefer-top-level"
435
435
  ],
436
- "import/no-duplicates": [
436
+ "import-x/no-duplicates": [
437
437
  "error",
438
438
  { "considerQueryString": true }
439
439
  ],
440
- "import/no-empty-named-blocks": "error",
441
- "import/newline-after-import": [
440
+ "import-x/no-empty-named-blocks": "error",
441
+ "import-x/newline-after-import": [
442
442
  "error",
443
443
  {
444
444
  "exactCount": true,
445
445
  "considerComments": true
446
446
  }
447
447
  ],
448
- "import/no-named-as-default": "error",
449
- "import/no-named-as-default-member": "error",
448
+ "import-x/no-named-as-default": "error",
449
+ "import-x/no-named-as-default-member": "error",
450
450
 
451
451
  // Extracted restricted import into its own rule so it's easier for projects to override/ignore
452
452
  "no-autofix/no-relative-import-paths/no-relative-import-paths": [
@@ -878,7 +878,7 @@ module.exports = {
878
878
  "no-constant-binary-expression": "error",
879
879
  "no-constructor-return": "error",
880
880
  "no-dupe-else-if": "error",
881
- // Obsoleted by import/no-duplicates
881
+ // Obsoleted by import-x/no-duplicates
882
882
  "no-duplicate-imports": "off",
883
883
  "no-extend-native": "error",
884
884
  "no-implied-eval": "error",
package/node-js.js CHANGED
@@ -25,6 +25,11 @@ module.exports = {
25
25
  "env": {
26
26
  "node": true
27
27
  },
28
+ "settings": {
29
+ "import-x/resolver": {
30
+ "node": true
31
+ }
32
+ },
28
33
  "globals": {
29
34
  "__dirname": true,
30
35
  "require": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-beslogic",
3
- "version": "3.1.4",
3
+ "version": "3.2.1",
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",
@@ -49,12 +49,12 @@
49
49
  "@types/eslint": "^8.56",
50
50
  "confusing-browser-globals": "^1.0",
51
51
  "dprint": "^0.40.2",
52
- "eslint": "^8.56",
52
+ "eslint": "^8.57",
53
53
  "eslint-import-resolver-typescript": "^3.2.6",
54
54
  "eslint-plugin-autofix": "^1.1 || ^2.0",
55
55
  "eslint-plugin-etc": "^2.0",
56
56
  "eslint-plugin-extra-rules": "^0.0.0-development",
57
- "eslint-plugin-import": "^2.30",
57
+ "eslint-plugin-import-x": "^4.2.1",
58
58
  "eslint-plugin-jest": "^28.7",
59
59
  "eslint-plugin-jest-formatting": "^3.1",
60
60
  "eslint-plugin-no-autofix": "^2.0",
package/tsconfig.json CHANGED
@@ -9,6 +9,6 @@
9
9
  "jsx": "react",
10
10
  "allowJs": true,
11
11
  "checkJs": true,
12
- "noImplicitAny": false
13
- }
12
+ "noImplicitAny": false,
13
+ },
14
14
  }
package/typescript.js CHANGED
@@ -40,14 +40,14 @@ module.exports = {
40
40
  "extends": [
41
41
  "plugin:@typescript-eslint/all",
42
42
  "plugin:etc/recommended",
43
- "plugin:import/typescript"
43
+ "plugin:import-x/typescript"
44
44
  ],
45
45
  "env": {
46
46
  // https://eslint.org/docs/v8.x/use/configure/language-options#specifying-environments
47
47
  "es2022": true // Same as tsconfig.json > compilerOptions.lib
48
48
  },
49
49
  "settings": {
50
- "import/resolver": {
50
+ "import-x/resolver": {
51
51
  "typescript": {
52
52
  // Recommended by eslint-import-resolver-typescript
53
53
  // Always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
@@ -92,11 +92,11 @@ module.exports = {
92
92
  },
93
93
  "rules": {
94
94
  // Slow and not as useful with TypeScript: https://github.com/import-js/eslint-plugin-import/issues/2340
95
- "import/namespace": "off",
95
+ "import-x/namespace": "off",
96
96
  // TypeScript already ensures imports resolve
97
- "import/no-unresolved": "off",
97
+ "import-x/no-unresolved": "off",
98
98
  // Already checked by @typescript-eslint/no-import-type-side-effects
99
- "import/consistent-type-specifier-style": "off",
99
+ "import-x/consistent-type-specifier-style": "off",
100
100
 
101
101
  /*
102
102
  * Cartant's etc rules
@@ -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
  {