@tractorbeam/eslint-config 0.1.2 → 0.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/README.md +4 -69
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +2 -0
- package/dist/base.js.map +1 -1
- package/dist/tanstack-router.d.ts.map +1 -1
- package/dist/tanstack-router.js +1 -12
- package/dist/tanstack-router.js.map +1 -1
- package/dist/typescript.d.ts.map +1 -1
- package/dist/typescript.js +19 -1
- package/dist/typescript.js.map +1 -1
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -51,28 +51,6 @@ export default defineConfig([
|
|
|
51
51
|
|
|
52
52
|
## Customization
|
|
53
53
|
|
|
54
|
-
### Setting `tsconfigRootDir` (Required)
|
|
55
|
-
|
|
56
|
-
The `typescript` config uses type-checked linting, which requires `tsconfigRootDir` to be set in your config:
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
import { defineConfig } from "eslint/config";
|
|
60
|
-
|
|
61
|
-
import { base, typescript } from "@tractorbeam/eslint-config";
|
|
62
|
-
|
|
63
|
-
export default defineConfig([
|
|
64
|
-
base,
|
|
65
|
-
{
|
|
66
|
-
extends: [typescript],
|
|
67
|
-
languageOptions: {
|
|
68
|
-
parserOptions: {
|
|
69
|
-
tsconfigRootDir: import.meta.dirname,
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
]);
|
|
74
|
-
```
|
|
75
|
-
|
|
76
54
|
### Disabling Type Checking for JS Files
|
|
77
55
|
|
|
78
56
|
If you have JavaScript files alongside TypeScript, disable type checking for them:
|
|
@@ -85,12 +63,7 @@ import { base, typescript } from "@tractorbeam/eslint-config";
|
|
|
85
63
|
|
|
86
64
|
export default defineConfig([
|
|
87
65
|
base,
|
|
88
|
-
|
|
89
|
-
extends: [typescript],
|
|
90
|
-
languageOptions: {
|
|
91
|
-
parserOptions: { tsconfigRootDir: import.meta.dirname },
|
|
92
|
-
},
|
|
93
|
-
},
|
|
66
|
+
typescript,
|
|
94
67
|
{ files: ["**/*.js"], extends: [tseslint.configs.disableTypeChecked] },
|
|
95
68
|
]);
|
|
96
69
|
```
|
|
@@ -106,12 +79,7 @@ import { base, playwright, typescript } from "@tractorbeam/eslint-config";
|
|
|
106
79
|
|
|
107
80
|
export default defineConfig([
|
|
108
81
|
base,
|
|
109
|
-
|
|
110
|
-
extends: [typescript],
|
|
111
|
-
languageOptions: {
|
|
112
|
-
parserOptions: { tsconfigRootDir: import.meta.dirname },
|
|
113
|
-
},
|
|
114
|
-
},
|
|
82
|
+
eslint,
|
|
115
83
|
{ files: ["**/e2e/**/*.ts"], extends: [playwright] },
|
|
116
84
|
]);
|
|
117
85
|
```
|
|
@@ -127,12 +95,7 @@ import { base, react, typescript } from "@tractorbeam/eslint-config";
|
|
|
127
95
|
|
|
128
96
|
export default defineConfig([
|
|
129
97
|
base,
|
|
130
|
-
|
|
131
|
-
extends: [typescript],
|
|
132
|
-
languageOptions: {
|
|
133
|
-
parserOptions: { tsconfigRootDir: import.meta.dirname },
|
|
134
|
-
},
|
|
135
|
-
},
|
|
98
|
+
typescript,
|
|
136
99
|
{
|
|
137
100
|
extends: [react],
|
|
138
101
|
rules: {
|
|
@@ -154,40 +117,12 @@ import { base, typescript } from "@tractorbeam/eslint-config";
|
|
|
154
117
|
|
|
155
118
|
export default defineConfig([
|
|
156
119
|
base,
|
|
157
|
-
|
|
158
|
-
extends: [typescript],
|
|
159
|
-
languageOptions: {
|
|
160
|
-
parserOptions: { tsconfigRootDir: import.meta.dirname },
|
|
161
|
-
},
|
|
162
|
-
},
|
|
120
|
+
typescript
|
|
163
121
|
includeIgnoreFile(".gitignore"),
|
|
164
122
|
globalIgnores(["dist/**", "*.gen.ts"]),
|
|
165
123
|
]);
|
|
166
124
|
```
|
|
167
125
|
|
|
168
|
-
## Monorepo Setup
|
|
169
|
-
|
|
170
|
-
For monorepos with multiple `tsconfig.json` files, configure the `project` array:
|
|
171
|
-
|
|
172
|
-
```typescript
|
|
173
|
-
import { defineConfig } from "eslint/config";
|
|
174
|
-
|
|
175
|
-
import { base, typescript } from "@tractorbeam/eslint-config";
|
|
176
|
-
|
|
177
|
-
export default defineConfig([
|
|
178
|
-
base,
|
|
179
|
-
{
|
|
180
|
-
extends: [typescript],
|
|
181
|
-
languageOptions: {
|
|
182
|
-
parserOptions: {
|
|
183
|
-
project: ["./tsconfig.eslint.json", "./packages/*/tsconfig.json"],
|
|
184
|
-
tsconfigRootDir: import.meta.dirname,
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
]);
|
|
189
|
-
```
|
|
190
|
-
|
|
191
126
|
## Peer Dependencies
|
|
192
127
|
|
|
193
128
|
- `eslint >= 9`
|
package/dist/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIrC,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAQ9B,CAAC"}
|
package/dist/base.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import eslint from "@eslint/js";
|
|
2
|
+
import { configs as pluginDependConfigs } from "eslint-plugin-depend";
|
|
2
3
|
import { defineConfig } from "eslint/config";
|
|
3
4
|
export const base = defineConfig([
|
|
4
5
|
eslint.configs.recommended,
|
|
6
|
+
pluginDependConfigs["flat/recommended"],
|
|
5
7
|
{
|
|
6
8
|
rules: {
|
|
7
9
|
"no-nested-ternary": "error",
|
package/dist/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAoB,YAAY,CAAC;IAChD,MAAM,CAAC,OAAO,CAAC,WAAW;IAC1B;QACE,KAAK,EAAE;YACL,mBAAmB,EAAE,OAAO;SAC7B;KACF;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,IAAI,GAAoB,YAAY,CAAC;IAChD,MAAM,CAAC,OAAO,CAAC,WAAW;IAC1B,mBAAmB,CAAC,kBAAkB,CAAC;IACvC;QACE,KAAK,EAAE;YACL,mBAAmB,EAAE,OAAO;SAC7B;KACF;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack-router.d.ts","sourceRoot":"","sources":["../src/tanstack-router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"tanstack-router.d.ts","sourceRoot":"","sources":["../src/tanstack-router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGrC,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAExC,CAAC"}
|
package/dist/tanstack-router.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import pluginTanStackRouter from "@tanstack/eslint-plugin-router";
|
|
2
2
|
import { defineConfig } from "eslint/config";
|
|
3
|
-
import tseslint from "typescript-eslint";
|
|
4
3
|
export const tanstackRouter = defineConfig([
|
|
5
|
-
|
|
6
|
-
files: ["**/*.tsx", "**/*.jsx"],
|
|
7
|
-
extends: [pluginTanStackRouter.configs["flat/recommended"]],
|
|
8
|
-
plugins: {
|
|
9
|
-
"@typescript-eslint": tseslint,
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
// tanstack throws notFound and similar to redirect immediately
|
|
13
|
-
"@typescript-eslint/only-throw-error": "off",
|
|
14
|
-
},
|
|
15
|
-
},
|
|
4
|
+
pluginTanStackRouter.configs["flat/recommended"],
|
|
16
5
|
]);
|
|
17
6
|
//# sourceMappingURL=tanstack-router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tanstack-router.js","sourceRoot":"","sources":["../src/tanstack-router.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tanstack-router.js","sourceRoot":"","sources":["../src/tanstack-router.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,MAAM,CAAC,MAAM,cAAc,GAAoB,YAAY,CAAC;IAC1D,oBAAoB,CAAC,OAAO,CAAC,kBAAkB,CAAC;CACjD,CAAC,CAAC"}
|
package/dist/typescript.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOrC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EA0DpC,CAAC"}
|
package/dist/typescript.js
CHANGED
|
@@ -11,6 +11,7 @@ export const typescript = defineConfig([
|
|
|
11
11
|
tseslint.configs.stylisticTypeChecked,
|
|
12
12
|
pluginUnicorn.configs.recommended,
|
|
13
13
|
pluginRegexp.configs["flat/recommended"],
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
14
15
|
pluginImportLite.configs.recommended,
|
|
15
16
|
],
|
|
16
17
|
languageOptions: {
|
|
@@ -22,9 +23,26 @@ export const typescript = defineConfig([
|
|
|
22
23
|
"@typescript-eslint/no-floating-promises": "off",
|
|
23
24
|
"@typescript-eslint/restrict-template-expressions": "off",
|
|
24
25
|
"@typescript-eslint/ban-ts-comment": "warn",
|
|
25
|
-
"@typescript-eslint/consistent-type-imports": "error",
|
|
26
26
|
"@typescript-eslint/no-empty-object-type": "warn",
|
|
27
27
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
28
|
+
"@typescript-eslint/consistent-type-imports": "error",
|
|
29
|
+
"@typescript-eslint/only-throw-error": [
|
|
30
|
+
"error",
|
|
31
|
+
{
|
|
32
|
+
allow: [
|
|
33
|
+
{
|
|
34
|
+
from: "package",
|
|
35
|
+
package: "@tanstack/router-core",
|
|
36
|
+
name: "Redirect",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
from: "package",
|
|
40
|
+
package: "@tanstack/router-core",
|
|
41
|
+
name: "NotFoundError",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
28
46
|
"@typescript-eslint/no-unused-vars": [
|
|
29
47
|
"error",
|
|
30
48
|
{
|
package/dist/typescript.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.js","sourceRoot":"","sources":["../src/typescript.ts"],"names":[],"mappings":"AACA,OAAO,gBAAgB,MAAM,2BAA2B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,OAAO,CAAC,WAAW;SACrC;QACD,eAAe,EAAE;YACf,aAAa,EAAE;gBACb,cAAc,EAAE,IAAI;aACrB;SACF;QACD,KAAK,EAAE;YACL,yCAAyC,EAAE,KAAK;YAChD,kDAAkD,EAAE,KAAK;YAEzD,mCAAmC,EAAE,MAAM;YAC3C,yCAAyC,EAAE,MAAM;YACjD,oCAAoC,EAAE,MAAM;YAE5C,4CAA4C,EAAE,OAAO;YACrD,qCAAqC,EAAE;gBACrC,OAAO;gBACP;oBACE,KAAK,EAAE;wBACL;4BACE,IAAI,EAAE,SAAS;4BACf,OAAO,EAAE,uBAAuB;4BAChC,IAAI,EAAE,UAAU;yBACjB;wBACD;4BACE,IAAI,EAAE,SAAS;4BACf,OAAO,EAAE,uBAAuB;4BAChC,IAAI,EAAE,eAAe;yBACtB;qBACF;iBACF;aACF;YACD,mCAAmC,EAAE;gBACnC,OAAO;gBACP;oBACE,iBAAiB,EAAE,IAAI;oBACvB,iBAAiB,EAAE,IAAI;oBACvB,8BAA8B,EAAE,IAAI;iBACrC;aACF;YAED,2BAA2B,EAAE,KAAK;YAClC,iBAAiB,EAAE,KAAK;YACxB,+BAA+B,EAAE,KAAK;YACtC,mCAAmC,EAAE,KAAK;YAC1C,uBAAuB,EAAE,KAAK;SAC/B;KACF;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tractorbeam/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Shared ESLint configuration for Tractorbeam projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tractorbeam",
|
|
@@ -66,25 +66,26 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@eslint/js": "^9.39.2",
|
|
68
68
|
"@tanstack/eslint-plugin-router": "^1.141.0",
|
|
69
|
-
"eslint-config-prettier": "^10.1.
|
|
70
|
-
"eslint-plugin-
|
|
69
|
+
"eslint-config-prettier": "^10.1.8",
|
|
70
|
+
"eslint-plugin-depend": "^1.4.0",
|
|
71
|
+
"eslint-plugin-import-lite": "^0.4.0",
|
|
71
72
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
72
73
|
"eslint-plugin-playwright": "^2.4.0",
|
|
73
74
|
"eslint-plugin-react": "^7.37.5",
|
|
74
75
|
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
|
|
75
76
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
76
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
77
|
+
"eslint-plugin-react-refresh": "^0.4.26",
|
|
77
78
|
"eslint-plugin-regexp": "^2.10.0",
|
|
78
79
|
"eslint-plugin-unicorn": "^62.0.0",
|
|
79
80
|
"globals": "^16.5.0",
|
|
80
|
-
"typescript-eslint": "^8.
|
|
81
|
+
"typescript-eslint": "^8.50.0"
|
|
81
82
|
},
|
|
82
83
|
"devDependencies": {
|
|
83
84
|
"@types/eslint": "^9.6.1",
|
|
84
85
|
"@types/eslint-plugin-jsx-a11y": "^6.10.1",
|
|
85
|
-
"@types/node": "^
|
|
86
|
+
"@types/node": "^25.0.3",
|
|
86
87
|
"typescript": "^5.9.3",
|
|
87
|
-
"@tractorbeam/typescript-config": "0.1.
|
|
88
|
+
"@tractorbeam/typescript-config": "0.1.2"
|
|
88
89
|
},
|
|
89
90
|
"peerDependencies": {
|
|
90
91
|
"eslint": ">= 9",
|