@ntnyq/eslint-config 2.6.2 → 2.7.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/dist/index.cjs +41 -36
- package/dist/index.d.cts +34 -50
- package/dist/index.d.ts +34 -50
- package/dist/index.js +41 -30
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -90,12 +90,6 @@ __export(src_exports, {
|
|
|
90
90
|
pluginUnusedImports: () => import_eslint_plugin_unused_imports.default,
|
|
91
91
|
pluginVue: () => import_eslint_plugin_vue.default,
|
|
92
92
|
pluginYaml: () => import_eslint_plugin_yml.default,
|
|
93
|
-
presetAll: () => presetAll,
|
|
94
|
-
presetBasic: () => presetBasic,
|
|
95
|
-
presetCommon: () => presetCommon,
|
|
96
|
-
presetJavaScript: () => presetJavaScript,
|
|
97
|
-
presetJsonc: () => presetJsonc,
|
|
98
|
-
presetLanguageExtensions: () => presetLanguageExtensions,
|
|
99
93
|
prettier: () => prettier,
|
|
100
94
|
regexp: () => regexp,
|
|
101
95
|
sortPackageJson: () => sortPackageJson,
|
|
@@ -246,7 +240,7 @@ var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
|
246
240
|
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
247
241
|
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
248
242
|
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
249
|
-
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
243
|
+
var import_eslint_plugin_unused_imports = __toESM(require("@antfu/eslint-plugin-unused-imports"), 1);
|
|
250
244
|
var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
|
251
245
|
var parserToml = __toESM(require("toml-eslint-parser"), 1);
|
|
252
246
|
var parserYaml = __toESM(require("yaml-eslint-parser"), 1);
|
|
@@ -434,6 +428,19 @@ var prettier = defineConfig([
|
|
|
434
428
|
...import_eslint_plugin_prettier.default.configs.recommended.rules,
|
|
435
429
|
"prettier/prettier": "warn"
|
|
436
430
|
}
|
|
431
|
+
},
|
|
432
|
+
/**
|
|
433
|
+
* Languages that prettier currently does not support
|
|
434
|
+
*/
|
|
435
|
+
{
|
|
436
|
+
name: "ntnyq/prettier/ignore",
|
|
437
|
+
files: [GLOB_TOML],
|
|
438
|
+
plugins: {
|
|
439
|
+
prettier: import_eslint_plugin_prettier.default
|
|
440
|
+
},
|
|
441
|
+
rules: {
|
|
442
|
+
"prettier/prettier": "off"
|
|
443
|
+
}
|
|
437
444
|
}
|
|
438
445
|
]);
|
|
439
446
|
|
|
@@ -1015,8 +1022,6 @@ var toml = defineConfig([
|
|
|
1015
1022
|
toml: import_eslint_plugin_toml.default
|
|
1016
1023
|
},
|
|
1017
1024
|
rules: {
|
|
1018
|
-
// Prettier do not have official support for TOML currently
|
|
1019
|
-
"prettier/prettier": "off",
|
|
1020
1025
|
// Avoid conflicts with js comment
|
|
1021
1026
|
"spaced-comment": "off",
|
|
1022
1027
|
"toml/comma-style": "error",
|
|
@@ -1597,23 +1602,7 @@ var vue = defineConfig([
|
|
|
1597
1602
|
}
|
|
1598
1603
|
]);
|
|
1599
1604
|
|
|
1600
|
-
// src/
|
|
1601
|
-
var presetJavaScript = [
|
|
1602
|
-
...ignores,
|
|
1603
|
-
...jsdoc,
|
|
1604
|
-
...jsx,
|
|
1605
|
-
...node,
|
|
1606
|
-
...imports,
|
|
1607
|
-
...unicorn,
|
|
1608
|
-
...comments,
|
|
1609
|
-
...javascript,
|
|
1610
|
-
...regexp
|
|
1611
|
-
];
|
|
1612
|
-
var presetBasic = [...presetJavaScript, ...typescript];
|
|
1613
|
-
var presetJsonc = [...jsonc, ...sortPackageJson, ...sortTsConfig];
|
|
1614
|
-
var presetLanguageExtensions = [...presetJsonc, ...yml, ...toml, ...markdown];
|
|
1615
|
-
var presetCommon = [...presetBasic, ...presetLanguageExtensions, ...prettier];
|
|
1616
|
-
var presetAll = [...presetCommon, ...vue, ...unocss];
|
|
1605
|
+
// src/core.ts
|
|
1617
1606
|
function ntnyq(config = [], {
|
|
1618
1607
|
vue: enableVue = hasVue,
|
|
1619
1608
|
unocss: enableUnoCSS = hasUnoCSS,
|
|
@@ -1621,22 +1610,44 @@ function ntnyq(config = [], {
|
|
|
1621
1610
|
markdown: enableMarkdown = true,
|
|
1622
1611
|
command: enableCommand = true
|
|
1623
1612
|
} = {}) {
|
|
1624
|
-
const configs = defineConfig([
|
|
1613
|
+
const configs = defineConfig([
|
|
1614
|
+
/**
|
|
1615
|
+
* Basic
|
|
1616
|
+
*/
|
|
1617
|
+
...ignores,
|
|
1618
|
+
...jsdoc,
|
|
1619
|
+
...jsx,
|
|
1620
|
+
...node,
|
|
1621
|
+
...imports,
|
|
1622
|
+
...unicorn,
|
|
1623
|
+
...comments,
|
|
1624
|
+
...javascript,
|
|
1625
|
+
...regexp,
|
|
1626
|
+
...typescript,
|
|
1627
|
+
/**
|
|
1628
|
+
* Language extensions
|
|
1629
|
+
*/
|
|
1630
|
+
...yml,
|
|
1631
|
+
...toml,
|
|
1632
|
+
...jsonc,
|
|
1633
|
+
...sortPackageJson,
|
|
1634
|
+
...sortTsConfig
|
|
1635
|
+
]);
|
|
1625
1636
|
if (enableVue) {
|
|
1626
1637
|
configs.push(...vue);
|
|
1627
1638
|
}
|
|
1628
1639
|
if (enableUnoCSS) {
|
|
1629
1640
|
configs.push(...unocss);
|
|
1630
1641
|
}
|
|
1631
|
-
if (enablePrettier) {
|
|
1632
|
-
configs.push(...prettier);
|
|
1633
|
-
}
|
|
1634
1642
|
if (enableMarkdown) {
|
|
1635
1643
|
configs.push(...markdown);
|
|
1636
1644
|
}
|
|
1637
1645
|
if (enableCommand) {
|
|
1638
1646
|
configs.push(...command);
|
|
1639
1647
|
}
|
|
1648
|
+
if (enablePrettier) {
|
|
1649
|
+
configs.push(...prettier);
|
|
1650
|
+
}
|
|
1640
1651
|
if (Object.keys(config).length > 0) {
|
|
1641
1652
|
configs.push(...Array.isArray(config) ? config : [config]);
|
|
1642
1653
|
}
|
|
@@ -1704,12 +1715,6 @@ function ntnyq(config = [], {
|
|
|
1704
1715
|
pluginUnusedImports,
|
|
1705
1716
|
pluginVue,
|
|
1706
1717
|
pluginYaml,
|
|
1707
|
-
presetAll,
|
|
1708
|
-
presetBasic,
|
|
1709
|
-
presetCommon,
|
|
1710
|
-
presetJavaScript,
|
|
1711
|
-
presetJsonc,
|
|
1712
|
-
presetLanguageExtensions,
|
|
1713
1718
|
prettier,
|
|
1714
1719
|
regexp,
|
|
1715
1720
|
sortPackageJson,
|
package/dist/index.d.cts
CHANGED
|
@@ -13,7 +13,7 @@ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
|
13
13
|
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
14
14
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
15
15
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
16
|
-
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
16
|
+
export { default as pluginUnusedImports } from '@antfu/eslint-plugin-unused-imports';
|
|
17
17
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
18
18
|
import * as tomlEslintParser from 'toml-eslint-parser';
|
|
19
19
|
export { tomlEslintParser as parserToml };
|
|
@@ -24,17 +24,6 @@ export { vueEslintParser as parserVue };
|
|
|
24
24
|
import * as jsoncEslintParser from 'jsonc-eslint-parser';
|
|
25
25
|
export { jsoncEslintParser as parserJsonc };
|
|
26
26
|
|
|
27
|
-
declare const hasTypeScript: boolean;
|
|
28
|
-
declare const hasVue: boolean;
|
|
29
|
-
declare const hasUnoCSS: boolean;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Load an ESLint plugin by name.
|
|
33
|
-
* @param name - The name of the plugin
|
|
34
|
-
* @returns The plugin module
|
|
35
|
-
*/
|
|
36
|
-
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
37
|
-
|
|
38
27
|
/* eslint-disable */
|
|
39
28
|
/* prettier-ignore */
|
|
40
29
|
|
|
@@ -1281,6 +1270,11 @@ interface RuleOptions {
|
|
|
1281
1270
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-tag-names.md#repos-sticky-header
|
|
1282
1271
|
*/
|
|
1283
1272
|
'jsdoc/check-tag-names'?: Linter.RuleEntry<JsdocCheckTagNames>
|
|
1273
|
+
/**
|
|
1274
|
+
* Checks that any `@template` names are actually used in the connected `@typedef` or type alias.
|
|
1275
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header
|
|
1276
|
+
*/
|
|
1277
|
+
'jsdoc/check-template-names'?: Linter.RuleEntry<[]>
|
|
1284
1278
|
/**
|
|
1285
1279
|
* Reports invalid types.
|
|
1286
1280
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-types.md#repos-sticky-header
|
|
@@ -6690,7 +6684,7 @@ type TypescriptEslintRestrictTemplateExpressions = []|[{
|
|
|
6690
6684
|
allowNever?: boolean
|
|
6691
6685
|
}]
|
|
6692
6686
|
// ----- @typescript-eslint/return-await -----
|
|
6693
|
-
type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never")]
|
|
6687
|
+
type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never" | "error-handling-correctness-only")]
|
|
6694
6688
|
// ----- @typescript-eslint/sort-type-constituents -----
|
|
6695
6689
|
type TypescriptEslintSortTypeConstituents = []|[{
|
|
6696
6690
|
|
|
@@ -11216,6 +11210,32 @@ type Awaitable<T> = T | Promise<T>
|
|
|
11216
11210
|
|
|
11217
11211
|
type InteropModuleDefault<T> = T extends { default: infer U } ? U : T
|
|
11218
11212
|
|
|
11213
|
+
/**
|
|
11214
|
+
* @file presets
|
|
11215
|
+
*/
|
|
11216
|
+
|
|
11217
|
+
/**
|
|
11218
|
+
* Custom framework support
|
|
11219
|
+
*/
|
|
11220
|
+
declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
|
|
11221
|
+
vue?: boolean | undefined;
|
|
11222
|
+
unocss?: boolean | undefined;
|
|
11223
|
+
prettier?: boolean | undefined;
|
|
11224
|
+
markdown?: boolean | undefined;
|
|
11225
|
+
command?: boolean | undefined;
|
|
11226
|
+
}): TypedConfigItem[];
|
|
11227
|
+
|
|
11228
|
+
declare const hasTypeScript: boolean;
|
|
11229
|
+
declare const hasVue: boolean;
|
|
11230
|
+
declare const hasUnoCSS: boolean;
|
|
11231
|
+
|
|
11232
|
+
/**
|
|
11233
|
+
* Load an ESLint plugin by name.
|
|
11234
|
+
* @param name - The name of the plugin
|
|
11235
|
+
* @returns The plugin module
|
|
11236
|
+
*/
|
|
11237
|
+
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
11238
|
+
|
|
11219
11239
|
/**
|
|
11220
11240
|
* Define ESLint config
|
|
11221
11241
|
*/
|
|
@@ -11256,42 +11276,6 @@ declare const GLOB_DIST = "**/dist/**";
|
|
|
11256
11276
|
declare const GLOB_LOCKFILE: string[];
|
|
11257
11277
|
declare const GLOB_EXCLUDE: string[];
|
|
11258
11278
|
|
|
11259
|
-
/**
|
|
11260
|
-
* @file presets
|
|
11261
|
-
*/
|
|
11262
|
-
|
|
11263
|
-
/**
|
|
11264
|
-
* JavaScript preset
|
|
11265
|
-
*/
|
|
11266
|
-
declare const presetJavaScript: TypedConfigItem[];
|
|
11267
|
-
/**
|
|
11268
|
-
* JavaScript & TypeScript
|
|
11269
|
-
*/
|
|
11270
|
-
declare const presetBasic: TypedConfigItem[];
|
|
11271
|
-
/**
|
|
11272
|
-
* JSON and sort json keys
|
|
11273
|
-
*/
|
|
11274
|
-
declare const presetJsonc: TypedConfigItem[];
|
|
11275
|
-
/**
|
|
11276
|
-
* JSON YAML Markdown
|
|
11277
|
-
*/
|
|
11278
|
-
declare const presetLanguageExtensions: TypedConfigItem[];
|
|
11279
|
-
declare const presetCommon: TypedConfigItem[];
|
|
11280
|
-
/**
|
|
11281
|
-
* All supported framework
|
|
11282
|
-
*/
|
|
11283
|
-
declare const presetAll: TypedConfigItem[];
|
|
11284
|
-
/**
|
|
11285
|
-
* Custom framework support
|
|
11286
|
-
*/
|
|
11287
|
-
declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
|
|
11288
|
-
vue?: boolean | undefined;
|
|
11289
|
-
unocss?: boolean | undefined;
|
|
11290
|
-
prettier?: boolean | undefined;
|
|
11291
|
-
markdown?: boolean | undefined;
|
|
11292
|
-
command?: boolean | undefined;
|
|
11293
|
-
}): TypedConfigItem[];
|
|
11294
|
-
|
|
11295
11279
|
/**
|
|
11296
11280
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
11297
11281
|
*/
|
|
@@ -11337,4 +11321,4 @@ declare const markdown: TypedConfigItem[];
|
|
|
11337
11321
|
declare function getVueVersion(): number;
|
|
11338
11322
|
declare const vue: TypedConfigItem[];
|
|
11339
11323
|
|
|
11340
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq,
|
|
11324
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, prettier, regexp, sortPackageJson, sortTsConfig, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
|
13
13
|
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
14
14
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
15
15
|
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
16
|
-
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
16
|
+
export { default as pluginUnusedImports } from '@antfu/eslint-plugin-unused-imports';
|
|
17
17
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
18
18
|
import * as tomlEslintParser from 'toml-eslint-parser';
|
|
19
19
|
export { tomlEslintParser as parserToml };
|
|
@@ -24,17 +24,6 @@ export { vueEslintParser as parserVue };
|
|
|
24
24
|
import * as jsoncEslintParser from 'jsonc-eslint-parser';
|
|
25
25
|
export { jsoncEslintParser as parserJsonc };
|
|
26
26
|
|
|
27
|
-
declare const hasTypeScript: boolean;
|
|
28
|
-
declare const hasVue: boolean;
|
|
29
|
-
declare const hasUnoCSS: boolean;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Load an ESLint plugin by name.
|
|
33
|
-
* @param name - The name of the plugin
|
|
34
|
-
* @returns The plugin module
|
|
35
|
-
*/
|
|
36
|
-
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
37
|
-
|
|
38
27
|
/* eslint-disable */
|
|
39
28
|
/* prettier-ignore */
|
|
40
29
|
|
|
@@ -1281,6 +1270,11 @@ interface RuleOptions {
|
|
|
1281
1270
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-tag-names.md#repos-sticky-header
|
|
1282
1271
|
*/
|
|
1283
1272
|
'jsdoc/check-tag-names'?: Linter.RuleEntry<JsdocCheckTagNames>
|
|
1273
|
+
/**
|
|
1274
|
+
* Checks that any `@template` names are actually used in the connected `@typedef` or type alias.
|
|
1275
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md#repos-sticky-header
|
|
1276
|
+
*/
|
|
1277
|
+
'jsdoc/check-template-names'?: Linter.RuleEntry<[]>
|
|
1284
1278
|
/**
|
|
1285
1279
|
* Reports invalid types.
|
|
1286
1280
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-types.md#repos-sticky-header
|
|
@@ -6690,7 +6684,7 @@ type TypescriptEslintRestrictTemplateExpressions = []|[{
|
|
|
6690
6684
|
allowNever?: boolean
|
|
6691
6685
|
}]
|
|
6692
6686
|
// ----- @typescript-eslint/return-await -----
|
|
6693
|
-
type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never")]
|
|
6687
|
+
type TypescriptEslintReturnAwait = []|[("in-try-catch" | "always" | "never" | "error-handling-correctness-only")]
|
|
6694
6688
|
// ----- @typescript-eslint/sort-type-constituents -----
|
|
6695
6689
|
type TypescriptEslintSortTypeConstituents = []|[{
|
|
6696
6690
|
|
|
@@ -11216,6 +11210,32 @@ type Awaitable<T> = T | Promise<T>
|
|
|
11216
11210
|
|
|
11217
11211
|
type InteropModuleDefault<T> = T extends { default: infer U } ? U : T
|
|
11218
11212
|
|
|
11213
|
+
/**
|
|
11214
|
+
* @file presets
|
|
11215
|
+
*/
|
|
11216
|
+
|
|
11217
|
+
/**
|
|
11218
|
+
* Custom framework support
|
|
11219
|
+
*/
|
|
11220
|
+
declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
|
|
11221
|
+
vue?: boolean | undefined;
|
|
11222
|
+
unocss?: boolean | undefined;
|
|
11223
|
+
prettier?: boolean | undefined;
|
|
11224
|
+
markdown?: boolean | undefined;
|
|
11225
|
+
command?: boolean | undefined;
|
|
11226
|
+
}): TypedConfigItem[];
|
|
11227
|
+
|
|
11228
|
+
declare const hasTypeScript: boolean;
|
|
11229
|
+
declare const hasVue: boolean;
|
|
11230
|
+
declare const hasUnoCSS: boolean;
|
|
11231
|
+
|
|
11232
|
+
/**
|
|
11233
|
+
* Load an ESLint plugin by name.
|
|
11234
|
+
* @param name - The name of the plugin
|
|
11235
|
+
* @returns The plugin module
|
|
11236
|
+
*/
|
|
11237
|
+
declare function loadPlugin<T = unknown>(name: string): Promise<T>;
|
|
11238
|
+
|
|
11219
11239
|
/**
|
|
11220
11240
|
* Define ESLint config
|
|
11221
11241
|
*/
|
|
@@ -11256,42 +11276,6 @@ declare const GLOB_DIST = "**/dist/**";
|
|
|
11256
11276
|
declare const GLOB_LOCKFILE: string[];
|
|
11257
11277
|
declare const GLOB_EXCLUDE: string[];
|
|
11258
11278
|
|
|
11259
|
-
/**
|
|
11260
|
-
* @file presets
|
|
11261
|
-
*/
|
|
11262
|
-
|
|
11263
|
-
/**
|
|
11264
|
-
* JavaScript preset
|
|
11265
|
-
*/
|
|
11266
|
-
declare const presetJavaScript: TypedConfigItem[];
|
|
11267
|
-
/**
|
|
11268
|
-
* JavaScript & TypeScript
|
|
11269
|
-
*/
|
|
11270
|
-
declare const presetBasic: TypedConfigItem[];
|
|
11271
|
-
/**
|
|
11272
|
-
* JSON and sort json keys
|
|
11273
|
-
*/
|
|
11274
|
-
declare const presetJsonc: TypedConfigItem[];
|
|
11275
|
-
/**
|
|
11276
|
-
* JSON YAML Markdown
|
|
11277
|
-
*/
|
|
11278
|
-
declare const presetLanguageExtensions: TypedConfigItem[];
|
|
11279
|
-
declare const presetCommon: TypedConfigItem[];
|
|
11280
|
-
/**
|
|
11281
|
-
* All supported framework
|
|
11282
|
-
*/
|
|
11283
|
-
declare const presetAll: TypedConfigItem[];
|
|
11284
|
-
/**
|
|
11285
|
-
* Custom framework support
|
|
11286
|
-
*/
|
|
11287
|
-
declare function ntnyq(config?: TypedConfigItem | TypedConfigItem[], { vue: enableVue, unocss: enableUnoCSS, prettier: enablePrettier, markdown: enableMarkdown, command: enableCommand, }?: {
|
|
11288
|
-
vue?: boolean | undefined;
|
|
11289
|
-
unocss?: boolean | undefined;
|
|
11290
|
-
prettier?: boolean | undefined;
|
|
11291
|
-
markdown?: boolean | undefined;
|
|
11292
|
-
command?: boolean | undefined;
|
|
11293
|
-
}): TypedConfigItem[];
|
|
11294
|
-
|
|
11295
11279
|
/**
|
|
11296
11280
|
* @see https://eslint.org/docs/latest/use/configure/configuration-files-new#globally-ignoring-files-with-ignores
|
|
11297
11281
|
*/
|
|
@@ -11337,4 +11321,4 @@ declare const markdown: TypedConfigItem[];
|
|
|
11337
11321
|
declare function getVueVersion(): number;
|
|
11338
11322
|
declare const vue: TypedConfigItem[];
|
|
11339
11323
|
|
|
11340
|
-
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq,
|
|
11324
|
+
export { GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, command, comments, defineConfig, getVueVersion, hasTypeScript, hasUnoCSS, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, prettier, regexp, sortPackageJson, sortTsConfig, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -132,7 +132,7 @@ import { default as default9 } from "eslint-plugin-unicorn";
|
|
|
132
132
|
import { default as default10 } from "eslint-plugin-import-x";
|
|
133
133
|
import { default as default11 } from "eslint-plugin-prettier";
|
|
134
134
|
import { default as default12 } from "eslint-plugin-markdown";
|
|
135
|
-
import { default as default13 } from "eslint-plugin-unused-imports";
|
|
135
|
+
import { default as default13 } from "@antfu/eslint-plugin-unused-imports";
|
|
136
136
|
import { default as default14 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
137
137
|
import * as parserToml from "toml-eslint-parser";
|
|
138
138
|
import * as parserYaml from "yaml-eslint-parser";
|
|
@@ -320,6 +320,19 @@ var prettier = defineConfig([
|
|
|
320
320
|
...default11.configs.recommended.rules,
|
|
321
321
|
"prettier/prettier": "warn"
|
|
322
322
|
}
|
|
323
|
+
},
|
|
324
|
+
/**
|
|
325
|
+
* Languages that prettier currently does not support
|
|
326
|
+
*/
|
|
327
|
+
{
|
|
328
|
+
name: "ntnyq/prettier/ignore",
|
|
329
|
+
files: [GLOB_TOML],
|
|
330
|
+
plugins: {
|
|
331
|
+
prettier: default11
|
|
332
|
+
},
|
|
333
|
+
rules: {
|
|
334
|
+
"prettier/prettier": "off"
|
|
335
|
+
}
|
|
323
336
|
}
|
|
324
337
|
]);
|
|
325
338
|
|
|
@@ -901,8 +914,6 @@ var toml = defineConfig([
|
|
|
901
914
|
toml: default5
|
|
902
915
|
},
|
|
903
916
|
rules: {
|
|
904
|
-
// Prettier do not have official support for TOML currently
|
|
905
|
-
"prettier/prettier": "off",
|
|
906
917
|
// Avoid conflicts with js comment
|
|
907
918
|
"spaced-comment": "off",
|
|
908
919
|
"toml/comma-style": "error",
|
|
@@ -1483,23 +1494,7 @@ var vue = defineConfig([
|
|
|
1483
1494
|
}
|
|
1484
1495
|
]);
|
|
1485
1496
|
|
|
1486
|
-
// src/
|
|
1487
|
-
var presetJavaScript = [
|
|
1488
|
-
...ignores,
|
|
1489
|
-
...jsdoc,
|
|
1490
|
-
...jsx,
|
|
1491
|
-
...node,
|
|
1492
|
-
...imports,
|
|
1493
|
-
...unicorn,
|
|
1494
|
-
...comments,
|
|
1495
|
-
...javascript,
|
|
1496
|
-
...regexp
|
|
1497
|
-
];
|
|
1498
|
-
var presetBasic = [...presetJavaScript, ...typescript];
|
|
1499
|
-
var presetJsonc = [...jsonc, ...sortPackageJson, ...sortTsConfig];
|
|
1500
|
-
var presetLanguageExtensions = [...presetJsonc, ...yml, ...toml, ...markdown];
|
|
1501
|
-
var presetCommon = [...presetBasic, ...presetLanguageExtensions, ...prettier];
|
|
1502
|
-
var presetAll = [...presetCommon, ...vue, ...unocss];
|
|
1497
|
+
// src/core.ts
|
|
1503
1498
|
function ntnyq(config = [], {
|
|
1504
1499
|
vue: enableVue = hasVue,
|
|
1505
1500
|
unocss: enableUnoCSS = hasUnoCSS,
|
|
@@ -1507,22 +1502,44 @@ function ntnyq(config = [], {
|
|
|
1507
1502
|
markdown: enableMarkdown = true,
|
|
1508
1503
|
command: enableCommand = true
|
|
1509
1504
|
} = {}) {
|
|
1510
|
-
const configs = defineConfig([
|
|
1505
|
+
const configs = defineConfig([
|
|
1506
|
+
/**
|
|
1507
|
+
* Basic
|
|
1508
|
+
*/
|
|
1509
|
+
...ignores,
|
|
1510
|
+
...jsdoc,
|
|
1511
|
+
...jsx,
|
|
1512
|
+
...node,
|
|
1513
|
+
...imports,
|
|
1514
|
+
...unicorn,
|
|
1515
|
+
...comments,
|
|
1516
|
+
...javascript,
|
|
1517
|
+
...regexp,
|
|
1518
|
+
...typescript,
|
|
1519
|
+
/**
|
|
1520
|
+
* Language extensions
|
|
1521
|
+
*/
|
|
1522
|
+
...yml,
|
|
1523
|
+
...toml,
|
|
1524
|
+
...jsonc,
|
|
1525
|
+
...sortPackageJson,
|
|
1526
|
+
...sortTsConfig
|
|
1527
|
+
]);
|
|
1511
1528
|
if (enableVue) {
|
|
1512
1529
|
configs.push(...vue);
|
|
1513
1530
|
}
|
|
1514
1531
|
if (enableUnoCSS) {
|
|
1515
1532
|
configs.push(...unocss);
|
|
1516
1533
|
}
|
|
1517
|
-
if (enablePrettier) {
|
|
1518
|
-
configs.push(...prettier);
|
|
1519
|
-
}
|
|
1520
1534
|
if (enableMarkdown) {
|
|
1521
1535
|
configs.push(...markdown);
|
|
1522
1536
|
}
|
|
1523
1537
|
if (enableCommand) {
|
|
1524
1538
|
configs.push(...command);
|
|
1525
1539
|
}
|
|
1540
|
+
if (enablePrettier) {
|
|
1541
|
+
configs.push(...prettier);
|
|
1542
|
+
}
|
|
1526
1543
|
if (Object.keys(config).length > 0) {
|
|
1527
1544
|
configs.push(...Array.isArray(config) ? config : [config]);
|
|
1528
1545
|
}
|
|
@@ -1589,12 +1606,6 @@ export {
|
|
|
1589
1606
|
default13 as pluginUnusedImports,
|
|
1590
1607
|
default3 as pluginVue,
|
|
1591
1608
|
default4 as pluginYaml,
|
|
1592
|
-
presetAll,
|
|
1593
|
-
presetBasic,
|
|
1594
|
-
presetCommon,
|
|
1595
|
-
presetJavaScript,
|
|
1596
|
-
presetJsonc,
|
|
1597
|
-
presetLanguageExtensions,
|
|
1598
1609
|
prettier,
|
|
1599
1610
|
regexp,
|
|
1600
1611
|
sortPackageJson,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
5
|
-
"packageManager": "pnpm@9.
|
|
4
|
+
"version": "2.7.0",
|
|
5
|
+
"packageManager": "pnpm@9.6.0",
|
|
6
6
|
"description": "ESLint flat config of ntnyq",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"eslint",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"eslint": "^9.0.0"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
+
"@antfu/eslint-plugin-unused-imports": "^4.0.0",
|
|
58
59
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
|
|
59
60
|
"@eslint/js": "^9.7.0",
|
|
60
61
|
"@types/eslint": "^8.56.10",
|
|
@@ -63,7 +64,7 @@
|
|
|
63
64
|
"eslint-flat-config-utils": "^0.2.5",
|
|
64
65
|
"eslint-plugin-command": "^0.2.3",
|
|
65
66
|
"eslint-plugin-import-x": "^3.0.1",
|
|
66
|
-
"eslint-plugin-jsdoc": "^48.
|
|
67
|
+
"eslint-plugin-jsdoc": "^48.8.3",
|
|
67
68
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
68
69
|
"eslint-plugin-markdown": "^5.1.0",
|
|
69
70
|
"eslint-plugin-n": "^17.9.0",
|
|
@@ -71,7 +72,6 @@
|
|
|
71
72
|
"eslint-plugin-regexp": "^2.6.0",
|
|
72
73
|
"eslint-plugin-toml": "^0.11.1",
|
|
73
74
|
"eslint-plugin-unicorn": "^54.0.0",
|
|
74
|
-
"eslint-plugin-unused-imports": "^4.0.0",
|
|
75
75
|
"eslint-plugin-vue": "^9.27.0",
|
|
76
76
|
"eslint-plugin-yml": "^1.14.0",
|
|
77
77
|
"globals": "^15.8.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"local-pkg": "^0.5.0",
|
|
80
80
|
"prettier": "^3.3.3",
|
|
81
81
|
"toml-eslint-parser": "^0.10.0",
|
|
82
|
-
"typescript-eslint": "^8.0.0-alpha.
|
|
82
|
+
"typescript-eslint": "^8.0.0-alpha.49",
|
|
83
83
|
"vue-eslint-parser": "^9.4.3",
|
|
84
84
|
"yaml-eslint-parser": "^1.2.3"
|
|
85
85
|
},
|
|
@@ -89,11 +89,11 @@
|
|
|
89
89
|
"bumpp": "^9.4.1",
|
|
90
90
|
"eslint": "^9.7.0",
|
|
91
91
|
"eslint-typegen": "^0.2.4",
|
|
92
|
-
"husky": "^9.1.
|
|
92
|
+
"husky": "^9.1.1",
|
|
93
93
|
"nano-staged": "^0.8.0",
|
|
94
94
|
"npm-run-all2": "^6.2.2",
|
|
95
95
|
"rimraf": "^6.0.1",
|
|
96
|
-
"tsup": "^8.1
|
|
96
|
+
"tsup": "^8.2.1",
|
|
97
97
|
"tsx": "^4.16.2",
|
|
98
98
|
"typescript": "^5.5.3",
|
|
99
99
|
"zx": "^8.1.4"
|