@antfu/eslint-config 4.19.0 → 5.0.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 +10 -9
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +120 -112
- package/dist/index.js +3 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -382,15 +382,16 @@ Check out the [configs](https://github.com/antfu/eslint-config/blob/main/src/con
|
|
|
382
382
|
|
|
383
383
|
Since flat config requires us to explicitly provide the plugin names (instead of the mandatory convention from npm package name), we renamed some plugins to make the overall scope more consistent and easier to write.
|
|
384
384
|
|
|
385
|
-
| New Prefix | Original Prefix | Source Plugin
|
|
386
|
-
| ---------- | ---------------------- |
|
|
387
|
-
| `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite)
|
|
388
|
-
| `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)
|
|
389
|
-
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)
|
|
390
|
-
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint)
|
|
391
|
-
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic)
|
|
392
|
-
| `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest)
|
|
393
|
-
| `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests)
|
|
385
|
+
| New Prefix | Original Prefix | Source Plugin |
|
|
386
|
+
| ---------- | ---------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
387
|
+
| `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite) |
|
|
388
|
+
| `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
|
|
389
|
+
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
|
|
390
|
+
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
|
|
391
|
+
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
|
|
392
|
+
| `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
|
|
393
|
+
| `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests) |
|
|
394
|
+
| `next/*` | `@next/next` | [@next/eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
|
|
394
395
|
|
|
395
396
|
When you want to override rules, or disable them inline, you need to update to the new prefix:
|
|
396
397
|
|
package/dist/cli.js
CHANGED
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "
|
|
12
|
+
var version = "5.0.0";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -178,7 +178,7 @@ async function updateEslintFiles(result) {
|
|
|
178
178
|
//#region src/cli/constants-generated.ts
|
|
179
179
|
const versionsMap = {
|
|
180
180
|
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
181
|
-
"@next/eslint-plugin-next": "^15.4.
|
|
181
|
+
"@next/eslint-plugin-next": "^15.4.4",
|
|
182
182
|
"@unocss/eslint-plugin": "^66.3.3",
|
|
183
183
|
"astro-eslint-parser": "^1.2.2",
|
|
184
184
|
"eslint": "^9.31.0",
|
package/dist/index.d.ts
CHANGED
|
@@ -7,110 +7,6 @@ import { Linter } from "eslint";
|
|
|
7
7
|
|
|
8
8
|
//#region src/typegen.d.ts
|
|
9
9
|
interface RuleOptions {
|
|
10
|
-
/**
|
|
11
|
-
* Enforce font-display behavior with Google Fonts.
|
|
12
|
-
* @see https://nextjs.org/docs/messages/google-font-display
|
|
13
|
-
*/
|
|
14
|
-
'@next/next/google-font-display'?: Linter.RuleEntry<[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Ensure `preconnect` is used with Google Fonts.
|
|
17
|
-
* @see https://nextjs.org/docs/messages/google-font-preconnect
|
|
18
|
-
*/
|
|
19
|
-
'@next/next/google-font-preconnect'?: Linter.RuleEntry<[]>;
|
|
20
|
-
/**
|
|
21
|
-
* Enforce `id` attribute on `next/script` components with inline content.
|
|
22
|
-
* @see https://nextjs.org/docs/messages/inline-script-id
|
|
23
|
-
*/
|
|
24
|
-
'@next/next/inline-script-id'?: Linter.RuleEntry<[]>;
|
|
25
|
-
/**
|
|
26
|
-
* Prefer `next/script` component when using the inline script for Google Analytics.
|
|
27
|
-
* @see https://nextjs.org/docs/messages/next-script-for-ga
|
|
28
|
-
*/
|
|
29
|
-
'@next/next/next-script-for-ga'?: Linter.RuleEntry<[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Prevent assignment to the `module` variable.
|
|
32
|
-
* @see https://nextjs.org/docs/messages/no-assign-module-variable
|
|
33
|
-
*/
|
|
34
|
-
'@next/next/no-assign-module-variable'?: Linter.RuleEntry<[]>;
|
|
35
|
-
/**
|
|
36
|
-
* Prevent Client Components from being async functions.
|
|
37
|
-
* @see https://nextjs.org/docs/messages/no-async-client-component
|
|
38
|
-
*/
|
|
39
|
-
'@next/next/no-async-client-component'?: Linter.RuleEntry<[]>;
|
|
40
|
-
/**
|
|
41
|
-
* Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.
|
|
42
|
-
* @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
|
|
43
|
-
*/
|
|
44
|
-
'@next/next/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]>;
|
|
45
|
-
/**
|
|
46
|
-
* Prevent manual stylesheet tags.
|
|
47
|
-
* @see https://nextjs.org/docs/messages/no-css-tags
|
|
48
|
-
*/
|
|
49
|
-
'@next/next/no-css-tags'?: Linter.RuleEntry<[]>;
|
|
50
|
-
/**
|
|
51
|
-
* Prevent importing `next/document` outside of `pages/_document.js`.
|
|
52
|
-
* @see https://nextjs.org/docs/messages/no-document-import-in-page
|
|
53
|
-
*/
|
|
54
|
-
'@next/next/no-document-import-in-page'?: Linter.RuleEntry<[]>;
|
|
55
|
-
/**
|
|
56
|
-
* Prevent duplicate usage of `<Head>` in `pages/_document.js`.
|
|
57
|
-
* @see https://nextjs.org/docs/messages/no-duplicate-head
|
|
58
|
-
*/
|
|
59
|
-
'@next/next/no-duplicate-head'?: Linter.RuleEntry<[]>;
|
|
60
|
-
/**
|
|
61
|
-
* Prevent usage of `<head>` element.
|
|
62
|
-
* @see https://nextjs.org/docs/messages/no-head-element
|
|
63
|
-
*/
|
|
64
|
-
'@next/next/no-head-element'?: Linter.RuleEntry<[]>;
|
|
65
|
-
/**
|
|
66
|
-
* Prevent usage of `next/head` in `pages/_document.js`.
|
|
67
|
-
* @see https://nextjs.org/docs/messages/no-head-import-in-document
|
|
68
|
-
*/
|
|
69
|
-
'@next/next/no-head-import-in-document'?: Linter.RuleEntry<[]>;
|
|
70
|
-
/**
|
|
71
|
-
* Prevent usage of `<a>` elements to navigate to internal Next.js pages.
|
|
72
|
-
* @see https://nextjs.org/docs/messages/no-html-link-for-pages
|
|
73
|
-
*/
|
|
74
|
-
'@next/next/no-html-link-for-pages'?: Linter.RuleEntry<NextNextNoHtmlLinkForPages>;
|
|
75
|
-
/**
|
|
76
|
-
* Prevent usage of `<img>` element due to slower LCP and higher bandwidth.
|
|
77
|
-
* @see https://nextjs.org/docs/messages/no-img-element
|
|
78
|
-
*/
|
|
79
|
-
'@next/next/no-img-element'?: Linter.RuleEntry<[]>;
|
|
80
|
-
/**
|
|
81
|
-
* Prevent page-only custom fonts.
|
|
82
|
-
* @see https://nextjs.org/docs/messages/no-page-custom-font
|
|
83
|
-
*/
|
|
84
|
-
'@next/next/no-page-custom-font'?: Linter.RuleEntry<[]>;
|
|
85
|
-
/**
|
|
86
|
-
* Prevent usage of `next/script` in `next/head` component.
|
|
87
|
-
* @see https://nextjs.org/docs/messages/no-script-component-in-head
|
|
88
|
-
*/
|
|
89
|
-
'@next/next/no-script-component-in-head'?: Linter.RuleEntry<[]>;
|
|
90
|
-
/**
|
|
91
|
-
* Prevent usage of `styled-jsx` in `pages/_document.js`.
|
|
92
|
-
* @see https://nextjs.org/docs/messages/no-styled-jsx-in-document
|
|
93
|
-
*/
|
|
94
|
-
'@next/next/no-styled-jsx-in-document'?: Linter.RuleEntry<[]>;
|
|
95
|
-
/**
|
|
96
|
-
* Prevent synchronous scripts.
|
|
97
|
-
* @see https://nextjs.org/docs/messages/no-sync-scripts
|
|
98
|
-
*/
|
|
99
|
-
'@next/next/no-sync-scripts'?: Linter.RuleEntry<[]>;
|
|
100
|
-
/**
|
|
101
|
-
* Prevent usage of `<title>` with `Head` component from `next/document`.
|
|
102
|
-
* @see https://nextjs.org/docs/messages/no-title-in-document-head
|
|
103
|
-
*/
|
|
104
|
-
'@next/next/no-title-in-document-head'?: Linter.RuleEntry<[]>;
|
|
105
|
-
/**
|
|
106
|
-
* Prevent common typos in Next.js data fetching functions.
|
|
107
|
-
*/
|
|
108
|
-
'@next/next/no-typos'?: Linter.RuleEntry<[]>;
|
|
109
|
-
/**
|
|
110
|
-
* Prevent duplicate polyfills from Polyfill.io.
|
|
111
|
-
* @see https://nextjs.org/docs/messages/no-unwanted-polyfillio
|
|
112
|
-
*/
|
|
113
|
-
'@next/next/no-unwanted-polyfillio'?: Linter.RuleEntry<[]>;
|
|
114
10
|
/**
|
|
115
11
|
* Enforce getter and setter pairs in objects and classes
|
|
116
12
|
* @see https://eslint.org/docs/latest/rules/accessor-pairs
|
|
@@ -1539,6 +1435,110 @@ interface RuleOptions {
|
|
|
1539
1435
|
* @deprecated
|
|
1540
1436
|
*/
|
|
1541
1437
|
'newline-per-chained-call'?: Linter.RuleEntry<NewlinePerChainedCall>;
|
|
1438
|
+
/**
|
|
1439
|
+
* Enforce font-display behavior with Google Fonts.
|
|
1440
|
+
* @see https://nextjs.org/docs/messages/google-font-display
|
|
1441
|
+
*/
|
|
1442
|
+
'next/google-font-display'?: Linter.RuleEntry<[]>;
|
|
1443
|
+
/**
|
|
1444
|
+
* Ensure `preconnect` is used with Google Fonts.
|
|
1445
|
+
* @see https://nextjs.org/docs/messages/google-font-preconnect
|
|
1446
|
+
*/
|
|
1447
|
+
'next/google-font-preconnect'?: Linter.RuleEntry<[]>;
|
|
1448
|
+
/**
|
|
1449
|
+
* Enforce `id` attribute on `next/script` components with inline content.
|
|
1450
|
+
* @see https://nextjs.org/docs/messages/inline-script-id
|
|
1451
|
+
*/
|
|
1452
|
+
'next/inline-script-id'?: Linter.RuleEntry<[]>;
|
|
1453
|
+
/**
|
|
1454
|
+
* Prefer `next/script` component when using the inline script for Google Analytics.
|
|
1455
|
+
* @see https://nextjs.org/docs/messages/next-script-for-ga
|
|
1456
|
+
*/
|
|
1457
|
+
'next/next-script-for-ga'?: Linter.RuleEntry<[]>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Prevent assignment to the `module` variable.
|
|
1460
|
+
* @see https://nextjs.org/docs/messages/no-assign-module-variable
|
|
1461
|
+
*/
|
|
1462
|
+
'next/no-assign-module-variable'?: Linter.RuleEntry<[]>;
|
|
1463
|
+
/**
|
|
1464
|
+
* Prevent Client Components from being async functions.
|
|
1465
|
+
* @see https://nextjs.org/docs/messages/no-async-client-component
|
|
1466
|
+
*/
|
|
1467
|
+
'next/no-async-client-component'?: Linter.RuleEntry<[]>;
|
|
1468
|
+
/**
|
|
1469
|
+
* Prevent usage of `next/script`'s `beforeInteractive` strategy outside of `pages/_document.js`.
|
|
1470
|
+
* @see https://nextjs.org/docs/messages/no-before-interactive-script-outside-document
|
|
1471
|
+
*/
|
|
1472
|
+
'next/no-before-interactive-script-outside-document'?: Linter.RuleEntry<[]>;
|
|
1473
|
+
/**
|
|
1474
|
+
* Prevent manual stylesheet tags.
|
|
1475
|
+
* @see https://nextjs.org/docs/messages/no-css-tags
|
|
1476
|
+
*/
|
|
1477
|
+
'next/no-css-tags'?: Linter.RuleEntry<[]>;
|
|
1478
|
+
/**
|
|
1479
|
+
* Prevent importing `next/document` outside of `pages/_document.js`.
|
|
1480
|
+
* @see https://nextjs.org/docs/messages/no-document-import-in-page
|
|
1481
|
+
*/
|
|
1482
|
+
'next/no-document-import-in-page'?: Linter.RuleEntry<[]>;
|
|
1483
|
+
/**
|
|
1484
|
+
* Prevent duplicate usage of `<Head>` in `pages/_document.js`.
|
|
1485
|
+
* @see https://nextjs.org/docs/messages/no-duplicate-head
|
|
1486
|
+
*/
|
|
1487
|
+
'next/no-duplicate-head'?: Linter.RuleEntry<[]>;
|
|
1488
|
+
/**
|
|
1489
|
+
* Prevent usage of `<head>` element.
|
|
1490
|
+
* @see https://nextjs.org/docs/messages/no-head-element
|
|
1491
|
+
*/
|
|
1492
|
+
'next/no-head-element'?: Linter.RuleEntry<[]>;
|
|
1493
|
+
/**
|
|
1494
|
+
* Prevent usage of `next/head` in `pages/_document.js`.
|
|
1495
|
+
* @see https://nextjs.org/docs/messages/no-head-import-in-document
|
|
1496
|
+
*/
|
|
1497
|
+
'next/no-head-import-in-document'?: Linter.RuleEntry<[]>;
|
|
1498
|
+
/**
|
|
1499
|
+
* Prevent usage of `<a>` elements to navigate to internal Next.js pages.
|
|
1500
|
+
* @see https://nextjs.org/docs/messages/no-html-link-for-pages
|
|
1501
|
+
*/
|
|
1502
|
+
'next/no-html-link-for-pages'?: Linter.RuleEntry<NextNoHtmlLinkForPages>;
|
|
1503
|
+
/**
|
|
1504
|
+
* Prevent usage of `<img>` element due to slower LCP and higher bandwidth.
|
|
1505
|
+
* @see https://nextjs.org/docs/messages/no-img-element
|
|
1506
|
+
*/
|
|
1507
|
+
'next/no-img-element'?: Linter.RuleEntry<[]>;
|
|
1508
|
+
/**
|
|
1509
|
+
* Prevent page-only custom fonts.
|
|
1510
|
+
* @see https://nextjs.org/docs/messages/no-page-custom-font
|
|
1511
|
+
*/
|
|
1512
|
+
'next/no-page-custom-font'?: Linter.RuleEntry<[]>;
|
|
1513
|
+
/**
|
|
1514
|
+
* Prevent usage of `next/script` in `next/head` component.
|
|
1515
|
+
* @see https://nextjs.org/docs/messages/no-script-component-in-head
|
|
1516
|
+
*/
|
|
1517
|
+
'next/no-script-component-in-head'?: Linter.RuleEntry<[]>;
|
|
1518
|
+
/**
|
|
1519
|
+
* Prevent usage of `styled-jsx` in `pages/_document.js`.
|
|
1520
|
+
* @see https://nextjs.org/docs/messages/no-styled-jsx-in-document
|
|
1521
|
+
*/
|
|
1522
|
+
'next/no-styled-jsx-in-document'?: Linter.RuleEntry<[]>;
|
|
1523
|
+
/**
|
|
1524
|
+
* Prevent synchronous scripts.
|
|
1525
|
+
* @see https://nextjs.org/docs/messages/no-sync-scripts
|
|
1526
|
+
*/
|
|
1527
|
+
'next/no-sync-scripts'?: Linter.RuleEntry<[]>;
|
|
1528
|
+
/**
|
|
1529
|
+
* Prevent usage of `<title>` with `Head` component from `next/document`.
|
|
1530
|
+
* @see https://nextjs.org/docs/messages/no-title-in-document-head
|
|
1531
|
+
*/
|
|
1532
|
+
'next/no-title-in-document-head'?: Linter.RuleEntry<[]>;
|
|
1533
|
+
/**
|
|
1534
|
+
* Prevent common typos in Next.js data fetching functions.
|
|
1535
|
+
*/
|
|
1536
|
+
'next/no-typos'?: Linter.RuleEntry<[]>;
|
|
1537
|
+
/**
|
|
1538
|
+
* Prevent duplicate polyfills from Polyfill.io.
|
|
1539
|
+
* @see https://nextjs.org/docs/messages/no-unwanted-polyfillio
|
|
1540
|
+
*/
|
|
1541
|
+
'next/no-unwanted-polyfillio'?: Linter.RuleEntry<[]>;
|
|
1542
1542
|
/**
|
|
1543
1543
|
* Disallow the use of `alert`, `confirm`, and `prompt`
|
|
1544
1544
|
* @see https://eslint.org/docs/latest/rules/no-alert
|
|
@@ -8084,8 +8084,6 @@ interface RuleOptions {
|
|
|
8084
8084
|
}
|
|
8085
8085
|
|
|
8086
8086
|
/* ======= Declarations ======= */
|
|
8087
|
-
// ----- @next/next/no-html-link-for-pages -----
|
|
8088
|
-
type NextNextNoHtmlLinkForPages = [] | [(string | string[])];
|
|
8089
8087
|
// ----- accessor-pairs -----
|
|
8090
8088
|
type AccessorPairs = [] | [{
|
|
8091
8089
|
getWithoutSet?: boolean;
|
|
@@ -9751,6 +9749,8 @@ type NewlineAfterVar = [] | [("never" | "always")];
|
|
|
9751
9749
|
type NewlinePerChainedCall = [] | [{
|
|
9752
9750
|
ignoreChainWithDepth?: number;
|
|
9753
9751
|
}];
|
|
9752
|
+
// ----- next/no-html-link-for-pages -----
|
|
9753
|
+
type NextNoHtmlLinkForPages = [] | [(string | string[])];
|
|
9754
9754
|
// ----- no-bitwise -----
|
|
9755
9755
|
type NoBitwise = [] | [{
|
|
9756
9756
|
allow?: ("^" | "|" | "&" | "<<" | ">>" | ">>>" | "^=" | "|=" | "&=" | "<<=" | ">>=" | ">>>=" | "~")[];
|
|
@@ -16750,7 +16750,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
16750
16750
|
onlyEquality?: boolean;
|
|
16751
16751
|
}];
|
|
16752
16752
|
// Names of all the configs
|
|
16753
|
-
type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/eslint-comments/rules' | 'antfu/formatter/setup' | 'antfu/imports/rules' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/jsx/setup' | 'antfu/jsdoc/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/node/rules' | 'antfu/perfectionist/setup' | 'antfu/nextjs/setup' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/sort/package-json' | 'antfu/stylistic/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/regexp/rules' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/rules' | 'antfu/unicorn/rules' | 'antfu/unocss' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/yaml/pnpm-workspace';
|
|
16753
|
+
type ConfigNames = 'antfu/astro/setup' | 'antfu/astro/rules' | 'antfu/eslint-comments/rules' | 'antfu/formatter/setup' | 'antfu/imports/rules' | 'antfu/javascript/setup' | 'antfu/javascript/rules' | 'antfu/jsx/setup' | 'antfu/jsdoc/rules' | 'antfu/jsonc/setup' | 'antfu/jsonc/rules' | 'antfu/markdown/setup' | 'antfu/markdown/processor' | 'antfu/markdown/parser' | 'antfu/markdown/disables' | 'antfu/node/rules' | 'antfu/perfectionist/setup' | 'antfu/nextjs/setup' | 'antfu/nextjs/rules' | 'antfu/react/setup' | 'antfu/react/rules' | 'antfu/solid/setup' | 'antfu/solid/rules' | 'antfu/sort/package-json' | 'antfu/stylistic/rules' | 'antfu/svelte/setup' | 'antfu/svelte/rules' | 'antfu/test/setup' | 'antfu/test/rules' | 'antfu/toml/setup' | 'antfu/toml/rules' | 'antfu/regexp/rules' | 'antfu/typescript/setup' | 'antfu/typescript/parser' | 'antfu/typescript/rules' | 'antfu/unicorn/rules' | 'antfu/unocss' | 'antfu/vue/setup' | 'antfu/vue/rules' | 'antfu/yaml/setup' | 'antfu/yaml/rules' | 'antfu/yaml/pnpm-workspace';
|
|
16754
16754
|
//#endregion
|
|
16755
16755
|
//#region src/vender/prettier-types.d.ts
|
|
16756
16756
|
/**
|
|
@@ -16874,18 +16874,25 @@ interface VendoredPrettierOptionsRequired {
|
|
|
16874
16874
|
//#endregion
|
|
16875
16875
|
//#region src/types.d.ts
|
|
16876
16876
|
type Awaitable<T> = T | Promise<T>;
|
|
16877
|
-
|
|
16878
|
-
|
|
16877
|
+
type Rules = Record<string, Linter.RuleEntry<any> | undefined> & RuleOptions;
|
|
16878
|
+
/**
|
|
16879
|
+
* An updated version of ESLint's `Linter.Config`, which provides autocompletion
|
|
16880
|
+
* for `rules` and relaxes type limitations for `plugins` and `rules`, because
|
|
16881
|
+
* many plugins still lack proper type definitions.
|
|
16882
|
+
*/
|
|
16883
|
+
type TypedFlatConfigItem = Omit<Linter.Config, 'plugins' | 'rules'> & {
|
|
16879
16884
|
/**
|
|
16880
|
-
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
16885
|
+
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
16886
|
+
* When `files` is specified, these plugins are only available to the matching files.
|
|
16881
16887
|
*
|
|
16882
16888
|
* @see [Using plugins in your configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files-new#using-plugins-in-your-configuration)
|
|
16883
16889
|
*/
|
|
16884
16890
|
plugins?: Record<string, any>;
|
|
16885
16891
|
/**
|
|
16886
|
-
*
|
|
16892
|
+
* An object containing the configured rules. When `files` or `ignores` are
|
|
16893
|
+
* specified, these rule configurations are only available to the matching files.
|
|
16887
16894
|
*/
|
|
16888
|
-
rules?:
|
|
16895
|
+
rules?: Rules;
|
|
16889
16896
|
};
|
|
16890
16897
|
interface OptionsFiles {
|
|
16891
16898
|
/**
|
|
@@ -17285,6 +17292,7 @@ declare const defaultPluginRenaming: {
|
|
|
17285
17292
|
'@eslint-react/dom': string;
|
|
17286
17293
|
'@eslint-react/hooks-extra': string;
|
|
17287
17294
|
'@eslint-react/naming-convention': string;
|
|
17295
|
+
'@next/next': string;
|
|
17288
17296
|
'@stylistic': string;
|
|
17289
17297
|
'@typescript-eslint': string;
|
|
17290
17298
|
'import-lite': string;
|
package/dist/index.js
CHANGED
|
@@ -977,13 +977,14 @@ async function nextjs(options = {}) {
|
|
|
977
977
|
const pluginNextJS = await interopDefault(import("@next/eslint-plugin-next"));
|
|
978
978
|
return [{
|
|
979
979
|
name: "antfu/nextjs/setup",
|
|
980
|
-
plugins: {
|
|
980
|
+
plugins: { next: pluginNextJS }
|
|
981
981
|
}, {
|
|
982
982
|
files,
|
|
983
983
|
languageOptions: {
|
|
984
984
|
parserOptions: { ecmaFeatures: { jsx: true } },
|
|
985
985
|
sourceType: "module"
|
|
986
986
|
},
|
|
987
|
+
name: "antfu/nextjs/rules",
|
|
987
988
|
rules: {
|
|
988
989
|
...normalizeRules(pluginNextJS.configs.recommended.rules),
|
|
989
990
|
...normalizeRules(pluginNextJS.configs["core-web-vitals"].rules),
|
|
@@ -2190,6 +2191,7 @@ const defaultPluginRenaming = {
|
|
|
2190
2191
|
"@eslint-react/dom": "react-dom",
|
|
2191
2192
|
"@eslint-react/hooks-extra": "react-hooks-extra",
|
|
2192
2193
|
"@eslint-react/naming-convention": "react-naming-convention",
|
|
2194
|
+
"@next/next": "next",
|
|
2193
2195
|
"@stylistic": "style",
|
|
2194
2196
|
"@typescript-eslint": "ts",
|
|
2195
2197
|
"import-lite": "import",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@antfu/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"description": "Anthony's ESLint config",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com> (https://github.com/antfu/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"@antfu/ni": "^25.0.0",
|
|
135
135
|
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
136
136
|
"@eslint/config-inspector": "^1.1.0",
|
|
137
|
-
"@next/eslint-plugin-next": "^15.4.
|
|
137
|
+
"@next/eslint-plugin-next": "^15.4.4",
|
|
138
138
|
"@prettier/plugin-xml": "^3.4.2",
|
|
139
139
|
"@types/node": "^24.1.0",
|
|
140
140
|
"@unocss/eslint-plugin": "^66.3.3",
|
|
@@ -148,15 +148,15 @@
|
|
|
148
148
|
"eslint-plugin-solid": "^0.14.5",
|
|
149
149
|
"eslint-plugin-svelte": "^3.11.0",
|
|
150
150
|
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
151
|
-
"eslint-typegen": "^2.
|
|
151
|
+
"eslint-typegen": "^2.3.0",
|
|
152
152
|
"execa": "^9.6.0",
|
|
153
|
-
"jiti": "^2.5.
|
|
153
|
+
"jiti": "^2.5.1",
|
|
154
154
|
"lint-staged": "^16.1.2",
|
|
155
155
|
"pnpm-workspace-yaml": "^1.1.0",
|
|
156
156
|
"prettier-plugin-astro": "^0.14.1",
|
|
157
157
|
"prettier-plugin-slidev": "^1.0.5",
|
|
158
158
|
"simple-git-hooks": "^2.13.0",
|
|
159
|
-
"svelte": "^5.36.
|
|
159
|
+
"svelte": "^5.36.16",
|
|
160
160
|
"svelte-eslint-parser": "^1.3.0",
|
|
161
161
|
"tinyglobby": "^0.2.14",
|
|
162
162
|
"tsdown": "^0.13.0",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"typescript": "^5.8.3",
|
|
165
165
|
"vitest": "^3.2.4",
|
|
166
166
|
"vue": "^3.5.18",
|
|
167
|
-
"@antfu/eslint-config": "
|
|
167
|
+
"@antfu/eslint-config": "5.0.0"
|
|
168
168
|
},
|
|
169
169
|
"resolutions": {
|
|
170
170
|
"eslint": "catalog:peer"
|