@newsteam/eslint-config 1.2.2 → 1.2.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,yBAAyB,CAAC;AAsDjC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EA2H1B,CAAC;AAIF,eAAe,MAAM,CAAC;AAGtB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,OAAO,yBAAyB,CAAC;AAsDjC,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAAM,EA6H1B,CAAC;AAIF,eAAe,MAAM,CAAC;AAGtB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -12,6 +12,8 @@
12
12
  */
13
13
  import babelParser from "@babel/eslint-parser";
14
14
  import eslintParser from "@typescript-eslint/parser";
15
+ import eslintImportResolverNode from "eslint-import-resolver-node";
16
+ import { resolve as eslintImportResolverTypescript } from "eslint-import-resolver-typescript";
15
17
  import global from "globals";
16
18
  import { arrayFuncPlugin } from "./plugins/array-function.js";
17
19
  import { constCasePlugin } from "./plugins/const-case.js";
@@ -27,12 +29,12 @@ import { noUselessAssignPlugin } from "./plugins/no-useless-assign.js";
27
29
  import { nodePlugin } from "./plugins/node.js";
28
30
  import { perfectionistPlugin } from "./plugins/perfectionist.js";
29
31
  import { promisePlugin } from "./plugins/promise.js";
30
- import { reactPlugin } from "./plugins/react.js";
31
32
  import { react19UpgradePlugin } from "./plugins/react-19-upgrade.js";
32
33
  import { reactCompilerPlugin } from "./plugins/react-compiler.js";
33
34
  import { reactHooksPlugin } from "./plugins/react-hooks.js";
34
35
  import { reactPerfPlugin } from "./plugins/react-perf.js";
35
36
  import { reactRefreshPlugin } from "./plugins/react-refresh.js";
37
+ import { reactPlugin } from "./plugins/react.js";
36
38
  import { securityPlugin } from "./plugins/security.js";
37
39
  import { stylisticPlugin } from "./plugins/stylistic.js";
38
40
  import { typescriptPlugin } from "./plugins/typescript.js";
@@ -47,10 +49,10 @@ const globals = {
47
49
  JSX: true,
48
50
  };
49
51
  const settings = {
50
- "import-x/resolver": {
51
- node: true,
52
- typescript: true,
53
- },
52
+ "import-x/resolver-next": [
53
+ eslintImportResolverNode,
54
+ eslintImportResolverTypescript,
55
+ ],
54
56
  react: {
55
57
  version: REACT_VERSION,
56
58
  },
@@ -195,6 +197,7 @@ const config = [
195
197
  rules: {
196
198
  "import-x/no-commonjs": "off",
197
199
  "import-x/unambiguous": "off",
200
+ "no-magic-numbers": "off",
198
201
  },
199
202
  },
200
203
  {
@@ -203,6 +206,7 @@ const config = [
203
206
  "**/dist/*",
204
207
  "**/dist_temp/*",
205
208
  "next-env.d.ts",
209
+ "*.gen.ts",
206
210
  ],
207
211
  },
208
212
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"import-x.d.ts","sourceRoot":"","sources":["../../src/plugins/import-x.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAGhB,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EA0exC,CAAC"}
1
+ {"version":3,"file":"import-x.d.ts","sourceRoot":"","sources":["../../src/plugins/import-x.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAGhB,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EA2exC,CAAC"}
@@ -2,6 +2,7 @@ import eslintImportX from "eslint-plugin-import-x";
2
2
  export const importXPlugin = [
3
3
  {
4
4
  plugins: {
5
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- don't have a choice
5
6
  "import-x": eslintImportX,
6
7
  },
7
8
  rules: {
@@ -1 +1 @@
1
- {"version":3,"file":"more.d.ts","sourceRoot":"","sources":["../../src/plugins/more.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EA0GrC,CAAC"}
1
+ {"version":3,"file":"more.d.ts","sourceRoot":"","sources":["../../src/plugins/more.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EA0GrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/plugins/next.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AASrC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EA2JrC,CAAC"}
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../src/plugins/next.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EA2JrC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/plugins/perfectionist.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAGhB,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EA0F9C,CAAC"}
1
+ {"version":3,"file":"perfectionist.d.ts","sourceRoot":"","sources":["../../src/plugins/perfectionist.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EA6F9C,CAAC"}
@@ -2,14 +2,16 @@ import perfectionist from "eslint-plugin-perfectionist";
2
2
  export const perfectionistPlugin = [
3
3
  {
4
4
  plugins: {
5
- perfectionist: perfectionist,
5
+ perfectionist,
6
6
  },
7
7
  rules: {
8
8
  "perfectionist/sort-array-includes": "error",
9
9
  "perfectionist/sort-astro-attributes": "off",
10
10
  "perfectionist/sort-classes": "off",
11
+ "perfectionist/sort-decorators": "error",
11
12
  "perfectionist/sort-enums": "error",
12
13
  "perfectionist/sort-exports": "error",
14
+ "perfectionist/sort-heritage-clauses": "error",
13
15
  "perfectionist/sort-imports": [
14
16
  "error",
15
17
  {
@@ -27,8 +29,8 @@ export const perfectionistPlugin = [
27
29
  "unknown",
28
30
  ],
29
31
  internalPattern: [
30
- "@common/**",
31
- "@src/**",
32
+ "@common/.*",
33
+ "@src/.*",
32
34
  ],
33
35
  order: "asc",
34
36
  sortSideEffects: true,
@@ -58,6 +60,7 @@ export const perfectionistPlugin = [
58
60
  ],
59
61
  "perfectionist/sort-jsx-props": "error",
60
62
  "perfectionist/sort-maps": "error",
63
+ "perfectionist/sort-modules": "off",
61
64
  "perfectionist/sort-named-exports": "error",
62
65
  "perfectionist/sort-named-imports": "error",
63
66
  "perfectionist/sort-object-types": "error",
@@ -1 +1 @@
1
- {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../src/plugins/promise.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAiIxC,CAAC"}
1
+ {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../src/plugins/promise.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAwIxC,CAAC"}
@@ -102,6 +102,12 @@ export const promisePlugin = [
102
102
  * https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/prefer-await-to-then.md
103
103
  */
104
104
  "promise/prefer-await-to-then": "error",
105
+ /*
106
+ * Prefer catch to then(a, b)/then(null, b) for handling errors (promise/prefer-catch)
107
+ *
108
+ * https://github.com/xjamundx/eslint-plugin-promise/blob/HEAD/docs/rules/prefer-catch.md
109
+ */
110
+ "promise/prefer-catch": "error",
105
111
  /*
106
112
  * Disallow use of non-standard Promise static methods.
107
113
  *
@@ -1 +1 @@
1
- {"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/plugins/stylistic.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAQhB,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EA67B1C,CAAC"}
1
+ {"version":3,"file":"stylistic.d.ts","sourceRoot":"","sources":["../../src/plugins/stylistic.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAQhB,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EA87B1C,CAAC"}
@@ -8,6 +8,7 @@ import { INDENT_SPACES, MAXIMUM_LINE_LENGTH, } from "../settings.js";
8
8
  export const stylisticPlugin = [
9
9
  {
10
10
  plugins: {
11
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- don't have a choice
11
12
  "@stylistic": stylistic,
12
13
  },
13
14
  rules: {
@@ -1 +1 @@
1
- {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/plugins/typescript.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAQhB,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAktC3C,CAAC"}
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/plugins/typescript.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAQhB,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAoxC3C,CAAC"}
@@ -35,6 +35,7 @@ export const typescriptPlugin = [
35
35
  "no-magic-numbers": "off",
36
36
  "no-redeclare": "off",
37
37
  "no-shadow": "off",
38
+ "no-throw-literal": "off",
38
39
  "no-undef": "off",
39
40
  "no-undef-init": "off",
40
41
  "no-undefined": "off",
@@ -47,6 +48,7 @@ export const typescriptPlugin = [
47
48
  {
48
49
  files: ["**/*.{ts,tsx}"],
49
50
  plugins: {
51
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- don't have a choice
50
52
  "@typescript-eslint": plugin,
51
53
  },
52
54
  rules: {
@@ -91,7 +93,10 @@ export const typescriptPlugin = [
91
93
  *
92
94
  * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/class-methods-use-this.mdx
93
95
  */
94
- "@typescript-eslint/class-methods-use-this": "error",
96
+ "@typescript-eslint/class-methods-use-this": [
97
+ "error",
98
+ { ignoreClassesThatImplementAnInterface: true },
99
+ ],
95
100
  /*
96
101
  * Enforces specifying generic type arguments on type annotation or constructor name of a constructor call.
97
102
  *
@@ -564,7 +569,37 @@ export const typescriptPlugin = [
564
569
  *
565
570
  * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-promises.mdx
566
571
  */
567
- "@typescript-eslint/no-misused-promises": "error",
572
+ "@typescript-eslint/no-misused-promises": [
573
+ "error",
574
+ {
575
+ checksConditionals: true,
576
+ checksSpreads: true,
577
+ checksVoidReturn: {
578
+ arguments: true,
579
+ attributes: false,
580
+ inheritedMethods: true,
581
+ properties: true,
582
+ returns: true,
583
+ variables: true,
584
+ },
585
+ },
586
+ ],
587
+ /*
588
+ *
589
+ *
590
+ * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-misused-spread.mdx
591
+ */
592
+ "@typescript-eslint/no-misused-spread": [
593
+ "error",
594
+ {
595
+ allow: [
596
+ {
597
+ from: "lib",
598
+ name: ["String", "string"],
599
+ },
600
+ ],
601
+ },
602
+ ],
568
603
  /*
569
604
  * Disallow enums from having both number and string members.
570
605
  *
@@ -770,6 +805,12 @@ export const typescriptPlugin = [
770
805
  * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-return.mdx
771
806
  */
772
807
  "@typescript-eslint/no-unsafe-return": "error",
808
+ /*
809
+ * Disallow type assertions that narrow a type.
810
+ *
811
+ * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-unsafe-type-assertion.mdx
812
+ */
813
+ "@typescript-eslint/no-unsafe-type-assertion": "error",
773
814
  /*
774
815
  * Require unary negation to take a number.
775
816
  *
@@ -830,7 +871,22 @@ export const typescriptPlugin = [
830
871
  *
831
872
  * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/only-throw-error.mdx
832
873
  */
833
- "@typescript-eslint/only-throw-error": "error",
874
+ "@typescript-eslint/only-throw-error": [
875
+ "error",
876
+ {
877
+ allow: [
878
+ {
879
+ from: "package",
880
+ name: [
881
+ "NotFoundError",
882
+ "Redirect",
883
+ "Redirect<TRouter, TFrom, TTo, TMaskFrom, TMaskTo>",
884
+ ],
885
+ package: "@tanstack/react-router",
886
+ },
887
+ ],
888
+ },
889
+ ],
834
890
  /*
835
891
  * Disallow the use of parameter properties in class constructors.
836
892
  *
@@ -961,6 +1017,12 @@ export const typescriptPlugin = [
961
1017
  * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/promise-function-async.mdx
962
1018
  */
963
1019
  "@typescript-eslint/promise-function-async": "off",
1020
+ /*
1021
+ * Enforce that `get()` types should be assignable to their equivalent `set()` type.
1022
+ *
1023
+ * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/related-getter-setter-pairs.mdx
1024
+ */
1025
+ "@typescript-eslint/related-getter-setter-pairs": "error",
964
1026
  /*
965
1027
  * Enforce giving compare argument to Array#sort
966
1028
  *
@@ -1 +1 @@
1
- {"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/plugins/unicorn.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQrC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EA69BxC,CAAC"}
1
+ {"version":3,"file":"unicorn.d.ts","sourceRoot":"","sources":["../../src/plugins/unicorn.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAER,MAAM,EACT,MAAM,QAAQ,CAAC;AAQhB,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EA69BxC,CAAC"}
@@ -9,7 +9,7 @@
9
9
  not really an issue in a file like this, it's just a big list
10
10
 
11
11
  */
12
- import unicorn from "eslint-plugin-unicorn";
12
+ import eslintPluginUnicorn from "eslint-plugin-unicorn";
13
13
  /*
14
14
  * Various awesome ESLint rules
15
15
  *
@@ -18,7 +18,7 @@ import unicorn from "eslint-plugin-unicorn";
18
18
  export const unicornPlugin = [
19
19
  {
20
20
  plugins: {
21
- unicorn,
21
+ unicorn: eslintPluginUnicorn,
22
22
  },
23
23
  rules: {
24
24
  /*
@@ -91,7 +91,7 @@ export const unicornPlugin = [
91
91
  *
92
92
  * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/expiring-todo-comments.md
93
93
  */
94
- "unicorn/expiring-todo-comments": "error",
94
+ "unicorn/expiring-todo-comments": "off",
95
95
  /*
96
96
  * Enforce explicitly comparing the length property of a value. (partly fixable)
97
97
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newsteam/eslint-config",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Shared config for eslint",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,6 +11,7 @@
11
11
  "depcheck": "depcheck || true",
12
12
  "lint": "npm run lint:eslint && npm run depcheck && npm run prune",
13
13
  "lint:eslint": "eslint --fix",
14
+ "lint:eslint:inspect": "eslint --inspect-config",
14
15
  "prepublishOnly": "npm run clean && npm run build && npm run lint && npm run test",
15
16
  "prune": "ts-prune",
16
17
  "reinstall": "rimraf node_modules package-lock.json pnpm-lock.yaml .turbo",
@@ -51,45 +52,47 @@
51
52
  "dist"
52
53
  ],
53
54
  "dependencies": {
54
- "@babel/eslint-parser": "^7.25.9",
55
- "@babel/preset-env": "^7.26.0",
56
- "@eslint/compat": "^1.2.2",
57
- "@next/eslint-plugin-next": "^15.0.2",
58
- "@stylistic/eslint-plugin": "^2.10.1",
59
- "@typescript-eslint/eslint-plugin": "^8.12.2",
60
- "@typescript-eslint/parser": "^8.12.2",
55
+ "@babel/eslint-parser": "^7.26.5",
56
+ "@babel/preset-env": "^7.26.7",
57
+ "@eslint/compat": "^1.2.6",
58
+ "@next/eslint-plugin-next": "^15.1.6",
59
+ "@stylistic/eslint-plugin": "^3.0.1",
60
+ "@typescript-eslint/eslint-plugin": "^8.23.0",
61
+ "@typescript-eslint/parser": "^8.23.0",
61
62
  "confusing-browser-globals": "^1.0.11",
63
+ "eslint-import-resolver-node": "^0.3.9",
64
+ "eslint-import-resolver-typescript": "^3.7.0",
62
65
  "eslint-plugin-array-func": "^5.0.2",
63
66
  "eslint-plugin-const-case": "^1.2.2",
64
67
  "eslint-plugin-css-modules": "^2.12.0",
65
68
  "eslint-plugin-destructuring": "^2.2.1",
66
69
  "eslint-plugin-eslint-comments": "^3.2.0",
67
70
  "eslint-plugin-import-newlines": "^1.4.0",
68
- "eslint-plugin-import-x": "^4.4.0",
71
+ "eslint-plugin-import-x": "^4.6.1",
69
72
  "eslint-plugin-more": "^1.0.5",
70
73
  "eslint-plugin-newline-destructuring": "^1.2.2",
71
74
  "eslint-plugin-no-unsanitized": "^4.1.2",
72
75
  "eslint-plugin-no-useless-assign": "^1.0.3",
73
76
  "eslint-plugin-node": "^11.1.0",
74
77
  "eslint-plugin-only-warn": "^1.1.0",
75
- "eslint-plugin-perfectionist": "^3.9.1",
76
- "eslint-plugin-promise": "^7.1.0",
77
- "eslint-plugin-react": "^7.37.2",
78
+ "eslint-plugin-perfectionist": "^4.8.0",
79
+ "eslint-plugin-promise": "^7.2.1",
80
+ "eslint-plugin-react": "^7.37.4",
78
81
  "eslint-plugin-react-19-upgrade": "^1.6.0",
79
- "eslint-plugin-react-compiler": "19.0.0-beta-9ee70a1-20241017",
80
- "eslint-plugin-react-hooks": "^5.0.0",
82
+ "eslint-plugin-react-compiler": "19.0.0-beta-e552027-20250112",
83
+ "eslint-plugin-react-hooks": "^5.1.0",
81
84
  "eslint-plugin-react-perf": "^3.3.3",
82
- "eslint-plugin-react-refresh": "^0.4.14",
85
+ "eslint-plugin-react-refresh": "^0.4.18",
83
86
  "eslint-plugin-security": "^3.0.1",
84
- "eslint-plugin-unicorn": "^56.0.0",
85
- "globals": "^15.11.0",
86
- "typescript-eslint": "^8.12.2"
87
+ "eslint-plugin-unicorn": "^56.0.1",
88
+ "globals": "^15.14.0",
89
+ "typescript-eslint": "^8.23.0"
87
90
  },
88
91
  "peerDependencies": {
89
92
  "eslint": ">= 9"
90
93
  },
91
94
  "devDependencies": {
92
95
  "@types/eslint-plugin-security": "^3.0.0",
93
- "@types/node": "^22.8.7"
96
+ "@types/node": "^22.13.1"
94
97
  }
95
98
  }