@ntnyq/eslint-config 6.1.1 → 6.1.2
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 -10
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +29 -25
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @ntnyq/eslint-config
|
|
2
2
|
|
|
3
|
-
> 🎨 ESLint config for JavaScript, TypeScript, Vue, JSON, Markdown, YAML, TOML, SVG and
|
|
3
|
+
> 🎨 ESLint config for JavaScript, TypeScript, Vue, JSON, Markdown, YAML, TOML, SVG, and more.
|
|
4
4
|
|
|
5
5
|
[](https://github.com/ntnyq/eslint-config/actions)
|
|
6
6
|
[](https://www.npmjs.com/package/@ntnyq/eslint-config/v/latest)
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
## ✨ Features
|
|
26
26
|
|
|
27
|
-
- ✅ Designed to work alongside
|
|
27
|
+
- ✅ Designed to work alongside formatters, e.g. [Prettier](https://prettier.io) or [oxfmt](https://oxc.rs/docs/guide/usage/formatter)
|
|
28
28
|
- 🎯 Opinionated: single quote, no semi, trailing comma, etc
|
|
29
29
|
- 🪄 Respect `.gitignore` via [eslint-config-flat-gitignore](https://github.com/antfu/eslint-config-flat-gitignore)
|
|
30
30
|
- 📦 Out-of-the-box support for TypeScript, Vue, JSON, Markdown, YAML, TOML, SVG, Astro, Svelte, etc
|
|
@@ -150,7 +150,7 @@ export default defineConfig({
|
|
|
150
150
|
})
|
|
151
151
|
```
|
|
152
152
|
|
|
153
|
-
## 💻
|
|
153
|
+
## 💻 VS Code config
|
|
154
154
|
|
|
155
155
|
```json
|
|
156
156
|
{
|
|
@@ -221,13 +221,6 @@ For details, see:
|
|
|
221
221
|
- [./src/types/config.ts](https://github.com/ntnyq/eslint-config/blob/main/src/types/config.ts)
|
|
222
222
|
- [./src/core.ts](https://github.com/ntnyq/eslint-config/blob/main/src/core.ts)
|
|
223
223
|
|
|
224
|
-
## ⚙️ Advanced config
|
|
225
|
-
|
|
226
|
-
For details, see:
|
|
227
|
-
|
|
228
|
-
- [./src/types/config.ts](https://github.com/ntnyq/eslint-config/blob/main/src/types/config.ts)
|
|
229
|
-
- [./src/core.ts](https://github.com/ntnyq/eslint-config/blob/main/src/core.ts)
|
|
230
|
-
|
|
231
224
|
### 📝 Config interface
|
|
232
225
|
|
|
233
226
|
```ts
|
|
@@ -283,6 +276,7 @@ export interface ConfigOptions {
|
|
|
283
276
|
svelte?: boolean | ConfigSvelteOptions
|
|
284
277
|
svgo?: boolean | ConfigSVGOOptions
|
|
285
278
|
eslintPlugin?: boolean | ConfigESLintPluginOptions
|
|
279
|
+
unusedImports?: boolean | ConfigUnusedImportsOptions
|
|
286
280
|
}
|
|
287
281
|
```
|
|
288
282
|
|
package/dist/index.d.mts
CHANGED
|
@@ -4347,7 +4347,7 @@ interface RuleOptions {
|
|
|
4347
4347
|
*/
|
|
4348
4348
|
'no-octal-escape'?: Linter.RuleEntry<[]>;
|
|
4349
4349
|
/**
|
|
4350
|
-
* disallow
|
|
4350
|
+
* disallow focused/only tests
|
|
4351
4351
|
* @see https://github.com/levibuzolic/eslint-plugin-no-only-tests
|
|
4352
4352
|
*/
|
|
4353
4353
|
'no-only-tests/no-only-tests'?: Linter.RuleEntry<NoOnlyTestsNoOnlyTests>;
|
|
@@ -12505,7 +12505,7 @@ type OxfmtOxfmt = [] | [{
|
|
|
12505
12505
|
separateTagGroups?: boolean;
|
|
12506
12506
|
});
|
|
12507
12507
|
jsxSingleQuote?: boolean;
|
|
12508
|
-
objectWrap?: ("preserve" | "collapse"
|
|
12508
|
+
objectWrap?: ("preserve" | "collapse");
|
|
12509
12509
|
printWidth?: number;
|
|
12510
12510
|
proseWrap?: ("always" | "never" | "preserve");
|
|
12511
12511
|
quoteProps?: ("as-needed" | "consistent" | "preserve");
|
|
@@ -12573,7 +12573,7 @@ type OxfmtOxfmt = [] | [{
|
|
|
12573
12573
|
separateTagGroups?: boolean;
|
|
12574
12574
|
});
|
|
12575
12575
|
jsxSingleQuote?: boolean;
|
|
12576
|
-
objectWrap?: ("preserve" | "collapse"
|
|
12576
|
+
objectWrap?: ("preserve" | "collapse");
|
|
12577
12577
|
printWidth?: number;
|
|
12578
12578
|
proseWrap?: ("always" | "never" | "preserve");
|
|
12579
12579
|
quoteProps?: ("as-needed" | "consistent" | "preserve");
|
|
@@ -17860,7 +17860,7 @@ type Yoda = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
17860
17860
|
exceptRange?: boolean;
|
|
17861
17861
|
onlyEquality?: boolean;
|
|
17862
17862
|
}]; // Names of all the configs
|
|
17863
|
-
type ConfigNames = 'ntnyq/gitignore' | 'ntnyq/ignores' | 'ntnyq/jsx' | 'ntnyq/node' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/import-x' | 'ntnyq/jsdoc' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/unicorn' | 'ntnyq/pinia' | 'ntnyq/de-morgan' | 'ntnyq/regexp' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/parser-type-aware' | 'ntnyq/ts/rules' | 'ntnyq/ts/rules/type-aware' | 'ntnyq/ts/types' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yml' | 'ntnyq/toml' | 'ntnyq/jsonc' | 'ntnyq/astro' | 'ntnyq/svelte' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/json-schema' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/test/setup' | 'ntnyq/test/base' | 'ntnyq/test/vitest' | 'ntnyq/unocss' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled' | 'ntnyq/antfu' | 'ntnyq/depend' | 'ntnyq/depend/package-json' | 'ntnyq/ntnyq' | 'ntnyq/github-action' | 'ntnyq/eslint-plugin' | 'ntnyq/pnpm/package-json' | 'ntnyq/pnpm/pnpm-workspace-yaml' | 'ntnyq/svgo' | 'ntnyq/html' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/bin' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/specials/shadcn-vue' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/oxfmt/
|
|
17863
|
+
type ConfigNames = 'ntnyq/gitignore' | 'ntnyq/ignores' | 'ntnyq/jsx' | 'ntnyq/node' | 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/import-x' | 'ntnyq/jsdoc' | 'ntnyq/perfectionist/common' | 'ntnyq/perfectionist/enums' | 'ntnyq/perfectionist/types' | 'ntnyq/perfectionist/constants' | 'ntnyq/unicorn' | 'ntnyq/pinia' | 'ntnyq/de-morgan' | 'ntnyq/regexp' | 'ntnyq/ts/setup' | 'ntnyq/ts/parser' | 'ntnyq/ts/parser-type-aware' | 'ntnyq/ts/rules' | 'ntnyq/ts/rules/type-aware' | 'ntnyq/ts/types' | 'ntnyq/vue/setup' | 'ntnyq/vue/rules' | 'ntnyq/yml' | 'ntnyq/toml' | 'ntnyq/jsonc' | 'ntnyq/astro' | 'ntnyq/svelte' | 'ntnyq/sort/tsconfig' | 'ntnyq/sort/package-json' | 'ntnyq/sort/i18n-locale/json' | 'ntnyq/sort/i18n-locale/yaml' | 'ntnyq/sort/json-schema' | 'ntnyq/sort/pnpm-workspace' | 'ntnyq/test/setup' | 'ntnyq/test/base' | 'ntnyq/test/vitest' | 'ntnyq/unocss' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/processor' | 'ntnyq/markdown/parser' | 'ntnyq/markdown/disabled' | 'ntnyq/antfu' | 'ntnyq/depend' | 'ntnyq/depend/package-json' | 'ntnyq/ntnyq' | 'ntnyq/github-action' | 'ntnyq/eslint-plugin' | 'ntnyq/pnpm/package-json' | 'ntnyq/pnpm/pnpm-workspace-yaml' | 'ntnyq/svgo' | 'ntnyq/html' | 'ntnyq/specials/scripts' | 'ntnyq/specials/cli' | 'ntnyq/specials/bin' | 'ntnyq/specials/userscript' | 'ntnyq/specials/config-file' | 'ntnyq/specials/shadcn-vue' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/oxfmt/without-parser' | 'ntnyq/oxfmt/with-parser';
|
|
17864
17864
|
//#endregion
|
|
17865
17865
|
//#region src/types/eslint.d.ts
|
|
17866
17866
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1562,32 +1562,36 @@ const configNtnyq = (options = {}) => [{
|
|
|
1562
1562
|
* @returns ESLint configs
|
|
1563
1563
|
*/
|
|
1564
1564
|
const configOxfmt = (options = {}) => {
|
|
1565
|
-
const { files
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
},
|
|
1580
|
-
{
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
ignores: [GLOB_SRC, GLOB_VUE],
|
|
1584
|
-
languageOptions: { parser: parserPlain },
|
|
1585
|
-
rules: {
|
|
1586
|
-
"oxfmt/oxfmt": "error",
|
|
1587
|
-
...options.overrides
|
|
1588
|
-
}
|
|
1565
|
+
const { files: filesWithoutParser = [
|
|
1566
|
+
GLOB_SRC,
|
|
1567
|
+
GLOB_VUE,
|
|
1568
|
+
GLOB_JSON,
|
|
1569
|
+
GLOB_JSON5,
|
|
1570
|
+
GLOB_JSONC,
|
|
1571
|
+
GLOB_YAML,
|
|
1572
|
+
GLOB_TOML,
|
|
1573
|
+
GLOB_MARKDOWN
|
|
1574
|
+
], ignores: ignoresWithoutParser = [], filesExtensions: filesWithParser = [GLOB_STYLE, GLOB_HTML] } = options;
|
|
1575
|
+
return [{
|
|
1576
|
+
name: "ntnyq/oxfmt/without-parser",
|
|
1577
|
+
files: filesWithoutParser,
|
|
1578
|
+
ignores: ignoresWithoutParser,
|
|
1579
|
+
plugins: { oxfmt: pluginOxfmt },
|
|
1580
|
+
rules: {
|
|
1581
|
+
"oxfmt/oxfmt": "error",
|
|
1582
|
+
...options.overrides
|
|
1589
1583
|
}
|
|
1590
|
-
|
|
1584
|
+
}, {
|
|
1585
|
+
name: "ntnyq/oxfmt/with-parser",
|
|
1586
|
+
files: filesWithParser,
|
|
1587
|
+
ignores: filesWithoutParser.flat(),
|
|
1588
|
+
plugins: { oxfmt: pluginOxfmt },
|
|
1589
|
+
languageOptions: { parser: parserPlain },
|
|
1590
|
+
rules: {
|
|
1591
|
+
"oxfmt/oxfmt": "error",
|
|
1592
|
+
...options.overrides
|
|
1593
|
+
}
|
|
1594
|
+
}];
|
|
1591
1595
|
};
|
|
1592
1596
|
//#endregion
|
|
1593
1597
|
//#region src/configs/pinia.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.1.
|
|
4
|
+
"version": "6.1.2",
|
|
5
5
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@antfu/install-pkg": "^1.1.0",
|
|
85
|
-
"@clack/prompts": "^1.
|
|
85
|
+
"@clack/prompts": "^1.3.0",
|
|
86
86
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.7.1",
|
|
87
87
|
"@eslint/js": "^10.0.1",
|
|
88
88
|
"@eslint/markdown": "^8.0.1",
|
|
@@ -102,9 +102,9 @@
|
|
|
102
102
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
103
103
|
"eslint-plugin-jsonc": "^3.1.2",
|
|
104
104
|
"eslint-plugin-n": "^17.24.0",
|
|
105
|
-
"eslint-plugin-no-only-tests": "^3.
|
|
105
|
+
"eslint-plugin-no-only-tests": "^3.4.0",
|
|
106
106
|
"eslint-plugin-ntnyq": "^0.14.0",
|
|
107
|
-
"eslint-plugin-oxfmt": "^0.
|
|
107
|
+
"eslint-plugin-oxfmt": "^0.5.1",
|
|
108
108
|
"eslint-plugin-perfectionist": "^5.9.0",
|
|
109
109
|
"eslint-plugin-pinia": "^0.4.2",
|
|
110
110
|
"eslint-plugin-prettier": "^5.5.5",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"@types/node": "^25.6.0",
|
|
128
128
|
"@typescript-eslint/types": "^8.59.1",
|
|
129
129
|
"@typescript-eslint/utils": "^8.59.1",
|
|
130
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
130
|
+
"@typescript/native-preview": "^7.0.0-dev.20260429.1",
|
|
131
131
|
"bumpp": "^11.0.1",
|
|
132
132
|
"consola": "^3.4.2",
|
|
133
133
|
"eslint": "^10.2.1",
|