@ntnyq/eslint-config 3.0.0-beta.6 → 3.0.0-beta.8
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 +55 -41
- package/dist/index.d.cts +43 -3
- package/dist/index.d.ts +43 -3
- package/dist/index.js +73 -59
- package/package.json +10 -11
package/dist/index.cjs
CHANGED
|
@@ -85,7 +85,7 @@ __export(src_exports, {
|
|
|
85
85
|
pluginImport: () => import_eslint_plugin_import_x.default,
|
|
86
86
|
pluginJsdoc: () => import_eslint_plugin_jsdoc.default,
|
|
87
87
|
pluginJsonc: () => import_eslint_plugin_jsonc.default,
|
|
88
|
-
pluginMarkdown: () =>
|
|
88
|
+
pluginMarkdown: () => import_markdown.default,
|
|
89
89
|
pluginNode: () => import_eslint_plugin_n.default,
|
|
90
90
|
pluginPerfectionist: () => import_eslint_plugin_perfectionist.default,
|
|
91
91
|
pluginPrettier: () => import_eslint_plugin_prettier.default,
|
|
@@ -117,6 +117,9 @@ __export(src_exports, {
|
|
|
117
117
|
});
|
|
118
118
|
module.exports = __toCommonJS(src_exports);
|
|
119
119
|
|
|
120
|
+
// src/core.ts
|
|
121
|
+
var import_eslint_flat_config_utils = require("eslint-flat-config-utils");
|
|
122
|
+
|
|
120
123
|
// src/utils/env.ts
|
|
121
124
|
var import_node_process = __toESM(require("process"), 1);
|
|
122
125
|
var import_node_path = require("path");
|
|
@@ -269,12 +272,12 @@ var import_eslint_plugin_yml = __toESM(require("eslint-plugin-yml"), 1);
|
|
|
269
272
|
var import_eslint_plugin_toml = __toESM(require("eslint-plugin-toml"), 1);
|
|
270
273
|
var import_eslint_plugin_jsonc = __toESM(require("eslint-plugin-jsonc"), 1);
|
|
271
274
|
var import_eslint_plugin_jsdoc = __toESM(require("eslint-plugin-jsdoc"), 1);
|
|
275
|
+
var import_markdown = __toESM(require("@eslint/markdown"), 1);
|
|
272
276
|
var import_eslint_plugin = __toESM(require("@unocss/eslint-plugin"), 1);
|
|
273
277
|
var import_eslint_plugin2 = __toESM(require("@vitest/eslint-plugin"), 1);
|
|
274
278
|
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
275
279
|
var import_eslint_plugin_import_x = __toESM(require("eslint-plugin-import-x"), 1);
|
|
276
280
|
var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
|
|
277
|
-
var import_eslint_plugin_markdown = __toESM(require("eslint-plugin-markdown"), 1);
|
|
278
281
|
var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
|
|
279
282
|
var import_eslint_plugin_unused_imports = __toESM(require("eslint-plugin-unused-imports"), 1);
|
|
280
283
|
var import_eslint_plugin_eslint_comments = __toESM(require("@eslint-community/eslint-plugin-eslint-comments"), 1);
|
|
@@ -392,6 +395,7 @@ var unicorn = (options = {}) => [
|
|
|
392
395
|
},
|
|
393
396
|
rules: {
|
|
394
397
|
// Disabled for now
|
|
398
|
+
"unicorn/better-regex": "off",
|
|
395
399
|
"unicorn/prefer-top-level-await": "off",
|
|
396
400
|
"unicorn/explicit-length-check": "off",
|
|
397
401
|
"unicorn/no-array-callback-reference": "off",
|
|
@@ -406,7 +410,6 @@ var unicorn = (options = {}) => [
|
|
|
406
410
|
"unicorn/switch-case-braces": ["error", "avoid"],
|
|
407
411
|
"unicorn/no-typeof-undefined": "error",
|
|
408
412
|
"unicorn/prefer-set-size": "error",
|
|
409
|
-
"unicorn/better-regex": "error",
|
|
410
413
|
"unicorn/prefer-regexp-test": "error",
|
|
411
414
|
"unicorn/no-static-only-class": "error",
|
|
412
415
|
"unicorn/no-zero-fractions": "error",
|
|
@@ -1380,6 +1383,7 @@ var sortPackageJson = () => [
|
|
|
1380
1383
|
"publisher",
|
|
1381
1384
|
"name",
|
|
1382
1385
|
"displayName",
|
|
1386
|
+
"preview",
|
|
1383
1387
|
"type",
|
|
1384
1388
|
"version",
|
|
1385
1389
|
"private",
|
|
@@ -1644,37 +1648,46 @@ var jsonc = (options = {}) => [
|
|
|
1644
1648
|
];
|
|
1645
1649
|
|
|
1646
1650
|
// src/configs/markdown.ts
|
|
1647
|
-
var markdown = (options = {}) =>
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1651
|
+
var markdown = (options = {}) => {
|
|
1652
|
+
if (!Array.isArray(import_markdown.default.configs?.processor)) return [];
|
|
1653
|
+
return [
|
|
1654
|
+
...import_markdown.default.configs.processor.map((config) => ({
|
|
1655
|
+
...config,
|
|
1656
|
+
name: `ntnyq/${config.name}`
|
|
1657
|
+
})),
|
|
1658
|
+
{
|
|
1659
|
+
name: "ntnyq/markdown/disabled/code-blocks",
|
|
1660
|
+
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
1661
|
+
rules: {
|
|
1662
|
+
"no-undef": "off",
|
|
1663
|
+
"no-alert": "off",
|
|
1664
|
+
"no-console": "off",
|
|
1665
|
+
"no-unused-vars": "off",
|
|
1666
|
+
"no-unused-expressions": "off",
|
|
1667
|
+
"no-restricted-imports": "off",
|
|
1668
|
+
"node/prefer-global/buffer": "off",
|
|
1669
|
+
"node/prefer-global/process": "off",
|
|
1670
|
+
"import/no-unresolved": "off",
|
|
1671
|
+
"unused-imports/no-unused-imports": "off",
|
|
1672
|
+
"unused-imports/no-unused-vars": "off",
|
|
1673
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
1674
|
+
"@typescript-eslint/no-redeclare": "off",
|
|
1675
|
+
"@typescript-eslint/no-namespace": "off",
|
|
1676
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
1677
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
1678
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
1679
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
1680
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
1681
|
+
"@typescript-eslint/consistent-type-imports": "off",
|
|
1682
|
+
// Overrides built-in rules
|
|
1683
|
+
...options.overrides
|
|
1684
|
+
}
|
|
1672
1685
|
}
|
|
1673
|
-
|
|
1674
|
-
|
|
1686
|
+
];
|
|
1687
|
+
};
|
|
1675
1688
|
|
|
1676
1689
|
// src/core.ts
|
|
1677
|
-
function ntnyq(options = {},
|
|
1690
|
+
function ntnyq(options = {}, userConfigs = []) {
|
|
1678
1691
|
const configs = [];
|
|
1679
1692
|
if (options.gitignore ?? true) {
|
|
1680
1693
|
configs.push(
|
|
@@ -1799,16 +1812,17 @@ function ntnyq(options = {}, customConfig = []) {
|
|
|
1799
1812
|
})
|
|
1800
1813
|
);
|
|
1801
1814
|
}
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
)
|
|
1810
|
-
|
|
1811
|
-
|
|
1815
|
+
const configPrettier = options.prettier ?? true ? prettier({
|
|
1816
|
+
...resolveSubOptions(options, "prettier"),
|
|
1817
|
+
overrides: getOverrides(options, "prettier")
|
|
1818
|
+
}) : [];
|
|
1819
|
+
const composer = new import_eslint_flat_config_utils.FlatConfigComposer();
|
|
1820
|
+
composer.append(
|
|
1821
|
+
...configs,
|
|
1822
|
+
...toArray(userConfigs),
|
|
1823
|
+
...configPrettier
|
|
1824
|
+
);
|
|
1825
|
+
return composer;
|
|
1812
1826
|
}
|
|
1813
1827
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1814
1828
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
2
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
3
|
import { ESLintPluginCommandOptions } from 'eslint-plugin-command/types';
|
|
4
|
+
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
4
5
|
export { default as tseslint } from 'typescript-eslint';
|
|
5
6
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
6
7
|
export { eslintPluginRegexp as pluginRegexp };
|
|
@@ -10,12 +11,12 @@ export { default as pluginYaml } from 'eslint-plugin-yml';
|
|
|
10
11
|
export { default as pluginToml } from 'eslint-plugin-toml';
|
|
11
12
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
12
13
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
14
|
+
export { default as pluginMarkdown } from '@eslint/markdown';
|
|
13
15
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
14
16
|
export { default as pluginVitest } from '@vitest/eslint-plugin';
|
|
15
17
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
16
18
|
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
17
19
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
18
|
-
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
19
20
|
export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
|
|
20
21
|
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
21
22
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
@@ -1464,6 +1465,34 @@ interface RuleOptions {
|
|
|
1464
1465
|
* @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/vue-custom-block/no-parsing-error.html
|
|
1465
1466
|
*/
|
|
1466
1467
|
'jsonc/vue-custom-block/no-parsing-error'?: Linter.RuleEntry<[]>;
|
|
1468
|
+
/**
|
|
1469
|
+
* Require languages for fenced code blocks.
|
|
1470
|
+
*/
|
|
1471
|
+
'markdown/fenced-code-language'?: Linter.RuleEntry<MarkdownFencedCodeLanguage>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Enforce heading levels increment by one.
|
|
1474
|
+
*/
|
|
1475
|
+
'markdown/heading-increment'?: Linter.RuleEntry<[]>;
|
|
1476
|
+
/**
|
|
1477
|
+
* Disallow duplicate headings in the same document.
|
|
1478
|
+
*/
|
|
1479
|
+
'markdown/no-duplicate-headings'?: Linter.RuleEntry<[]>;
|
|
1480
|
+
/**
|
|
1481
|
+
* Disallow empty links.
|
|
1482
|
+
*/
|
|
1483
|
+
'markdown/no-empty-links'?: Linter.RuleEntry<[]>;
|
|
1484
|
+
/**
|
|
1485
|
+
* Disallow HTML tags.
|
|
1486
|
+
*/
|
|
1487
|
+
'markdown/no-html'?: Linter.RuleEntry<MarkdownNoHtml>;
|
|
1488
|
+
/**
|
|
1489
|
+
* Disallow invalid label references.
|
|
1490
|
+
*/
|
|
1491
|
+
'markdown/no-invalid-label-refs'?: Linter.RuleEntry<[]>;
|
|
1492
|
+
/**
|
|
1493
|
+
* Disallow missing label references.
|
|
1494
|
+
*/
|
|
1495
|
+
'markdown/no-missing-label-refs'?: Linter.RuleEntry<[]>;
|
|
1467
1496
|
/**
|
|
1468
1497
|
* require `return` statements after callbacks
|
|
1469
1498
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/callback-return.md
|
|
@@ -6362,6 +6391,16 @@ type JsoncSpaceUnaryOps = [] | [
|
|
|
6362
6391
|
};
|
|
6363
6392
|
}
|
|
6364
6393
|
];
|
|
6394
|
+
type MarkdownFencedCodeLanguage = [] | [
|
|
6395
|
+
{
|
|
6396
|
+
required?: string[];
|
|
6397
|
+
}
|
|
6398
|
+
];
|
|
6399
|
+
type MarkdownNoHtml = [] | [
|
|
6400
|
+
{
|
|
6401
|
+
allowed?: string[];
|
|
6402
|
+
}
|
|
6403
|
+
];
|
|
6365
6404
|
type NodeCallbackReturn = [] | [string[]];
|
|
6366
6405
|
type NodeExportsStyle = [] | [("module.exports" | "exports")] | [
|
|
6367
6406
|
("module.exports" | "exports"),
|
|
@@ -6685,6 +6724,7 @@ type _PerfectionistSortImportsSortImports = (_PerfectionistSortImportsMaxLineLen
|
|
|
6685
6724
|
order?: ("asc" | "desc");
|
|
6686
6725
|
ignoreCase?: boolean;
|
|
6687
6726
|
internalPattern?: string[];
|
|
6727
|
+
sortSideEffects?: boolean;
|
|
6688
6728
|
newlinesBetween?: ("ignore" | "always" | "never");
|
|
6689
6729
|
maxLineLength?: number;
|
|
6690
6730
|
groups?: (string | string[])[];
|
|
@@ -8863,7 +8903,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8863
8903
|
markers?: string[];
|
|
8864
8904
|
}
|
|
8865
8905
|
];
|
|
8866
|
-
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/scripts' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'ntnyq/markdown/
|
|
8906
|
+
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/scripts' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/sort/package-json' | 'ntnyq/sort/tsconfig' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/dts' | 'ntnyq/ts/test' | 'ntnyq/ts/cjs' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml';
|
|
8867
8907
|
|
|
8868
8908
|
/**
|
|
8869
8909
|
* Typed flat config item
|
|
@@ -9003,7 +9043,7 @@ interface ConfigOptions {
|
|
|
9003
9043
|
/**
|
|
9004
9044
|
* Config factory
|
|
9005
9045
|
*/
|
|
9006
|
-
declare function ntnyq(options?: ConfigOptions,
|
|
9046
|
+
declare function ntnyq(options?: ConfigOptions, userConfigs?: Arrayable<TypedConfigItem>): FlatConfigComposer<TypedConfigItem, ConfigName>;
|
|
9007
9047
|
|
|
9008
9048
|
declare const hasTypeScript: boolean;
|
|
9009
9049
|
declare const hasVitest: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
2
|
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
3
|
import { ESLintPluginCommandOptions } from 'eslint-plugin-command/types';
|
|
4
|
+
import { FlatConfigComposer } from 'eslint-flat-config-utils';
|
|
4
5
|
export { default as tseslint } from 'typescript-eslint';
|
|
5
6
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
6
7
|
export { eslintPluginRegexp as pluginRegexp };
|
|
@@ -10,12 +11,12 @@ export { default as pluginYaml } from 'eslint-plugin-yml';
|
|
|
10
11
|
export { default as pluginToml } from 'eslint-plugin-toml';
|
|
11
12
|
export { default as pluginJsonc } from 'eslint-plugin-jsonc';
|
|
12
13
|
export { default as pluginJsdoc } from 'eslint-plugin-jsdoc';
|
|
14
|
+
export { default as pluginMarkdown } from '@eslint/markdown';
|
|
13
15
|
export { default as pluginUnoCSS } from '@unocss/eslint-plugin';
|
|
14
16
|
export { default as pluginVitest } from '@vitest/eslint-plugin';
|
|
15
17
|
export { default as pluginUnicorn } from 'eslint-plugin-unicorn';
|
|
16
18
|
export { default as pluginImport } from 'eslint-plugin-import-x';
|
|
17
19
|
export { default as pluginPrettier } from 'eslint-plugin-prettier';
|
|
18
|
-
export { default as pluginMarkdown } from 'eslint-plugin-markdown';
|
|
19
20
|
export { default as pluginPerfectionist } from 'eslint-plugin-perfectionist';
|
|
20
21
|
export { default as pluginUnusedImports } from 'eslint-plugin-unused-imports';
|
|
21
22
|
export { default as pluginComments } from '@eslint-community/eslint-plugin-eslint-comments';
|
|
@@ -1464,6 +1465,34 @@ interface RuleOptions {
|
|
|
1464
1465
|
* @see https://ota-meshi.github.io/eslint-plugin-jsonc/rules/vue-custom-block/no-parsing-error.html
|
|
1465
1466
|
*/
|
|
1466
1467
|
'jsonc/vue-custom-block/no-parsing-error'?: Linter.RuleEntry<[]>;
|
|
1468
|
+
/**
|
|
1469
|
+
* Require languages for fenced code blocks.
|
|
1470
|
+
*/
|
|
1471
|
+
'markdown/fenced-code-language'?: Linter.RuleEntry<MarkdownFencedCodeLanguage>;
|
|
1472
|
+
/**
|
|
1473
|
+
* Enforce heading levels increment by one.
|
|
1474
|
+
*/
|
|
1475
|
+
'markdown/heading-increment'?: Linter.RuleEntry<[]>;
|
|
1476
|
+
/**
|
|
1477
|
+
* Disallow duplicate headings in the same document.
|
|
1478
|
+
*/
|
|
1479
|
+
'markdown/no-duplicate-headings'?: Linter.RuleEntry<[]>;
|
|
1480
|
+
/**
|
|
1481
|
+
* Disallow empty links.
|
|
1482
|
+
*/
|
|
1483
|
+
'markdown/no-empty-links'?: Linter.RuleEntry<[]>;
|
|
1484
|
+
/**
|
|
1485
|
+
* Disallow HTML tags.
|
|
1486
|
+
*/
|
|
1487
|
+
'markdown/no-html'?: Linter.RuleEntry<MarkdownNoHtml>;
|
|
1488
|
+
/**
|
|
1489
|
+
* Disallow invalid label references.
|
|
1490
|
+
*/
|
|
1491
|
+
'markdown/no-invalid-label-refs'?: Linter.RuleEntry<[]>;
|
|
1492
|
+
/**
|
|
1493
|
+
* Disallow missing label references.
|
|
1494
|
+
*/
|
|
1495
|
+
'markdown/no-missing-label-refs'?: Linter.RuleEntry<[]>;
|
|
1467
1496
|
/**
|
|
1468
1497
|
* require `return` statements after callbacks
|
|
1469
1498
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/callback-return.md
|
|
@@ -6362,6 +6391,16 @@ type JsoncSpaceUnaryOps = [] | [
|
|
|
6362
6391
|
};
|
|
6363
6392
|
}
|
|
6364
6393
|
];
|
|
6394
|
+
type MarkdownFencedCodeLanguage = [] | [
|
|
6395
|
+
{
|
|
6396
|
+
required?: string[];
|
|
6397
|
+
}
|
|
6398
|
+
];
|
|
6399
|
+
type MarkdownNoHtml = [] | [
|
|
6400
|
+
{
|
|
6401
|
+
allowed?: string[];
|
|
6402
|
+
}
|
|
6403
|
+
];
|
|
6365
6404
|
type NodeCallbackReturn = [] | [string[]];
|
|
6366
6405
|
type NodeExportsStyle = [] | [("module.exports" | "exports")] | [
|
|
6367
6406
|
("module.exports" | "exports"),
|
|
@@ -6685,6 +6724,7 @@ type _PerfectionistSortImportsSortImports = (_PerfectionistSortImportsMaxLineLen
|
|
|
6685
6724
|
order?: ("asc" | "desc");
|
|
6686
6725
|
ignoreCase?: boolean;
|
|
6687
6726
|
internalPattern?: string[];
|
|
6727
|
+
sortSideEffects?: boolean;
|
|
6688
6728
|
newlinesBetween?: ("ignore" | "always" | "never");
|
|
6689
6729
|
maxLineLength?: number;
|
|
6690
6730
|
groups?: (string | string[])[];
|
|
@@ -8863,7 +8903,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8863
8903
|
markers?: string[];
|
|
8864
8904
|
}
|
|
8865
8905
|
];
|
|
8866
|
-
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/scripts' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'markdown/recommended/plugin' | 'markdown/recommended/processor' | 'markdown/recommended/code-blocks' | 'ntnyq/markdown/
|
|
8906
|
+
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | 'ntnyq/gitignore' | 'ntnyq/js/recommended' | 'ntnyq/js/core' | 'ntnyq/js/scripts' | 'ntnyq/js/test' | 'ntnyq/jsdoc' | 'ntnyq/jsonc' | 'ntnyq/jsx' | 'ntnyq/markdown/recommended/plugin' | 'ntnyq/markdown/recommended/processor' | 'ntnyq/markdown/recommended/code-blocks' | 'ntnyq/markdown/disabled/code-blocks' | 'ntnyq/node' | 'ntnyq/prettier' | 'ntnyq/prettier/disabled' | 'ntnyq/regexp' | 'ntnyq/perfectionist' | 'ntnyq/sort/package-json' | 'ntnyq/sort/tsconfig' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/ts/dts' | 'ntnyq/ts/test' | 'ntnyq/ts/cjs' | 'ntnyq/unicorn' | 'ntnyq/unocss' | 'typescript-eslint/base' | 'typescript-eslint/eslint-recommended' | 'typescript-eslint/recommended' | 'ntnyq/ts/core' | 'ntnyq/vue/ts' | 'ntnyq/vue/core' | 'ntnyq/yaml' | 'ntnyq/toml';
|
|
8867
8907
|
|
|
8868
8908
|
/**
|
|
8869
8909
|
* Typed flat config item
|
|
@@ -9003,7 +9043,7 @@ interface ConfigOptions {
|
|
|
9003
9043
|
/**
|
|
9004
9044
|
* Config factory
|
|
9005
9045
|
*/
|
|
9006
|
-
declare function ntnyq(options?: ConfigOptions,
|
|
9046
|
+
declare function ntnyq(options?: ConfigOptions, userConfigs?: Arrayable<TypedConfigItem>): FlatConfigComposer<TypedConfigItem, ConfigName>;
|
|
9007
9047
|
|
|
9008
9048
|
declare const hasTypeScript: boolean;
|
|
9009
9049
|
declare const hasVitest: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// src/core.ts
|
|
2
|
+
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
|
+
|
|
1
4
|
// src/utils/env.ts
|
|
2
5
|
import process from "node:process";
|
|
3
6
|
import { resolve } from "node:path";
|
|
@@ -150,12 +153,12 @@ import { default as default4 } from "eslint-plugin-yml";
|
|
|
150
153
|
import { default as default5 } from "eslint-plugin-toml";
|
|
151
154
|
import { default as default6 } from "eslint-plugin-jsonc";
|
|
152
155
|
import { default as default7 } from "eslint-plugin-jsdoc";
|
|
153
|
-
import { default as default8 } from "@
|
|
154
|
-
import { default as default9 } from "@
|
|
155
|
-
import { default as default10 } from "eslint-plugin
|
|
156
|
-
import { default as default11 } from "eslint-plugin-
|
|
157
|
-
import { default as default12 } from "eslint-plugin-
|
|
158
|
-
import { default as default13 } from "eslint-plugin-
|
|
156
|
+
import { default as default8 } from "@eslint/markdown";
|
|
157
|
+
import { default as default9 } from "@unocss/eslint-plugin";
|
|
158
|
+
import { default as default10 } from "@vitest/eslint-plugin";
|
|
159
|
+
import { default as default11 } from "eslint-plugin-unicorn";
|
|
160
|
+
import { default as default12 } from "eslint-plugin-import-x";
|
|
161
|
+
import { default as default13 } from "eslint-plugin-prettier";
|
|
159
162
|
import { default as default14 } from "eslint-plugin-perfectionist";
|
|
160
163
|
import { default as default15 } from "eslint-plugin-unused-imports";
|
|
161
164
|
import { default as default16 } from "@eslint-community/eslint-plugin-eslint-comments";
|
|
@@ -222,7 +225,7 @@ var imports = (options = {}) => [
|
|
|
222
225
|
{
|
|
223
226
|
name: "ntnyq/imports",
|
|
224
227
|
plugins: {
|
|
225
|
-
import:
|
|
228
|
+
import: default12
|
|
226
229
|
},
|
|
227
230
|
settings: {
|
|
228
231
|
"import/resolver": {
|
|
@@ -269,10 +272,11 @@ var unicorn = (options = {}) => [
|
|
|
269
272
|
{
|
|
270
273
|
name: "ntnyq/unicorn",
|
|
271
274
|
plugins: {
|
|
272
|
-
unicorn:
|
|
275
|
+
unicorn: default11
|
|
273
276
|
},
|
|
274
277
|
rules: {
|
|
275
278
|
// Disabled for now
|
|
279
|
+
"unicorn/better-regex": "off",
|
|
276
280
|
"unicorn/prefer-top-level-await": "off",
|
|
277
281
|
"unicorn/explicit-length-check": "off",
|
|
278
282
|
"unicorn/no-array-callback-reference": "off",
|
|
@@ -287,7 +291,6 @@ var unicorn = (options = {}) => [
|
|
|
287
291
|
"unicorn/switch-case-braces": ["error", "avoid"],
|
|
288
292
|
"unicorn/no-typeof-undefined": "error",
|
|
289
293
|
"unicorn/prefer-set-size": "error",
|
|
290
|
-
"unicorn/better-regex": "error",
|
|
291
294
|
"unicorn/prefer-regexp-test": "error",
|
|
292
295
|
"unicorn/no-static-only-class": "error",
|
|
293
296
|
"unicorn/no-zero-fractions": "error",
|
|
@@ -347,7 +350,7 @@ var prettier = (options = {}) => [
|
|
|
347
350
|
{
|
|
348
351
|
name: "ntnyq/prettier",
|
|
349
352
|
plugins: {
|
|
350
|
-
prettier:
|
|
353
|
+
prettier: default13
|
|
351
354
|
},
|
|
352
355
|
rules: {
|
|
353
356
|
"vue/array-bracket-newline": "off",
|
|
@@ -387,7 +390,7 @@ var prettier = (options = {}) => [
|
|
|
387
390
|
"vue/space-infix-ops": "off",
|
|
388
391
|
"vue/space-unary-ops": "off",
|
|
389
392
|
"vue/template-curly-spacing": "off",
|
|
390
|
-
...
|
|
393
|
+
...default13.configs.recommended.rules,
|
|
391
394
|
"prettier/prettier": options.level || "warn",
|
|
392
395
|
// Overrides built-in rules
|
|
393
396
|
...options.overrides
|
|
@@ -400,7 +403,7 @@ var prettier = (options = {}) => [
|
|
|
400
403
|
name: "ntnyq/prettier/disabled",
|
|
401
404
|
files: [GLOB_TOML],
|
|
402
405
|
plugins: {
|
|
403
|
-
prettier:
|
|
406
|
+
prettier: default13
|
|
404
407
|
},
|
|
405
408
|
rules: {
|
|
406
409
|
"prettier/prettier": "off"
|
|
@@ -867,7 +870,7 @@ var unocss = (options = {}) => [
|
|
|
867
870
|
{
|
|
868
871
|
name: "ntnyq/unocss",
|
|
869
872
|
plugins: {
|
|
870
|
-
unocss:
|
|
873
|
+
unocss: default9
|
|
871
874
|
},
|
|
872
875
|
rules: {
|
|
873
876
|
"unocss/order": "error",
|
|
@@ -902,11 +905,11 @@ var vitest = (options = {}) => [
|
|
|
902
905
|
{
|
|
903
906
|
name: "ntnyq/vitest",
|
|
904
907
|
plugins: {
|
|
905
|
-
vitest:
|
|
908
|
+
vitest: default10
|
|
906
909
|
},
|
|
907
910
|
files: [GLOB_TEST],
|
|
908
911
|
rules: {
|
|
909
|
-
...
|
|
912
|
+
...default10.configs.recommended.rules,
|
|
910
913
|
// Overrides built-in rules
|
|
911
914
|
...options.overrides
|
|
912
915
|
}
|
|
@@ -1261,6 +1264,7 @@ var sortPackageJson = () => [
|
|
|
1261
1264
|
"publisher",
|
|
1262
1265
|
"name",
|
|
1263
1266
|
"displayName",
|
|
1267
|
+
"preview",
|
|
1264
1268
|
"type",
|
|
1265
1269
|
"version",
|
|
1266
1270
|
"private",
|
|
@@ -1525,37 +1529,46 @@ var jsonc = (options = {}) => [
|
|
|
1525
1529
|
];
|
|
1526
1530
|
|
|
1527
1531
|
// src/configs/markdown.ts
|
|
1528
|
-
var markdown = (options = {}) =>
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1532
|
+
var markdown = (options = {}) => {
|
|
1533
|
+
if (!Array.isArray(default8.configs?.processor)) return [];
|
|
1534
|
+
return [
|
|
1535
|
+
...default8.configs.processor.map((config) => ({
|
|
1536
|
+
...config,
|
|
1537
|
+
name: `ntnyq/${config.name}`
|
|
1538
|
+
})),
|
|
1539
|
+
{
|
|
1540
|
+
name: "ntnyq/markdown/disabled/code-blocks",
|
|
1541
|
+
files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
|
|
1542
|
+
rules: {
|
|
1543
|
+
"no-undef": "off",
|
|
1544
|
+
"no-alert": "off",
|
|
1545
|
+
"no-console": "off",
|
|
1546
|
+
"no-unused-vars": "off",
|
|
1547
|
+
"no-unused-expressions": "off",
|
|
1548
|
+
"no-restricted-imports": "off",
|
|
1549
|
+
"node/prefer-global/buffer": "off",
|
|
1550
|
+
"node/prefer-global/process": "off",
|
|
1551
|
+
"import/no-unresolved": "off",
|
|
1552
|
+
"unused-imports/no-unused-imports": "off",
|
|
1553
|
+
"unused-imports/no-unused-vars": "off",
|
|
1554
|
+
"@typescript-eslint/comma-dangle": "off",
|
|
1555
|
+
"@typescript-eslint/no-redeclare": "off",
|
|
1556
|
+
"@typescript-eslint/no-namespace": "off",
|
|
1557
|
+
"@typescript-eslint/no-unused-vars": "off",
|
|
1558
|
+
"@typescript-eslint/no-require-imports": "off",
|
|
1559
|
+
"@typescript-eslint/no-extraneous-class": "off",
|
|
1560
|
+
"@typescript-eslint/no-use-before-define": "off",
|
|
1561
|
+
"@typescript-eslint/no-unused-expressions": "off",
|
|
1562
|
+
"@typescript-eslint/consistent-type-imports": "off",
|
|
1563
|
+
// Overrides built-in rules
|
|
1564
|
+
...options.overrides
|
|
1565
|
+
}
|
|
1553
1566
|
}
|
|
1554
|
-
|
|
1555
|
-
|
|
1567
|
+
];
|
|
1568
|
+
};
|
|
1556
1569
|
|
|
1557
1570
|
// src/core.ts
|
|
1558
|
-
function ntnyq(options = {},
|
|
1571
|
+
function ntnyq(options = {}, userConfigs = []) {
|
|
1559
1572
|
const configs = [];
|
|
1560
1573
|
if (options.gitignore ?? true) {
|
|
1561
1574
|
configs.push(
|
|
@@ -1680,16 +1693,17 @@ function ntnyq(options = {}, customConfig = []) {
|
|
|
1680
1693
|
})
|
|
1681
1694
|
);
|
|
1682
1695
|
}
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
)
|
|
1691
|
-
|
|
1692
|
-
|
|
1696
|
+
const configPrettier = options.prettier ?? true ? prettier({
|
|
1697
|
+
...resolveSubOptions(options, "prettier"),
|
|
1698
|
+
overrides: getOverrides(options, "prettier")
|
|
1699
|
+
}) : [];
|
|
1700
|
+
const composer = new FlatConfigComposer();
|
|
1701
|
+
composer.append(
|
|
1702
|
+
...configs,
|
|
1703
|
+
...toArray(userConfigs),
|
|
1704
|
+
...configPrettier
|
|
1705
|
+
);
|
|
1706
|
+
return composer;
|
|
1693
1707
|
}
|
|
1694
1708
|
export {
|
|
1695
1709
|
GLOB_ALL_SRC,
|
|
@@ -1744,19 +1758,19 @@ export {
|
|
|
1744
1758
|
parserYaml,
|
|
1745
1759
|
perfectionist,
|
|
1746
1760
|
default16 as pluginComments,
|
|
1747
|
-
|
|
1761
|
+
default12 as pluginImport,
|
|
1748
1762
|
default7 as pluginJsdoc,
|
|
1749
1763
|
default6 as pluginJsonc,
|
|
1750
|
-
|
|
1764
|
+
default8 as pluginMarkdown,
|
|
1751
1765
|
default2 as pluginNode,
|
|
1752
1766
|
default14 as pluginPerfectionist,
|
|
1753
|
-
|
|
1767
|
+
default13 as pluginPrettier,
|
|
1754
1768
|
pluginRegexp,
|
|
1755
1769
|
default5 as pluginToml,
|
|
1756
|
-
|
|
1757
|
-
|
|
1770
|
+
default11 as pluginUnicorn,
|
|
1771
|
+
default9 as pluginUnoCSS,
|
|
1758
1772
|
default15 as pluginUnusedImports,
|
|
1759
|
-
|
|
1773
|
+
default10 as pluginVitest,
|
|
1760
1774
|
default3 as pluginVue,
|
|
1761
1775
|
default4 as pluginYaml,
|
|
1762
1776
|
prettier,
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.8",
|
|
5
5
|
"packageManager": "pnpm@9.9.0",
|
|
6
|
-
"description": "ESLint
|
|
6
|
+
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"eslint",
|
|
9
9
|
"eslint-config",
|
|
@@ -56,19 +56,18 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
59
|
-
"@eslint/js": "^9.
|
|
60
|
-
"@
|
|
59
|
+
"@eslint/js": "^9.10.0",
|
|
60
|
+
"@eslint/markdown": "^6.1.0",
|
|
61
61
|
"@unocss/eslint-plugin": "^0.62.3",
|
|
62
62
|
"@vitest/eslint-plugin": "^1.1.0",
|
|
63
63
|
"eslint-config-flat-gitignore": "^0.3.0",
|
|
64
|
-
"eslint-flat-config-utils": "^0.
|
|
65
|
-
"eslint-plugin-command": "^0.2.
|
|
64
|
+
"eslint-flat-config-utils": "^0.4.0",
|
|
65
|
+
"eslint-plugin-command": "^0.2.4",
|
|
66
66
|
"eslint-plugin-import-x": "^4.2.1",
|
|
67
67
|
"eslint-plugin-jsdoc": "^50.2.2",
|
|
68
68
|
"eslint-plugin-jsonc": "^2.16.0",
|
|
69
|
-
"eslint-plugin-markdown": "^5.1.0",
|
|
70
69
|
"eslint-plugin-n": "^17.10.2",
|
|
71
|
-
"eslint-plugin-perfectionist": "^3.
|
|
70
|
+
"eslint-plugin-perfectionist": "^3.5.0",
|
|
72
71
|
"eslint-plugin-prettier": "^5.2.1",
|
|
73
72
|
"eslint-plugin-regexp": "^2.6.0",
|
|
74
73
|
"eslint-plugin-toml": "^0.11.1",
|
|
@@ -89,8 +88,8 @@
|
|
|
89
88
|
"@ntnyq/prettier-config": "^1.21.2",
|
|
90
89
|
"@types/node": "^22.5.4",
|
|
91
90
|
"bumpp": "^9.5.2",
|
|
92
|
-
"eslint": "^9.
|
|
93
|
-
"eslint-typegen": "^0.3.
|
|
91
|
+
"eslint": "^9.10.0",
|
|
92
|
+
"eslint-typegen": "^0.3.2",
|
|
94
93
|
"husky": "^9.1.5",
|
|
95
94
|
"nano-staged": "^0.8.0",
|
|
96
95
|
"npm-run-all2": "^6.2.2",
|
|
@@ -101,7 +100,7 @@
|
|
|
101
100
|
"zx": "^8.1.5"
|
|
102
101
|
},
|
|
103
102
|
"engines": {
|
|
104
|
-
"node": ">=18.18"
|
|
103
|
+
"node": ">=18.18.0"
|
|
105
104
|
},
|
|
106
105
|
"prettier": "@ntnyq/prettier-config",
|
|
107
106
|
"nano-staged": {
|