@oliver139/eslint-config 2.9.0 → 3.1.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 +30 -10
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +10 -7
- package/dist/index.d.ts +1039 -212
- package/dist/index.js +68 -10
- package/package.json +44 -30
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
- Designed to work with TypeScript, JSX, Vue, JSON, YAML, Toml, Markdown, etc. Out-of-box.
|
|
12
12
|
- Opinionated, but [very customizable](#customization)
|
|
13
13
|
- [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
|
|
14
|
-
- Optional [React](#react), [Svelte](#svelte), [UnoCSS](#unocss), [Astro](#astro), [Solid](#solid) support
|
|
14
|
+
- Optional [React](#react), [Next.js](#nextjs), [Svelte](#svelte), [UnoCSS](#unocss), [Astro](#astro), [Solid](#solid) support
|
|
15
15
|
- Optional [formatters](#formatters) support for formatting CSS, HTML, XML, etc.
|
|
16
16
|
- **Style principle**: Minimal for reading, stable for diff, consistent
|
|
17
17
|
- Sorted imports, dangling commas
|
|
@@ -386,15 +386,16 @@ Check out the [configs](https://github.com/antfu/eslint-config/blob/main/src/con
|
|
|
386
386
|
|
|
387
387
|
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.
|
|
388
388
|
|
|
389
|
-
| New Prefix | Original Prefix | Source Plugin
|
|
390
|
-
| ---------- | ---------------------- |
|
|
391
|
-
| `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite)
|
|
392
|
-
| `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n)
|
|
393
|
-
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml)
|
|
394
|
-
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint)
|
|
395
|
-
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic)
|
|
396
|
-
| `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest)
|
|
397
|
-
| `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests)
|
|
389
|
+
| New Prefix | Original Prefix | Source Plugin |
|
|
390
|
+
| ---------- | ---------------------- | ----------------------------------------------------------------------------------------------------- |
|
|
391
|
+
| `import/*` | `import-lite/*` | [eslint-plugin-import-lite](https://github.com/9romise/eslint-plugin-import-lite) |
|
|
392
|
+
| `node/*` | `n/*` | [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n) |
|
|
393
|
+
| `yaml/*` | `yml/*` | [eslint-plugin-yml](https://github.com/ota-meshi/eslint-plugin-yml) |
|
|
394
|
+
| `ts/*` | `@typescript-eslint/*` | [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint) |
|
|
395
|
+
| `style/*` | `@stylistic/*` | [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic) |
|
|
396
|
+
| `test/*` | `vitest/*` | [@vitest/eslint-plugin](https://github.com/vitest-dev/eslint-plugin-vitest) |
|
|
397
|
+
| `test/*` | `no-only-tests/*` | [eslint-plugin-no-only-tests](https://github.com/levibuzolic/eslint-plugin-no-only-tests) |
|
|
398
|
+
| `next/*` | `@next/next` | [@next/eslint-plugin-next](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
|
|
398
399
|
|
|
399
400
|
When you want to override rules, or disable them inline, you need to update to the new prefix:
|
|
400
401
|
|
|
@@ -646,6 +647,25 @@ Running `npx eslint` should prompt you to install the required dependencies, oth
|
|
|
646
647
|
npm i -D @eslint-react/eslint-plugin eslint-plugin-react-hooks eslint-plugin-react-refresh
|
|
647
648
|
```
|
|
648
649
|
|
|
650
|
+
#### Next.js
|
|
651
|
+
|
|
652
|
+
To enable Next.js support, you need to explicitly turn it on:
|
|
653
|
+
|
|
654
|
+
```js
|
|
655
|
+
// eslint.config.js
|
|
656
|
+
import antfu from '@antfu/eslint-config'
|
|
657
|
+
|
|
658
|
+
export default antfu({
|
|
659
|
+
nextjs: true,
|
|
660
|
+
})
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:
|
|
664
|
+
|
|
665
|
+
```bash
|
|
666
|
+
npm i -D @next/eslint-plugin-next
|
|
667
|
+
```
|
|
668
|
+
|
|
649
669
|
#### Svelte
|
|
650
670
|
|
|
651
671
|
To enable svelte support, you need to explicitly turn it on:
|
package/dist/cli.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
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 = "3.1.0";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -104,6 +104,7 @@ const dependenciesMap = {
|
|
|
104
104
|
astro: ["eslint-plugin-astro", "astro-eslint-parser"],
|
|
105
105
|
formatter: ["eslint-plugin-format"],
|
|
106
106
|
formatterAstro: ["prettier-plugin-astro"],
|
|
107
|
+
nextjs: ["@next/eslint-plugin-next"],
|
|
107
108
|
react: [
|
|
108
109
|
"@eslint-react/eslint-plugin",
|
|
109
110
|
"eslint-plugin-react-hooks",
|
|
@@ -176,19 +177,20 @@ async function updateEslintFiles(result) {
|
|
|
176
177
|
//#endregion
|
|
177
178
|
//#region src/cli/constants-generated.ts
|
|
178
179
|
const versionsMap = {
|
|
179
|
-
"@eslint-react/eslint-plugin": "^1.52.
|
|
180
|
-
"@
|
|
180
|
+
"@eslint-react/eslint-plugin": "^1.52.3",
|
|
181
|
+
"@next/eslint-plugin-next": "^15.4.6",
|
|
182
|
+
"@unocss/eslint-plugin": "^66.4.2",
|
|
181
183
|
"astro-eslint-parser": "^1.2.2",
|
|
182
|
-
"eslint": "^9.
|
|
184
|
+
"eslint": "^9.33.0",
|
|
183
185
|
"eslint-plugin-astro": "^1.3.1",
|
|
184
186
|
"eslint-plugin-format": "^1.0.1",
|
|
185
187
|
"eslint-plugin-react-hooks": "^5.2.0",
|
|
186
188
|
"eslint-plugin-react-refresh": "^0.4.20",
|
|
187
189
|
"eslint-plugin-solid": "^0.14.5",
|
|
188
|
-
"eslint-plugin-svelte": "^3.
|
|
190
|
+
"eslint-plugin-svelte": "^3.11.0",
|
|
189
191
|
"prettier-plugin-astro": "^0.14.1",
|
|
190
192
|
"prettier-plugin-slidev": "^1.0.5",
|
|
191
|
-
"svelte-eslint-parser": "^1.
|
|
193
|
+
"svelte-eslint-parser": "^1.3.1"
|
|
192
194
|
};
|
|
193
195
|
|
|
194
196
|
//#endregion
|
|
@@ -339,4 +341,5 @@ cli.help();
|
|
|
339
341
|
cli.version(version);
|
|
340
342
|
cli.parse();
|
|
341
343
|
|
|
342
|
-
//#endregion
|
|
344
|
+
//#endregion
|
|
345
|
+
export { };
|