@mlaursen/eslint-config 8.0.3 → 9.0.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/README.md +47 -42
- package/dist/base.d.ts +2 -2
- package/dist/frontend.d.ts +3 -3
- package/dist/gitignore.d.ts +4 -4
- package/dist/gitignore.js +2 -2
- package/dist/index.d.ts +29 -29
- package/dist/index.js +3 -3
- package/dist/jsxA11y.d.ts +4 -4
- package/dist/jsxA11y.js +4 -5
- package/dist/react.d.ts +4 -4
- package/dist/react.js +6 -5
- package/dist/testing-library.d.ts +7 -7
- package/dist/testing-library.js +4 -4
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js +1 -0
- package/dist/typescript.d.ts +3 -3
- package/package.json +14 -14
package/README.md
CHANGED
|
@@ -14,13 +14,16 @@ Then create an `eslint.config.mjs` with one of the following:
|
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
16
|
// @ts-check
|
|
17
|
-
import {
|
|
17
|
+
import { defineConfig, configs, gitignore } from "@mlaursen/eslint-config";
|
|
18
18
|
|
|
19
19
|
// somewhat strict type checking
|
|
20
|
-
export default
|
|
20
|
+
export default defineConfig(
|
|
21
|
+
gitignore(import.meta.url),
|
|
22
|
+
...configs.frontend("jest")
|
|
23
|
+
);
|
|
21
24
|
|
|
22
25
|
// or with vitest
|
|
23
|
-
// export default
|
|
26
|
+
// export default defineConfig(
|
|
24
27
|
// gitignore(import.meta.url),
|
|
25
28
|
// ...configs.frontend("vitest")
|
|
26
29
|
// );
|
|
@@ -28,16 +31,16 @@ export default config(gitignore(import.meta.url), ...configs.frontend("jest"));
|
|
|
28
31
|
|
|
29
32
|
```js
|
|
30
33
|
// @ts-check
|
|
31
|
-
import {
|
|
34
|
+
import { defineConfig, configs, gitignore } from "@mlaursen/eslint-config";
|
|
32
35
|
|
|
33
36
|
// strict type checking
|
|
34
|
-
export default
|
|
37
|
+
export default defineConfig(
|
|
35
38
|
gitignore(import.meta.url),
|
|
36
39
|
...configs.frontendTypeChecking(import.meta.dirname, "jest")
|
|
37
40
|
);
|
|
38
41
|
|
|
39
42
|
// or with vitest
|
|
40
|
-
// export default
|
|
43
|
+
// export default defineConfig(
|
|
41
44
|
// gitignore(import.meta.url),
|
|
42
45
|
// ...configs.frontendTypeChecking(import.meta.dirname, "vitest")
|
|
43
46
|
// );
|
|
@@ -45,7 +48,7 @@ export default config(
|
|
|
45
48
|
|
|
46
49
|
```js
|
|
47
50
|
// @ts-check
|
|
48
|
-
import {
|
|
51
|
+
import { defineConfig, configs, gitignore } from "@mlaursen/eslint-config";
|
|
49
52
|
|
|
50
53
|
// NOTE: This is recommended for strict type checking. Callable as:
|
|
51
54
|
// `cross-env STRICT_TYPING=true eslint "**/*.{ts,tsx,mts,mtsx,js,jsx,mjs,cjs}`
|
|
@@ -62,12 +65,12 @@ const frontend = strict
|
|
|
62
65
|
// const frontend = strict
|
|
63
66
|
// ? configs.frontendTypeChecking(import.meta.dirname, "vitest")
|
|
64
67
|
// : configs.frontend("vitest");
|
|
65
|
-
export default
|
|
68
|
+
export default defineConfig(gitignore(import.meta.url), ...frontend);
|
|
66
69
|
```
|
|
67
70
|
|
|
68
|
-
The `
|
|
69
|
-
definitions and `gitignore` automatically ignores files from
|
|
70
|
-
your `.gitignore` rules.
|
|
71
|
+
The `defineConfig` export is the `@eslintjs/config.defineConfig()` function to
|
|
72
|
+
provide type definitions and `gitignore` automatically ignores files from
|
|
73
|
+
linting based on your `.gitignore` rules.
|
|
71
74
|
|
|
72
75
|
## Next.js Setup
|
|
73
76
|
|
|
@@ -83,7 +86,7 @@ pnpm add -D @eslint/eslintrc @next/eslint-plugin-next
|
|
|
83
86
|
```diff
|
|
84
87
|
// @ts-check
|
|
85
88
|
+import { FlatCompat } from "@eslint/eslintrc";
|
|
86
|
-
import {
|
|
89
|
+
import { defineConfig, configs, gitignore } from "@mlaursen/eslint-config";
|
|
87
90
|
|
|
88
91
|
+const compat = new FlatCompat({
|
|
89
92
|
+ baseDirectory: import.meta.dirname,
|
|
@@ -91,7 +94,7 @@ pnpm add -D @eslint/eslintrc @next/eslint-plugin-next
|
|
|
91
94
|
+
|
|
92
95
|
|
|
93
96
|
// somewhat strict type checking
|
|
94
|
-
export default
|
|
97
|
+
export default defineConfig(
|
|
95
98
|
gitignore(import.meta.url),
|
|
96
99
|
+ ...compat.config({
|
|
97
100
|
+ extends: ["plugin:@next/next/recommended"],
|
|
@@ -133,9 +136,9 @@ The base config is automatically used by the [typescript](#typescript) config an
|
|
|
133
136
|
|
|
134
137
|
```js
|
|
135
138
|
// @ts-check
|
|
136
|
-
import {
|
|
139
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
137
140
|
|
|
138
|
-
export default
|
|
141
|
+
export default defineConfig(...configs.base);
|
|
139
142
|
```
|
|
140
143
|
|
|
141
144
|
### typescript
|
|
@@ -147,9 +150,9 @@ behavior and disabled strict rules in test files.
|
|
|
147
150
|
|
|
148
151
|
```js
|
|
149
152
|
// @ts-check
|
|
150
|
-
import {
|
|
153
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
151
154
|
|
|
152
|
-
export default
|
|
155
|
+
export default defineConfig(...configs.typescript);
|
|
153
156
|
```
|
|
154
157
|
|
|
155
158
|
### typescriptTypeChecking
|
|
@@ -160,9 +163,11 @@ This is the same as the [typescript](#typescript) config but also includes the `
|
|
|
160
163
|
|
|
161
164
|
```js
|
|
162
165
|
// @ts-check
|
|
163
|
-
import {
|
|
166
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
164
167
|
|
|
165
|
-
export default
|
|
168
|
+
export default defineConfig(
|
|
169
|
+
...configs.typescriptTypeChecking(import.meta.dirname)
|
|
170
|
+
);
|
|
166
171
|
```
|
|
167
172
|
|
|
168
173
|
### testing
|
|
@@ -171,12 +176,12 @@ This enables the [jest](#jest) or [vitest](#vitest) rules along with [jestDom](#
|
|
|
171
176
|
|
|
172
177
|
```js
|
|
173
178
|
// @ts-check
|
|
174
|
-
import {
|
|
179
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
175
180
|
|
|
176
|
-
export default
|
|
181
|
+
export default defineConfig(...configs.testing("jest"));
|
|
177
182
|
|
|
178
183
|
// or vitest
|
|
179
|
-
export default
|
|
184
|
+
export default defineConfig(...configs.testing("vitest"));
|
|
180
185
|
```
|
|
181
186
|
|
|
182
187
|
### jest
|
|
@@ -185,9 +190,9 @@ This only enables the `eslint-plugin-jest.configs['flat/recommended]` rules on t
|
|
|
185
190
|
|
|
186
191
|
```js
|
|
187
192
|
// @ts-check
|
|
188
|
-
import {
|
|
193
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
189
194
|
|
|
190
|
-
export default
|
|
195
|
+
export default defineConfig(...configs.jest);
|
|
191
196
|
```
|
|
192
197
|
|
|
193
198
|
### jestDom
|
|
@@ -196,9 +201,9 @@ This only enables the `eslint-plugin-jest-dom.configs['flat/recommended]` rules
|
|
|
196
201
|
|
|
197
202
|
```js
|
|
198
203
|
// @ts-check
|
|
199
|
-
import {
|
|
204
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
200
205
|
|
|
201
|
-
export default
|
|
206
|
+
export default defineConfig(...configs.jestDom);
|
|
202
207
|
```
|
|
203
208
|
|
|
204
209
|
### vitest
|
|
@@ -211,16 +216,16 @@ This enables the `eslint-plugin-testing-library/.configs["flat/react]` plugin an
|
|
|
211
216
|
|
|
212
217
|
```js
|
|
213
218
|
// @ts-check
|
|
214
|
-
import {
|
|
219
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
215
220
|
|
|
216
|
-
export default
|
|
221
|
+
export default defineConfig(...configs.vitest);
|
|
217
222
|
```
|
|
218
223
|
|
|
219
224
|
```js
|
|
220
225
|
// @ts-check
|
|
221
|
-
import {
|
|
226
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
222
227
|
|
|
223
|
-
export default
|
|
228
|
+
export default defineConfig(...configs.testingLibraryReact);
|
|
224
229
|
```
|
|
225
230
|
|
|
226
231
|
### testingLibraryDom
|
|
@@ -231,9 +236,9 @@ This enables the `eslint-plugin-testing-library/.configs["flat/dom]` plugin and
|
|
|
231
236
|
|
|
232
237
|
```js
|
|
233
238
|
// @ts-check
|
|
234
|
-
import {
|
|
239
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
235
240
|
|
|
236
|
-
export default
|
|
241
|
+
export default defineConfig(...configs.testingLibraryDom);
|
|
237
242
|
```
|
|
238
243
|
|
|
239
244
|
### react
|
|
@@ -242,9 +247,9 @@ This enables the `eslint-plugin-react` and `eslint-plugin-react-hooks`:
|
|
|
242
247
|
|
|
243
248
|
```js
|
|
244
249
|
// @ts-check
|
|
245
|
-
import {
|
|
250
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
246
251
|
|
|
247
|
-
export default
|
|
252
|
+
export default defineConfig(...configs.react);
|
|
248
253
|
```
|
|
249
254
|
|
|
250
255
|
### jsxA11y
|
|
@@ -253,9 +258,9 @@ This enables `eslint-plugin-jsx-a11y`:
|
|
|
253
258
|
|
|
254
259
|
```js
|
|
255
260
|
// @ts-check
|
|
256
|
-
import {
|
|
261
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
257
262
|
|
|
258
|
-
export default
|
|
263
|
+
export default defineConfig(...configs.jsxA11y);
|
|
259
264
|
```
|
|
260
265
|
|
|
261
266
|
### frontend
|
|
@@ -265,12 +270,12 @@ This is my normal frontend repo setup with `react`, `jsxA11y`, `jest` or
|
|
|
265
270
|
|
|
266
271
|
```js
|
|
267
272
|
// @ts-check
|
|
268
|
-
import {
|
|
273
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
269
274
|
|
|
270
|
-
export default
|
|
275
|
+
export default defineConfig(...configs.frontend("jest"));
|
|
271
276
|
|
|
272
277
|
// or with vitest
|
|
273
|
-
export default
|
|
278
|
+
export default defineConfig(...configs.frontend("vitest"));
|
|
274
279
|
```
|
|
275
280
|
|
|
276
281
|
### frontendTypeChecking
|
|
@@ -279,10 +284,10 @@ Same as the [frontend](#frontend), but enables the strict type checking.
|
|
|
279
284
|
|
|
280
285
|
```js
|
|
281
286
|
// @ts-check
|
|
282
|
-
import {
|
|
287
|
+
import { defineConfig, configs } from "@mlaursen/eslint-config";
|
|
283
288
|
|
|
284
|
-
export default
|
|
289
|
+
export default defineConfig(...configs.frontendTypeChecking(import.meta.dirname, "jest"));
|
|
285
290
|
|
|
286
291
|
// or with vitest
|
|
287
|
-
export default
|
|
292
|
+
export default defineConfig(...configs.frontendTypeChecking(import.meta.dirname, "vitest"));
|
|
288
293
|
```
|
package/dist/base.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* ```js
|
|
@@ -7,4 +7,4 @@ import { type TSESLint } from "@typescript-eslint/utils";
|
|
|
7
7
|
* export default config(...configs.base);
|
|
8
8
|
* ```
|
|
9
9
|
*/
|
|
10
|
-
export declare const base:
|
|
10
|
+
export declare const base: Linter.Config[];
|
package/dist/frontend.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
import { type TestFramework } from "./testing.js";
|
|
3
3
|
/**
|
|
4
4
|
* @example
|
|
@@ -12,7 +12,7 @@ import { type TestFramework } from "./testing.js";
|
|
|
12
12
|
* );
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export declare const frontend: (testFramework: TestFramework) =>
|
|
15
|
+
export declare const frontend: (testFramework: TestFramework) => Linter.Config[];
|
|
16
16
|
/**
|
|
17
17
|
* @example
|
|
18
18
|
* ```ts
|
|
@@ -25,4 +25,4 @@ export declare const frontend: (testFramework: TestFramework) => TSESLint.FlatCo
|
|
|
25
25
|
* );
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
export declare const frontendTypeChecking: (tsconfigRootDir: string, testFramework: TestFramework) =>
|
|
28
|
+
export declare const frontendTypeChecking: (tsconfigRootDir: string, testFramework: TestFramework) => Linter.Config[];
|
package/dist/gitignore.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* ```ts
|
|
@@ -9,10 +9,10 @@ import { type TSESLint } from "@typescript-eslint/utils";
|
|
|
9
9
|
*
|
|
10
10
|
* @example .gitignore in a different folder
|
|
11
11
|
* ```ts
|
|
12
|
-
* import {
|
|
12
|
+
* import { configs, defineConfig, gitignore } from "@mlaursen/eslint-config";
|
|
13
13
|
* import { join } from "node:path";
|
|
14
14
|
*
|
|
15
|
-
* export default
|
|
15
|
+
* export default defineConfig(gitignore(join(import.meta.url, "..", "..")), ...configs.typescript);
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
export declare function gitignore(importMetaUrl: string):
|
|
18
|
+
export declare function gitignore(importMetaUrl: string): Linter.Config;
|
package/dist/gitignore.js
CHANGED
|
@@ -11,10 +11,10 @@ import { fileURLToPath } from "node:url";
|
|
|
11
11
|
*
|
|
12
12
|
* @example .gitignore in a different folder
|
|
13
13
|
* ```ts
|
|
14
|
-
* import {
|
|
14
|
+
* import { configs, defineConfig, gitignore } from "@mlaursen/eslint-config";
|
|
15
15
|
* import { join } from "node:path";
|
|
16
16
|
*
|
|
17
|
-
* export default
|
|
17
|
+
* export default defineConfig(gitignore(join(import.meta.url, "..", "..")), ...configs.typescript);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export function gitignore(importMetaUrl) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
2
|
import { gitignore } from "./gitignore.js";
|
|
3
3
|
export * from "./constants.js";
|
|
4
|
-
export {
|
|
4
|
+
export { defineConfig, gitignore };
|
|
5
5
|
export declare const configs: {
|
|
6
|
-
readonly base: import("
|
|
7
|
-
readonly jest: import("
|
|
8
|
-
readonly jestDom: import("
|
|
9
|
-
readonly react: import("
|
|
10
|
-
readonly typescript: import("
|
|
11
|
-
readonly typescriptTypeChecking: (tsconfigRootDir: string) => import("
|
|
12
|
-
readonly testingLibraryDom: import("
|
|
13
|
-
readonly testingLibraryReact: import("
|
|
14
|
-
readonly frontend: (testFramework: import("./testing.js").TestFramework) => import("
|
|
15
|
-
readonly frontendTypeChecking: (tsconfigRootDir: string, testFramework: import("./testing.js").TestFramework) => import("
|
|
16
|
-
readonly jsxA11y: import("
|
|
17
|
-
readonly testing: (framework: import("./testing.js").TestFramework) => import("
|
|
18
|
-
readonly vitest: import("
|
|
6
|
+
readonly base: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
7
|
+
readonly jest: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
8
|
+
readonly jestDom: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
9
|
+
readonly react: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
10
|
+
readonly typescript: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
11
|
+
readonly typescriptTypeChecking: (tsconfigRootDir: string) => import("eslint").Linter.Config[];
|
|
12
|
+
readonly testingLibraryDom: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
13
|
+
readonly testingLibraryReact: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
14
|
+
readonly frontend: (testFramework: import("./testing.js").TestFramework) => import("eslint").Linter.Config[];
|
|
15
|
+
readonly frontendTypeChecking: (tsconfigRootDir: string, testFramework: import("./testing.js").TestFramework) => import("eslint").Linter.Config[];
|
|
16
|
+
readonly jsxA11y: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
17
|
+
readonly testing: (framework: import("./testing.js").TestFramework) => import("eslint").Linter.Config[];
|
|
18
|
+
readonly vitest: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
19
19
|
};
|
|
20
20
|
declare const _default: {
|
|
21
|
-
|
|
21
|
+
defineConfig: typeof defineConfig;
|
|
22
22
|
configs: {
|
|
23
|
-
readonly base: import("
|
|
24
|
-
readonly jest: import("
|
|
25
|
-
readonly jestDom: import("
|
|
26
|
-
readonly react: import("
|
|
27
|
-
readonly typescript: import("
|
|
28
|
-
readonly typescriptTypeChecking: (tsconfigRootDir: string) => import("
|
|
29
|
-
readonly testingLibraryDom: import("
|
|
30
|
-
readonly testingLibraryReact: import("
|
|
31
|
-
readonly frontend: (testFramework: import("./testing.js").TestFramework) => import("
|
|
32
|
-
readonly frontendTypeChecking: (tsconfigRootDir: string, testFramework: import("./testing.js").TestFramework) => import("
|
|
33
|
-
readonly jsxA11y: import("
|
|
34
|
-
readonly testing: (framework: import("./testing.js").TestFramework) => import("
|
|
35
|
-
readonly vitest: import("
|
|
23
|
+
readonly base: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
24
|
+
readonly jest: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
25
|
+
readonly jestDom: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
26
|
+
readonly react: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
27
|
+
readonly typescript: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
28
|
+
readonly typescriptTypeChecking: (tsconfigRootDir: string) => import("eslint").Linter.Config[];
|
|
29
|
+
readonly testingLibraryDom: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
30
|
+
readonly testingLibraryReact: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
31
|
+
readonly frontend: (testFramework: import("./testing.js").TestFramework) => import("eslint").Linter.Config[];
|
|
32
|
+
readonly frontendTypeChecking: (tsconfigRootDir: string, testFramework: import("./testing.js").TestFramework) => import("eslint").Linter.Config[];
|
|
33
|
+
readonly jsxA11y: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
34
|
+
readonly testing: (framework: import("./testing.js").TestFramework) => import("eslint").Linter.Config[];
|
|
35
|
+
readonly vitest: import("eslint").Linter.Config<import("eslint").Linter.RulesRecord>[];
|
|
36
36
|
};
|
|
37
37
|
gitignore: typeof gitignore;
|
|
38
38
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineConfig } from "eslint/config";
|
|
2
2
|
import { base } from "./base.js";
|
|
3
3
|
import { frontend, frontendTypeChecking } from "./frontend.js";
|
|
4
4
|
import { gitignore } from "./gitignore.js";
|
|
@@ -8,7 +8,7 @@ import { testingLibraryDom, testingLibraryReact } from "./testing-library.js";
|
|
|
8
8
|
import { jest, jestDom, testing, vitest } from "./testing.js";
|
|
9
9
|
import { typescript, typescriptTypeChecking } from "./typescript.js";
|
|
10
10
|
export * from "./constants.js";
|
|
11
|
-
export {
|
|
11
|
+
export { defineConfig, gitignore };
|
|
12
12
|
export var configs = {
|
|
13
13
|
base: base,
|
|
14
14
|
jest: jest,
|
|
@@ -25,7 +25,7 @@ export var configs = {
|
|
|
25
25
|
vitest: vitest,
|
|
26
26
|
};
|
|
27
27
|
export default {
|
|
28
|
-
|
|
28
|
+
defineConfig: defineConfig,
|
|
29
29
|
configs: configs,
|
|
30
30
|
gitignore: gitignore,
|
|
31
31
|
};
|
package/dist/jsxA11y.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* ```ts
|
|
5
|
-
* import {
|
|
5
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
6
6
|
*
|
|
7
|
-
* export default
|
|
7
|
+
* export default defineConfig(...configs.jsxA11y);
|
|
8
8
|
* ```
|
|
9
9
|
*/
|
|
10
|
-
export declare const jsxA11y:
|
|
10
|
+
export declare const jsxA11y: Linter.Config[];
|
package/dist/jsxA11y.js
CHANGED
|
@@ -14,17 +14,16 @@ import { BASE_NAME, JSX_FILES, TEST_FILES } from "./constants.js";
|
|
|
14
14
|
/**
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
17
|
-
* import {
|
|
17
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
18
18
|
*
|
|
19
|
-
* export default
|
|
19
|
+
* export default defineConfig(...configs.jsxA11y);
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export var jsxA11y = [
|
|
23
|
-
__assign(__assign({ name: "".concat(BASE_NAME, "/jsx-a11y"), files: JSX_FILES }, jsxA11yPlugin.flatConfigs.recommended), { rules: {
|
|
23
|
+
__assign(__assign({ name: "".concat(BASE_NAME, "/jsx-a11y"), files: JSX_FILES }, jsxA11yPlugin.flatConfigs.recommended), { rules: __assign(__assign({}, jsxA11yPlugin.flatConfigs.recommended.rules), {
|
|
24
24
|
// I **only** use autoFocus within dialogs which provide the correct
|
|
25
25
|
// context for screen readers.
|
|
26
|
-
"jsx-a11y/no-autofocus": "off",
|
|
27
|
-
} }),
|
|
26
|
+
"jsx-a11y/no-autofocus": "off" }) }),
|
|
28
27
|
{
|
|
29
28
|
name: "".concat(BASE_NAME, "/jsx-a11y/testing"),
|
|
30
29
|
files: TEST_FILES,
|
package/dist/react.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* ```ts
|
|
5
|
-
* import {
|
|
5
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
6
6
|
*
|
|
7
|
-
* export default
|
|
7
|
+
* export default defineConfig(...configs.react);
|
|
8
8
|
* ```
|
|
9
9
|
*
|
|
10
10
|
* Enables:
|
|
@@ -14,4 +14,4 @@ import { type TSESLint } from "@typescript-eslint/utils";
|
|
|
14
14
|
* - `eslint-plugin-react-hooks` with:
|
|
15
15
|
* - recommended rules
|
|
16
16
|
*/
|
|
17
|
-
export declare const react:
|
|
17
|
+
export declare const react: Linter.Config[];
|
package/dist/react.js
CHANGED
|
@@ -9,20 +9,21 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var _a, _b, _c;
|
|
12
13
|
import reactPlugin from "eslint-plugin-react";
|
|
13
14
|
import reactHooksPlugin from "eslint-plugin-react-hooks";
|
|
14
15
|
import { BASE_NAME, JSX_FILES } from "./constants.js";
|
|
15
16
|
// Why is the typedef optional?
|
|
16
17
|
var flat = reactPlugin.configs.flat;
|
|
17
|
-
var reactPlugins = flat.recommended.plugins;
|
|
18
|
-
var recommendedRules = flat.recommended.rules;
|
|
19
|
-
var jsxRuntimeRules = flat["jsx-runtime"].rules;
|
|
18
|
+
var reactPlugins = (_a = flat.recommended) === null || _a === void 0 ? void 0 : _a.plugins;
|
|
19
|
+
var recommendedRules = (_b = flat.recommended) === null || _b === void 0 ? void 0 : _b.rules;
|
|
20
|
+
var jsxRuntimeRules = (_c = flat["jsx-runtime"]) === null || _c === void 0 ? void 0 : _c.rules;
|
|
20
21
|
/**
|
|
21
22
|
* @example
|
|
22
23
|
* ```ts
|
|
23
|
-
* import {
|
|
24
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
24
25
|
*
|
|
25
|
-
* export default
|
|
26
|
+
* export default defineConfig(...configs.react);
|
|
26
27
|
* ```
|
|
27
28
|
*
|
|
28
29
|
* Enables:
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* ```ts
|
|
5
|
-
* import {
|
|
5
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
6
6
|
*
|
|
7
|
-
* export default
|
|
7
|
+
* export default defineConfig(
|
|
8
8
|
* ...configs.react,
|
|
9
9
|
* ...configs.jest,
|
|
10
10
|
* ...configs.jestDom,
|
|
@@ -15,13 +15,13 @@ import { type TSESLint } from "@typescript-eslint/utils";
|
|
|
15
15
|
* NOTE: Only choose this or the {@link testingLibraryDom}. Do not use
|
|
16
16
|
* both.
|
|
17
17
|
*/
|
|
18
|
-
export declare const testingLibraryReact:
|
|
18
|
+
export declare const testingLibraryReact: Linter.Config[];
|
|
19
19
|
/**
|
|
20
20
|
* @example
|
|
21
21
|
* ```ts
|
|
22
|
-
* import {
|
|
22
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
23
23
|
*
|
|
24
|
-
* export default
|
|
24
|
+
* export default defineConfig(
|
|
25
25
|
* ...configs.jest,
|
|
26
26
|
* ...configs.jestDom,
|
|
27
27
|
* ...configs.testingLibraryDom
|
|
@@ -31,4 +31,4 @@ export declare const testingLibraryReact: TSESLint.FlatConfig.ConfigArray;
|
|
|
31
31
|
* NOTE: Only choose this or the {@link testingLibraryReact}. Do not use
|
|
32
32
|
* both.
|
|
33
33
|
*/
|
|
34
|
-
export declare const testingLibraryDom:
|
|
34
|
+
export declare const testingLibraryDom: Linter.Config[];
|
package/dist/testing-library.js
CHANGED
|
@@ -14,9 +14,9 @@ import { BASE_NAME, TEST_FILES } from "./constants.js";
|
|
|
14
14
|
/**
|
|
15
15
|
* @example
|
|
16
16
|
* ```ts
|
|
17
|
-
* import {
|
|
17
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
18
18
|
*
|
|
19
|
-
* export default
|
|
19
|
+
* export default defineConfig(
|
|
20
20
|
* ...configs.react,
|
|
21
21
|
* ...configs.jest,
|
|
22
22
|
* ...configs.jestDom,
|
|
@@ -33,9 +33,9 @@ export var testingLibraryReact = [
|
|
|
33
33
|
/**
|
|
34
34
|
* @example
|
|
35
35
|
* ```ts
|
|
36
|
-
* import {
|
|
36
|
+
* import { configs, defineConfig } from "@mlaursen/eslint-config";
|
|
37
37
|
*
|
|
38
|
-
* export default
|
|
38
|
+
* export default defineConfig(
|
|
39
39
|
* ...configs.jest,
|
|
40
40
|
* ...configs.jestDom,
|
|
41
41
|
* ...configs.testingLibraryDom
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
export type TestFramework = "jest" | "vitest";
|
|
3
3
|
/**
|
|
4
4
|
* @example
|
|
@@ -8,7 +8,7 @@ export type TestFramework = "jest" | "vitest";
|
|
|
8
8
|
* export default config(...configs.vitest);
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
export declare const vitest:
|
|
11
|
+
export declare const vitest: Linter.Config[];
|
|
12
12
|
/**
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
@@ -17,7 +17,7 @@ export declare const vitest: TSESLint.FlatConfig.ConfigArray;
|
|
|
17
17
|
* export default config(...configs.jest);
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export declare const jest:
|
|
20
|
+
export declare const jest: Linter.Config[];
|
|
21
21
|
/**
|
|
22
22
|
* @example
|
|
23
23
|
* ```ts
|
|
@@ -26,7 +26,7 @@ export declare const jest: TSESLint.FlatConfig.ConfigArray;
|
|
|
26
26
|
* export default config(...configs.jest, ...configs.jestDom);
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
export declare const jestDom:
|
|
29
|
+
export declare const jestDom: Linter.Config[];
|
|
30
30
|
/**
|
|
31
31
|
* @example
|
|
32
32
|
* ```ts
|
|
@@ -38,4 +38,4 @@ export declare const jestDom: TSESLint.FlatConfig.ConfigArray;
|
|
|
38
38
|
* export default config(...configs.testing("vitest"));
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
|
-
export declare const testing: (framework: TestFramework) =>
|
|
41
|
+
export declare const testing: (framework: TestFramework) => Linter.Config[];
|
package/dist/testing.js
CHANGED
|
@@ -51,6 +51,7 @@ export var vitest = [
|
|
|
51
51
|
name: "".concat(BASE_NAME, "/vitest"),
|
|
52
52
|
files: TEST_FILES,
|
|
53
53
|
plugins: {
|
|
54
|
+
// @ts-expect-error Invalid Linter.Config type
|
|
54
55
|
vitest: vitestPlugin,
|
|
55
56
|
},
|
|
56
57
|
rules: __assign(__assign({}, vitestPlugin.configs.recommended.rules), { "vitest/no-alias-methods": "error", "vitest/no-focused-tests": DEV_WARNING_PROD_ERROR, "vitest/no-disabled-tests": DEV_WARNING_PROD_ERROR, "vitest/no-duplicate-hooks": "error", "vitest/no-standalone-expect": "error", "vitest/prefer-expect-resolves": "error", "vitest/prefer-spy-on": "error", "vitest/prefer-vi-mocked": "error" }),
|
package/dist/typescript.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Linter } from "eslint";
|
|
2
2
|
/**
|
|
3
3
|
* @example
|
|
4
4
|
* ```ts
|
|
@@ -7,7 +7,7 @@ import { type TSESLint } from "@typescript-eslint/utils";
|
|
|
7
7
|
* export default config(gitignore(import.meta.url), ...configs.typescript);
|
|
8
8
|
* ```
|
|
9
9
|
*/
|
|
10
|
-
export declare const typescript:
|
|
10
|
+
export declare const typescript: Linter.Config[];
|
|
11
11
|
/**
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
@@ -20,4 +20,4 @@ export declare const typescript: TSESLint.FlatConfig.ConfigArray;
|
|
|
20
20
|
* );
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
|
-
export declare const typescriptTypeChecking: (tsconfigRootDir: string) =>
|
|
23
|
+
export declare const typescriptTypeChecking: (tsconfigRootDir: string) => Linter.Config[];
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlaursen/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "9.0.1",
|
|
5
5
|
"description": "An eslint config used by mlaursen for most projects.",
|
|
6
6
|
"repository": "https://github.com/mlaursen/eslint-config.git",
|
|
7
7
|
"author": "Mikkel Laursen <mlaursen03@gmail.com>",
|
|
@@ -21,29 +21,29 @@
|
|
|
21
21
|
"typescript"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@eslint/compat": "^1.
|
|
25
|
-
"@eslint/js": "^9.
|
|
24
|
+
"@eslint/compat": "^1.4.0",
|
|
25
|
+
"@eslint/js": "^9.36.0",
|
|
26
26
|
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
27
|
-
"@typescript-eslint/utils": "^8.
|
|
28
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
27
|
+
"@typescript-eslint/utils": "^8.44.1",
|
|
28
|
+
"@vitest/eslint-plugin": "^1.3.13",
|
|
29
29
|
"eslint-plugin-jest": "^29.0.1",
|
|
30
30
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
31
31
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
32
32
|
"eslint-plugin-react": "^7.37.5",
|
|
33
33
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
34
|
-
"eslint-plugin-testing-library": "^7.
|
|
35
|
-
"typescript-eslint": "^8.
|
|
34
|
+
"eslint-plugin-testing-library": "^7.10.0",
|
|
35
|
+
"typescript-eslint": "^8.44.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@changesets/cli": "^2.29.
|
|
39
|
-
"@mlaursen/release-script": "^0.0.
|
|
40
|
-
"@types/node": "^
|
|
41
|
-
"eslint": "^9.
|
|
38
|
+
"@changesets/cli": "^2.29.7",
|
|
39
|
+
"@mlaursen/release-script": "^0.0.5",
|
|
40
|
+
"@types/node": "^24.5.2",
|
|
41
|
+
"eslint": "^9.36.0",
|
|
42
42
|
"husky": "^9.1.7",
|
|
43
|
-
"lint-staged": "^16.1
|
|
43
|
+
"lint-staged": "^16.2.1",
|
|
44
44
|
"prettier": "^3.6.2",
|
|
45
|
-
"tsx": "^4.20.
|
|
46
|
-
"typescript": "^5.
|
|
45
|
+
"tsx": "^4.20.6",
|
|
46
|
+
"typescript": "^5.9.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"eslint": ">= 9.0.0",
|