@ntnyq/eslint-config 4.0.0-beta.10 → 4.0.0-beta.11
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 +37 -4
- package/dist/index.d.ts +35 -24
- package/dist/index.js +49 -29
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -19,10 +19,22 @@
|
|
|
19
19
|
|
|
20
20
|
## Install
|
|
21
21
|
|
|
22
|
+
```shell
|
|
23
|
+
npm i eslint typescript @ntnyq/eslint-config -D
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```shell
|
|
27
|
+
yarn add eslint typescript @ntnyq/eslint-config -D
|
|
28
|
+
```
|
|
29
|
+
|
|
22
30
|
```shell
|
|
23
31
|
pnpm add eslint typescript @ntnyq/eslint-config -D
|
|
24
32
|
```
|
|
25
33
|
|
|
34
|
+
```shell
|
|
35
|
+
bun add eslint typescript @ntnyq/eslint-config -D
|
|
36
|
+
```
|
|
37
|
+
|
|
26
38
|
## Usage
|
|
27
39
|
|
|
28
40
|
Highly recommended using **`eslint.config.mjs`** as the config file :
|
|
@@ -40,8 +52,8 @@ Add scripts `lint` in `package.json`:
|
|
|
40
52
|
```json
|
|
41
53
|
{
|
|
42
54
|
"scripts": {
|
|
43
|
-
"lint": "eslint
|
|
44
|
-
"lint:fix": "eslint
|
|
55
|
+
"lint": "eslint",
|
|
56
|
+
"lint:fix": "eslint --fix"
|
|
45
57
|
}
|
|
46
58
|
}
|
|
47
59
|
```
|
|
@@ -55,10 +67,22 @@ Add scripts `lint` in `package.json`:
|
|
|
55
67
|
|
|
56
68
|
Install `prettier` and setup your prettier config:
|
|
57
69
|
|
|
70
|
+
```shell
|
|
71
|
+
npm i prettier @ntnyq/prettier-config -D
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```shell
|
|
75
|
+
yarn add prettier @ntnyq/prettier-config -D
|
|
76
|
+
```
|
|
77
|
+
|
|
58
78
|
```shell
|
|
59
79
|
pnpm add prettier @ntnyq/prettier-config -D
|
|
60
80
|
```
|
|
61
81
|
|
|
82
|
+
```shell
|
|
83
|
+
bun add prettier @ntnyq/prettier-config -D
|
|
84
|
+
```
|
|
85
|
+
|
|
62
86
|
```js
|
|
63
87
|
// prettier.config.mjs
|
|
64
88
|
// @ts-check
|
|
@@ -132,7 +156,7 @@ pnpm add husky nano-staged -D
|
|
|
132
156
|
"prepare": "husky"
|
|
133
157
|
},
|
|
134
158
|
"nano-staged": {
|
|
135
|
-
"*.{js,ts,cjs,mjs,jsx,tsx,vue,md,svg,
|
|
159
|
+
"*.{js,ts,cjs,mjs,jsx,tsx,vue,md,svg,yml,yaml,toml,json}": "eslint --fix",
|
|
136
160
|
"*.{css,scss,html}": "prettier -uw"
|
|
137
161
|
}
|
|
138
162
|
}
|
|
@@ -156,7 +180,16 @@ Check for detail in:
|
|
|
156
180
|
### Config interface
|
|
157
181
|
|
|
158
182
|
```ts
|
|
159
|
-
export interface ConfigOptions
|
|
183
|
+
export interface ConfigOptions {
|
|
184
|
+
/**
|
|
185
|
+
* Shareable options
|
|
186
|
+
*/
|
|
187
|
+
shareable?: OptionsShareable
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Configs enabled by default
|
|
191
|
+
* @pg
|
|
192
|
+
*/
|
|
160
193
|
command?: ConfigCommandOptions
|
|
161
194
|
eslintComments?: ConfigESLintCommentsOptions
|
|
162
195
|
ignores?: ConfigIgnoresOptions
|
package/dist/index.d.ts
CHANGED
|
@@ -22,8 +22,8 @@ export { default as pluginMarkdown } from '@eslint/markdown';
|
|
|
22
22
|
export { default as pluginAntfu } from 'eslint-plugin-antfu';
|
|
23
23
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
24
24
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
25
|
-
export { default as pluginPinia } from 'eslint-plugin-pinia';
|
|
26
25
|
export { default as pluginNtnyq } from 'eslint-plugin-ntnyq';
|
|
26
|
+
export { default as pluginPinia } from 'eslint-plugin-pinia';
|
|
27
27
|
export { default as pluginFormat } from 'eslint-plugin-format';
|
|
28
28
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
29
29
|
export { default as pluginVitest } from '@vitest/eslint-plugin';
|
|
@@ -72,7 +72,7 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
|
72
72
|
/**
|
|
73
73
|
* Options type of {@link configVue}
|
|
74
74
|
*/
|
|
75
|
-
|
|
75
|
+
type ConfigVueOptions = OptionsFiles & OptionsOverrides & OptionsShareable & {
|
|
76
76
|
/**
|
|
77
77
|
* Create virtual files for Vue SFC blocks to enable linting.
|
|
78
78
|
*
|
|
@@ -81,7 +81,7 @@ interface ConfigVueOptions extends OptionsFeatures, OptionsFiles, OptionsOverrid
|
|
|
81
81
|
* @default true
|
|
82
82
|
*/
|
|
83
83
|
sfcBlocks?: boolean | Options;
|
|
84
|
-
}
|
|
84
|
+
};
|
|
85
85
|
/**
|
|
86
86
|
* Config for vue files
|
|
87
87
|
*
|
|
@@ -227,7 +227,7 @@ declare const configAntfu: (options?: ConfigAntfuOptions) => TypedConfigItem[];
|
|
|
227
227
|
/**
|
|
228
228
|
* Options type of {@link configJsdoc}
|
|
229
229
|
*/
|
|
230
|
-
type ConfigJsdocOptions =
|
|
230
|
+
type ConfigJsdocOptions = Pick<OptionsShareable, 'typescript'> & OptionsOverrides;
|
|
231
231
|
/**
|
|
232
232
|
* Config for jsdoc
|
|
233
233
|
*
|
|
@@ -411,7 +411,7 @@ declare const configIgnores: (customIgnores?: ConfigIgnoresOptions) => TypedConf
|
|
|
411
411
|
/**
|
|
412
412
|
* Options type of {@link configImportX}
|
|
413
413
|
*/
|
|
414
|
-
type ConfigImportXOptions =
|
|
414
|
+
type ConfigImportXOptions = Pick<OptionsShareable, 'typescript'> & OptionsOverrides & {
|
|
415
415
|
/**
|
|
416
416
|
* Use [eslint-import-resolver-typescript](https://github.com/import-js/eslint-import-resolver-typescript) if `typescript` is installed
|
|
417
417
|
*
|
|
@@ -460,7 +460,7 @@ declare const configDeMorgan: (options?: ConfigDeMorganOptions) => TypedConfigIt
|
|
|
460
460
|
/**
|
|
461
461
|
* Options type of {@link configMarkdown}
|
|
462
462
|
*/
|
|
463
|
-
type ConfigMarkdownOptions =
|
|
463
|
+
type ConfigMarkdownOptions = OptionsFiles & OptionsOverrides & Pick<OptionsShareable, 'extraFileExtensions'>;
|
|
464
464
|
/**
|
|
465
465
|
* Config for markdown files
|
|
466
466
|
*
|
|
@@ -594,7 +594,7 @@ declare const configJSX: () => TypedConfigItem[];
|
|
|
594
594
|
/**
|
|
595
595
|
* Options type of {@link configTypeScript}
|
|
596
596
|
*/
|
|
597
|
-
type ConfigTypeScriptOptions =
|
|
597
|
+
type ConfigTypeScriptOptions = OptionsFiles & OptionsOverrides & Pick<OptionsShareable, 'extraFileExtensions'> & {
|
|
598
598
|
/**
|
|
599
599
|
* Glob patterns for files that should be type aware.
|
|
600
600
|
* @default ['**\/*.{ts,tsx}']
|
|
@@ -15535,21 +15535,6 @@ type TypedConfigItem = Omit<Linter.Config<ESLintRulesRecord & RuleOptions>, 'plu
|
|
|
15535
15535
|
plugins?: Record<string, any>;
|
|
15536
15536
|
};
|
|
15537
15537
|
|
|
15538
|
-
/**
|
|
15539
|
-
* Options for add `extensions` support
|
|
15540
|
-
*/
|
|
15541
|
-
interface OptionsExtensions {
|
|
15542
|
-
extensions?: string[];
|
|
15543
|
-
}
|
|
15544
|
-
/**
|
|
15545
|
-
* Options for add `features` support
|
|
15546
|
-
*/
|
|
15547
|
-
type OptionsFeatures = {
|
|
15548
|
-
/**
|
|
15549
|
-
* Enable typescript support
|
|
15550
|
-
*/
|
|
15551
|
-
typescript?: boolean;
|
|
15552
|
-
};
|
|
15553
15538
|
/**
|
|
15554
15539
|
* Options for overrides `files`
|
|
15555
15540
|
*/
|
|
@@ -15568,6 +15553,20 @@ interface OptionsIgnores {
|
|
|
15568
15553
|
interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigItem['rules']> {
|
|
15569
15554
|
overrides?: Rules;
|
|
15570
15555
|
}
|
|
15556
|
+
/**
|
|
15557
|
+
* Options for shareable cross plugins
|
|
15558
|
+
*/
|
|
15559
|
+
interface OptionsShareable {
|
|
15560
|
+
/**
|
|
15561
|
+
* @see {@link https://typescript-eslint.io/packages/parser/#extrafileextensions}
|
|
15562
|
+
*/
|
|
15563
|
+
extraFileExtensions?: string[];
|
|
15564
|
+
/**
|
|
15565
|
+
* Enable typescript support
|
|
15566
|
+
* @default false
|
|
15567
|
+
*/
|
|
15568
|
+
typescript?: boolean;
|
|
15569
|
+
}
|
|
15571
15570
|
|
|
15572
15571
|
/**
|
|
15573
15572
|
* @file Config options
|
|
@@ -15576,7 +15575,15 @@ interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigI
|
|
|
15576
15575
|
/**
|
|
15577
15576
|
* Config factory options
|
|
15578
15577
|
*/
|
|
15579
|
-
interface ConfigOptions
|
|
15578
|
+
interface ConfigOptions {
|
|
15579
|
+
/**
|
|
15580
|
+
* Shareable options
|
|
15581
|
+
*/
|
|
15582
|
+
shareable?: OptionsShareable;
|
|
15583
|
+
/**
|
|
15584
|
+
* Configs enabled by default
|
|
15585
|
+
* @pg
|
|
15586
|
+
*/
|
|
15580
15587
|
command?: ConfigCommandOptions;
|
|
15581
15588
|
eslintComments?: ConfigESLintCommentsOptions;
|
|
15582
15589
|
ignores?: ConfigIgnoresOptions;
|
|
@@ -15744,6 +15751,10 @@ declare const PRETTIER_DEFAULT_OPTIONS: PrettierOptions;
|
|
|
15744
15751
|
* Shared perfectionist rule options for all rules
|
|
15745
15752
|
*/
|
|
15746
15753
|
declare const PERFECTIONIST_COMMON_RULE_OPTIONS: {
|
|
15754
|
+
readonly fallbackSort: {
|
|
15755
|
+
readonly order: "asc";
|
|
15756
|
+
readonly type: "alphabetical";
|
|
15757
|
+
};
|
|
15747
15758
|
readonly ignoreCase: true;
|
|
15748
15759
|
readonly order: "asc";
|
|
15749
15760
|
readonly type: "alphabetical";
|
|
@@ -15796,4 +15807,4 @@ declare const PERFECTIONIST_SORT_IMPORTS_GROUPS: string[];
|
|
|
15796
15807
|
*/
|
|
15797
15808
|
declare const PERFECTIONIST_SORT_CLASSES_GROUPS: string[];
|
|
15798
15809
|
|
|
15799
|
-
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigDeMorganOptions, type ConfigDependOptions, type ConfigESLintCommentsOptions, type ConfigESLintPluginOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigOptionsInternal, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSVGOOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, type ESLintRulesRecord, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type
|
|
15810
|
+
export { type Arrayable, type Awaitable, type ConfigAntfuOptions, type ConfigCommandOptions, type ConfigDeMorganOptions, type ConfigDependOptions, type ConfigESLintCommentsOptions, type ConfigESLintPluginOptions, type ConfigFormatOptions, type ConfigGitHubActionOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportXOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigNames, type ConfigNodeOptions, type ConfigNtnyqOptions, type ConfigOptions, type ConfigOptionsInternal, type ConfigPerfectionistOptions, type ConfigPiniaOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigSVGOOptions, type ConfigSortOptions, type ConfigSpecialsOptions, type ConfigTestOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVueOptions, type ConfigYmlOptions, type ESLintConfig, type ESLintParser, type ESLintParserOptions, type ESLintProcessor, type ESLintRuleSeverity, type ESLintRulesRecord, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsFiles, type OptionsIgnores, type OptionsOverrides, type OptionsShareable, PERFECTIONIST_COMMON_RULE_OPTIONS, PERFECTIONIST_EXTRA_RULE_OPTIONS, PERFECTIONIST_SORT_CLASSES_GROUPS, PERFECTIONIST_SORT_IMPORTS_GROUPS, PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS, PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS, PERFECTIONIST_SORT_OBJECTS_GROUPS, PRETTIER_DEFAULT_OPTIONS, type PerfectionistPartitionByComment, type PrettierOptions, type Pretty, type ResolvedOptions, type RuleOptions, type TSESLintParserOptions, type TypedConfigItem, combineConfigs, configAntfu, configCommand, configDeMorgan, configDepend, configESLintComments, configESLintPlugin, configFormat, configGitHubAction, configGitIgnore, configIgnores, configImportX, configJSX, configJavaScript, configJsdoc, configJsonc, configMarkdown, configNode, configNtnyq, configPerfectionist, configPinia, configPrettier, configRegexp, configSVGO, configSort, configSpecials, configTest, configToml, configTypeScript, configUnicorn, configUnoCSS, configUnusedImports, configVue, configYml, createNodeResolver, defineESLintConfig, ensurePackages, getOverrides, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, interopDefault, isInGitHooksOrRunByNanoStagedOrRunByTSX, mergePrettierOptions, parserPlain, resolveSubOptions, toArray };
|
package/dist/index.js
CHANGED
|
@@ -46,8 +46,8 @@ import { default as default7 } from "@eslint/markdown";
|
|
|
46
46
|
import { default as default8 } from "eslint-plugin-antfu";
|
|
47
47
|
import { default as default9 } from "eslint-plugin-jsdoc";
|
|
48
48
|
import { default as default10 } from "eslint-plugin-jsonc";
|
|
49
|
-
import { default as default11 } from "eslint-plugin-
|
|
50
|
-
import { default as default12 } from "eslint-plugin-
|
|
49
|
+
import { default as default11 } from "eslint-plugin-ntnyq";
|
|
50
|
+
import { default as default12 } from "eslint-plugin-pinia";
|
|
51
51
|
import { default as default13 } from "eslint-plugin-format";
|
|
52
52
|
import { plugin } from "typescript-eslint";
|
|
53
53
|
import { default as default14 } from "@unocss/eslint-plugin";
|
|
@@ -389,7 +389,10 @@ var unCategorizedRules = {
|
|
|
389
389
|
"vue/valid-define-options": "error"
|
|
390
390
|
};
|
|
391
391
|
var configVue = (options = {}) => {
|
|
392
|
-
const {
|
|
392
|
+
const {
|
|
393
|
+
files = [GLOB_VUE],
|
|
394
|
+
extraFileExtensions = []
|
|
395
|
+
} = options;
|
|
393
396
|
const sfcBlocks = options.sfcBlocks === true ? {} : options.sfcBlocks ?? {};
|
|
394
397
|
function getVueProcessor() {
|
|
395
398
|
const processorVueSFC = default3.processors[".vue"];
|
|
@@ -421,7 +424,7 @@ var configVue = (options = {}) => {
|
|
|
421
424
|
parser: parserVue,
|
|
422
425
|
parserOptions: {
|
|
423
426
|
ecmaVersion: "latest",
|
|
424
|
-
extraFileExtensions
|
|
427
|
+
extraFileExtensions,
|
|
425
428
|
parser,
|
|
426
429
|
sourceType: "module",
|
|
427
430
|
ecmaFeatures: {
|
|
@@ -510,6 +513,8 @@ var configVue = (options = {}) => {
|
|
|
510
513
|
"inheritAttrs",
|
|
511
514
|
"model",
|
|
512
515
|
["props", "propsData"],
|
|
516
|
+
"slots",
|
|
517
|
+
"expose",
|
|
513
518
|
"emits",
|
|
514
519
|
"setup",
|
|
515
520
|
"asyncData",
|
|
@@ -658,6 +663,8 @@ var configSort = (options = {}) => {
|
|
|
658
663
|
"resolveJsonModule",
|
|
659
664
|
"allowArbitraryExtensions",
|
|
660
665
|
"noResolve",
|
|
666
|
+
"erasableSyntaxOnly",
|
|
667
|
+
"libReplacement",
|
|
661
668
|
/* JavaScript Support */
|
|
662
669
|
"allowJs",
|
|
663
670
|
"checkJs",
|
|
@@ -687,6 +694,7 @@ var configSort = (options = {}) => {
|
|
|
687
694
|
"declarationDir",
|
|
688
695
|
"preserveValueImports",
|
|
689
696
|
/* Interop Constraints */
|
|
697
|
+
"isolatedDeclarations",
|
|
690
698
|
"isolatedModules",
|
|
691
699
|
"verbatimModuleSyntax",
|
|
692
700
|
"allowSyntheticDefaultImports",
|
|
@@ -715,8 +723,17 @@ var configSort = (options = {}) => {
|
|
|
715
723
|
"useUnknownInCatchVariables",
|
|
716
724
|
/* Completeness */
|
|
717
725
|
"skipDefaultLibCheck",
|
|
718
|
-
"skipLibCheck"
|
|
726
|
+
"skipLibCheck",
|
|
727
|
+
{
|
|
728
|
+
order: {
|
|
729
|
+
type: "asc"
|
|
730
|
+
}
|
|
731
|
+
}
|
|
719
732
|
]
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
order: { type: "asc" },
|
|
736
|
+
pathPattern: "^vueCompilerOptions$"
|
|
720
737
|
}
|
|
721
738
|
]
|
|
722
739
|
}
|
|
@@ -837,7 +854,12 @@ var configSort = (options = {}) => {
|
|
|
837
854
|
"prettier",
|
|
838
855
|
"nano-staged",
|
|
839
856
|
"lint-staged",
|
|
840
|
-
"eslintConfig"
|
|
857
|
+
"eslintConfig",
|
|
858
|
+
{
|
|
859
|
+
order: {
|
|
860
|
+
type: "asc"
|
|
861
|
+
}
|
|
862
|
+
}
|
|
841
863
|
]
|
|
842
864
|
},
|
|
843
865
|
{
|
|
@@ -1385,7 +1407,7 @@ var configNtnyq = (options = {}) => [
|
|
|
1385
1407
|
{
|
|
1386
1408
|
name: "ntnyq/ntnyq",
|
|
1387
1409
|
plugins: {
|
|
1388
|
-
ntnyq:
|
|
1410
|
+
ntnyq: default11
|
|
1389
1411
|
},
|
|
1390
1412
|
rules: {
|
|
1391
1413
|
"ntnyq/no-duplicate-exports": "error",
|
|
@@ -1404,7 +1426,7 @@ var configPinia = (options = {}) => {
|
|
|
1404
1426
|
name: "ntnyq/pinia",
|
|
1405
1427
|
files,
|
|
1406
1428
|
plugins: {
|
|
1407
|
-
pinia:
|
|
1429
|
+
pinia: default12
|
|
1408
1430
|
},
|
|
1409
1431
|
rules: {
|
|
1410
1432
|
"pinia/never-export-initialized-store": "error",
|
|
@@ -1498,7 +1520,7 @@ var PRETTIER_DEFAULT_OPTIONS = {
|
|
|
1498
1520
|
|
|
1499
1521
|
// src/constants/perfectionist.ts
|
|
1500
1522
|
var PERFECTIONIST_COMMON_RULE_OPTIONS = {
|
|
1501
|
-
|
|
1523
|
+
fallbackSort: { order: "asc", type: "alphabetical" },
|
|
1502
1524
|
ignoreCase: true,
|
|
1503
1525
|
order: "asc",
|
|
1504
1526
|
type: "alphabetical"
|
|
@@ -2016,10 +2038,7 @@ var configMarkdown = (options = {}) => {
|
|
|
2016
2038
|
* code block files
|
|
2017
2039
|
*/
|
|
2018
2040
|
files = [GLOB_MARKDOWN_CODE],
|
|
2019
|
-
|
|
2020
|
-
* other extensions
|
|
2021
|
-
*/
|
|
2022
|
-
extensions = []
|
|
2041
|
+
extraFileExtensions = []
|
|
2023
2042
|
} = options;
|
|
2024
2043
|
const configs2 = [
|
|
2025
2044
|
/**
|
|
@@ -2054,7 +2073,7 @@ var configMarkdown = (options = {}) => {
|
|
|
2054
2073
|
files: [
|
|
2055
2074
|
...files,
|
|
2056
2075
|
// more nested extensions to disable
|
|
2057
|
-
...
|
|
2076
|
+
...extraFileExtensions.map((ext) => `${GLOB_MARKDOWN}/**/*${ext}`)
|
|
2058
2077
|
],
|
|
2059
2078
|
languageOptions: {
|
|
2060
2079
|
parserOptions: {
|
|
@@ -2067,7 +2086,6 @@ var configMarkdown = (options = {}) => {
|
|
|
2067
2086
|
}
|
|
2068
2087
|
},
|
|
2069
2088
|
rules: {
|
|
2070
|
-
"@typescript-eslint/comma-dangle": "off",
|
|
2071
2089
|
"@typescript-eslint/consistent-type-imports": "off",
|
|
2072
2090
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
2073
2091
|
"@typescript-eslint/no-namespace": "off",
|
|
@@ -2567,7 +2585,7 @@ var recommendedRules = configs.recommended.reduce(
|
|
|
2567
2585
|
var configTypeScript = (options = {}) => {
|
|
2568
2586
|
const enableTypeAwareLint = !!options?.tsconfigPath;
|
|
2569
2587
|
const {
|
|
2570
|
-
|
|
2588
|
+
extraFileExtensions = [],
|
|
2571
2589
|
filesTypeAware = [GLOB_TS, GLOB_TSX],
|
|
2572
2590
|
ignoresTypeAware = [GLOB_ASTRO, `${GLOB_MARKDOWN}/**`],
|
|
2573
2591
|
overridesTypeAwareRules = {},
|
|
@@ -2576,12 +2594,12 @@ var configTypeScript = (options = {}) => {
|
|
|
2576
2594
|
const files = options.files ?? [
|
|
2577
2595
|
GLOB_TS,
|
|
2578
2596
|
GLOB_TSX,
|
|
2579
|
-
// Enable typescript in these
|
|
2580
|
-
...
|
|
2597
|
+
// Enable typescript in these files
|
|
2598
|
+
...extraFileExtensions.map((ext) => `**/*${ext}`)
|
|
2581
2599
|
];
|
|
2582
2600
|
function createParserConfig(enableTypeAware = false, files2 = [], ignores = []) {
|
|
2583
2601
|
const typescriptParserOptions = {
|
|
2584
|
-
extraFileExtensions
|
|
2602
|
+
extraFileExtensions,
|
|
2585
2603
|
sourceType: "module",
|
|
2586
2604
|
...enableTypeAware ? {
|
|
2587
2605
|
tsconfigRootDir: process4.cwd(),
|
|
@@ -3091,9 +3109,9 @@ var configESLintComments = (options = {}) => [
|
|
|
3091
3109
|
function defineESLintConfig(options = {}, ...userConfigs) {
|
|
3092
3110
|
const {
|
|
3093
3111
|
/**
|
|
3094
|
-
*
|
|
3112
|
+
* Shareable options
|
|
3095
3113
|
*/
|
|
3096
|
-
|
|
3114
|
+
shareable = {},
|
|
3097
3115
|
/**
|
|
3098
3116
|
* Conditional by deps
|
|
3099
3117
|
*/
|
|
@@ -3125,8 +3143,9 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3125
3143
|
eslintPlugin: enableESLintPlugin = false
|
|
3126
3144
|
} = options;
|
|
3127
3145
|
const configs2 = [];
|
|
3146
|
+
const { extraFileExtensions = [] } = shareable;
|
|
3128
3147
|
if (enableVue) {
|
|
3129
|
-
|
|
3148
|
+
extraFileExtensions.push(".vue");
|
|
3130
3149
|
}
|
|
3131
3150
|
if (enableGitIgnore) {
|
|
3132
3151
|
configs2.push(configGitIgnore(resolveSubOptions(options, "gitignore")));
|
|
@@ -3198,8 +3217,8 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3198
3217
|
configs2.push(
|
|
3199
3218
|
configTypeScript({
|
|
3200
3219
|
...resolveSubOptions(options, "typescript"),
|
|
3201
|
-
|
|
3202
|
-
|
|
3220
|
+
overrides: getOverrides(options, "typescript"),
|
|
3221
|
+
extraFileExtensions
|
|
3203
3222
|
})
|
|
3204
3223
|
);
|
|
3205
3224
|
}
|
|
@@ -3208,7 +3227,8 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3208
3227
|
configVue({
|
|
3209
3228
|
...resolveSubOptions(options, "vue"),
|
|
3210
3229
|
typescript: !!enableTypeScript,
|
|
3211
|
-
overrides: getOverrides(options, "vue")
|
|
3230
|
+
overrides: getOverrides(options, "vue"),
|
|
3231
|
+
extraFileExtensions
|
|
3212
3232
|
})
|
|
3213
3233
|
);
|
|
3214
3234
|
}
|
|
@@ -3258,8 +3278,8 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3258
3278
|
configs2.push(
|
|
3259
3279
|
configMarkdown({
|
|
3260
3280
|
...resolveSubOptions(options, "markdown"),
|
|
3261
|
-
|
|
3262
|
-
|
|
3281
|
+
overrides: getOverrides(options, "markdown"),
|
|
3282
|
+
extraFileExtensions
|
|
3263
3283
|
})
|
|
3264
3284
|
);
|
|
3265
3285
|
}
|
|
@@ -3432,9 +3452,9 @@ export {
|
|
|
3432
3452
|
default7 as pluginMarkdown,
|
|
3433
3453
|
default20 as pluginNoOnlyTests,
|
|
3434
3454
|
default2 as pluginNode,
|
|
3435
|
-
|
|
3455
|
+
default11 as pluginNtnyq,
|
|
3436
3456
|
default22 as pluginPerfectionist,
|
|
3437
|
-
|
|
3457
|
+
default12 as pluginPinia,
|
|
3438
3458
|
default18 as pluginPrettier,
|
|
3439
3459
|
pluginRegexp,
|
|
3440
3460
|
default5 as pluginSvgo,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.11",
|
|
5
5
|
"packageManager": "pnpm@10.5.2",
|
|
6
6
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"prettier": "^3.5.3",
|
|
104
104
|
"toml-eslint-parser": "^0.10.0",
|
|
105
105
|
"typescript-eslint": "^8.26.0",
|
|
106
|
-
"vue-eslint-parser": "^10.1.
|
|
106
|
+
"vue-eslint-parser": "^10.1.1",
|
|
107
107
|
"yaml-eslint-parser": "^1.3.0"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"shiki": "^3.1.0"
|
|
143
143
|
},
|
|
144
144
|
"nano-staged": {
|
|
145
|
-
"*.{js,ts,mjs,cjs,md,vue,svg,yml,yaml,json}": "eslint --fix",
|
|
145
|
+
"*.{js,ts,mjs,cjs,md,vue,svg,yml,yaml,toml,json}": "eslint --fix",
|
|
146
146
|
"*.{css,scss,html}": "prettier -uw"
|
|
147
147
|
}
|
|
148
148
|
}
|