@ntnyq/eslint-config 3.0.0-beta.5 → 3.0.0-beta.7
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 +31 -9
- package/dist/index.d.cts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +30 -9
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -60,6 +60,7 @@ __export(src_exports, {
|
|
|
60
60
|
command: () => command,
|
|
61
61
|
comments: () => comments,
|
|
62
62
|
getOverrides: () => getOverrides,
|
|
63
|
+
gitignore: () => gitignore,
|
|
63
64
|
hasTypeScript: () => hasTypeScript,
|
|
64
65
|
hasUnoCSS: () => hasUnoCSS,
|
|
65
66
|
hasVitest: () => hasVitest,
|
|
@@ -391,6 +392,7 @@ var unicorn = (options = {}) => [
|
|
|
391
392
|
},
|
|
392
393
|
rules: {
|
|
393
394
|
// Disabled for now
|
|
395
|
+
"unicorn/better-regex": "off",
|
|
394
396
|
"unicorn/prefer-top-level-await": "off",
|
|
395
397
|
"unicorn/explicit-length-check": "off",
|
|
396
398
|
"unicorn/no-array-callback-reference": "off",
|
|
@@ -405,7 +407,6 @@ var unicorn = (options = {}) => [
|
|
|
405
407
|
"unicorn/switch-case-braces": ["error", "avoid"],
|
|
406
408
|
"unicorn/no-typeof-undefined": "error",
|
|
407
409
|
"unicorn/prefer-set-size": "error",
|
|
408
|
-
"unicorn/better-regex": "error",
|
|
409
410
|
"unicorn/prefer-regexp-test": "error",
|
|
410
411
|
"unicorn/no-static-only-class": "error",
|
|
411
412
|
"unicorn/no-zero-fractions": "error",
|
|
@@ -997,11 +998,20 @@ var unocss = (options = {}) => [
|
|
|
997
998
|
}
|
|
998
999
|
];
|
|
999
1000
|
|
|
1001
|
+
// src/configs/gitignore.ts
|
|
1002
|
+
var import_eslint_config_flat_gitignore = __toESM(require("eslint-config-flat-gitignore"), 1);
|
|
1003
|
+
var gitignore = (options = {}) => [
|
|
1004
|
+
{
|
|
1005
|
+
...(0, import_eslint_config_flat_gitignore.default)(options),
|
|
1006
|
+
name: "ntnyq/gitignore"
|
|
1007
|
+
}
|
|
1008
|
+
];
|
|
1009
|
+
|
|
1000
1010
|
// src/configs/command.ts
|
|
1001
1011
|
var import_config = __toESM(require("eslint-plugin-command/config"), 1);
|
|
1002
|
-
var command = () => [
|
|
1012
|
+
var command = (options = {}) => [
|
|
1003
1013
|
{
|
|
1004
|
-
...(0, import_config.default)(),
|
|
1014
|
+
...(0, import_config.default)(options),
|
|
1005
1015
|
name: "ntnyq/command"
|
|
1006
1016
|
}
|
|
1007
1017
|
];
|
|
@@ -1370,6 +1380,7 @@ var sortPackageJson = () => [
|
|
|
1370
1380
|
"publisher",
|
|
1371
1381
|
"name",
|
|
1372
1382
|
"displayName",
|
|
1383
|
+
"preview",
|
|
1373
1384
|
"type",
|
|
1374
1385
|
"version",
|
|
1375
1386
|
"private",
|
|
@@ -1574,6 +1585,7 @@ var sortTsConfig = () => [
|
|
|
1574
1585
|
];
|
|
1575
1586
|
var sortI18nLocale = () => [
|
|
1576
1587
|
{
|
|
1588
|
+
name: "ntnyq/sort/i18n-locale",
|
|
1577
1589
|
files: ["**/{locales,i18n}/*.json", "**/{locales,i18n}/*.y?(a)ml"],
|
|
1578
1590
|
rules: {
|
|
1579
1591
|
"jsonc/sort-keys": [
|
|
@@ -1664,10 +1676,15 @@ var markdown = (options = {}) => [
|
|
|
1664
1676
|
|
|
1665
1677
|
// src/core.ts
|
|
1666
1678
|
function ntnyq(options = {}, customConfig = []) {
|
|
1667
|
-
const configs = [
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1679
|
+
const configs = [];
|
|
1680
|
+
if (options.gitignore ?? true) {
|
|
1681
|
+
configs.push(
|
|
1682
|
+
...gitignore({
|
|
1683
|
+
...resolveSubOptions(options, "gitignore")
|
|
1684
|
+
})
|
|
1685
|
+
);
|
|
1686
|
+
}
|
|
1687
|
+
configs.push(
|
|
1671
1688
|
...ignores(options.ignores),
|
|
1672
1689
|
...jsx(),
|
|
1673
1690
|
...node({
|
|
@@ -1680,7 +1697,7 @@ function ntnyq(options = {}, customConfig = []) {
|
|
|
1680
1697
|
...resolveSubOptions(options, "javascript"),
|
|
1681
1698
|
overrides: getOverrides(options, "javascript")
|
|
1682
1699
|
})
|
|
1683
|
-
|
|
1700
|
+
);
|
|
1684
1701
|
if (options.unicorn ?? true) {
|
|
1685
1702
|
configs.push(
|
|
1686
1703
|
...unicorn({
|
|
@@ -1777,7 +1794,11 @@ function ntnyq(options = {}, customConfig = []) {
|
|
|
1777
1794
|
);
|
|
1778
1795
|
}
|
|
1779
1796
|
if (options.command ?? true) {
|
|
1780
|
-
configs.push(
|
|
1797
|
+
configs.push(
|
|
1798
|
+
...command({
|
|
1799
|
+
...resolveSubOptions(options, "command")
|
|
1800
|
+
})
|
|
1801
|
+
);
|
|
1781
1802
|
}
|
|
1782
1803
|
configs.push(...toArray(customConfig));
|
|
1783
1804
|
if (options.prettier ?? true) {
|
|
@@ -1822,6 +1843,7 @@ function ntnyq(options = {}, customConfig = []) {
|
|
|
1822
1843
|
command,
|
|
1823
1844
|
comments,
|
|
1824
1845
|
getOverrides,
|
|
1846
|
+
gitignore,
|
|
1825
1847
|
hasTypeScript,
|
|
1826
1848
|
hasUnoCSS,
|
|
1827
1849
|
hasVitest,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
|
+
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
|
+
import { ESLintPluginCommandOptions } from 'eslint-plugin-command/types';
|
|
2
4
|
export { default as tseslint } from 'typescript-eslint';
|
|
3
5
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
4
6
|
export { eslintPluginRegexp as pluginRegexp };
|
|
@@ -8861,7 +8863,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8861
8863
|
markers?: string[];
|
|
8862
8864
|
}
|
|
8863
8865
|
];
|
|
8864
|
-
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | '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/extensions' | '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';
|
|
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/extensions' | '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';
|
|
8865
8867
|
|
|
8866
8868
|
/**
|
|
8867
8869
|
* Typed flat config item
|
|
@@ -8894,6 +8896,8 @@ interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigI
|
|
|
8894
8896
|
overrides?: Rules;
|
|
8895
8897
|
}
|
|
8896
8898
|
type ConfigIgnoresOptions = string[];
|
|
8899
|
+
type ConfigGitIgnoreOptions = FlatGitignoreOptions;
|
|
8900
|
+
type ConfigCommandOptions = ESLintPluginCommandOptions;
|
|
8897
8901
|
interface ConfigJsdocOptions extends OptionsOverrides {
|
|
8898
8902
|
}
|
|
8899
8903
|
interface ConfigUnoCSSOptions extends OptionsOverrides {
|
|
@@ -8960,11 +8964,12 @@ interface ConfigUnusedImportsOptions extends OptionsOverrides {
|
|
|
8960
8964
|
* Config factory options
|
|
8961
8965
|
*/
|
|
8962
8966
|
interface ConfigOptions {
|
|
8963
|
-
command?: boolean;
|
|
8964
8967
|
sortTsConfig?: boolean;
|
|
8965
8968
|
sortI18nLocale?: boolean;
|
|
8966
8969
|
sortPackageJson?: boolean;
|
|
8967
8970
|
ignores?: ConfigIgnoresOptions;
|
|
8971
|
+
command?: boolean | ConfigCommandOptions;
|
|
8972
|
+
gitignore?: boolean | ConfigGitIgnoreOptions;
|
|
8968
8973
|
imports?: ConfigImportsOptions;
|
|
8969
8974
|
javascript?: ConfigJavaScriptOptions;
|
|
8970
8975
|
typescript?: ConfigTypeScriptOptions;
|
|
@@ -9087,7 +9092,9 @@ declare const regexp: (options?: ConfigRegexpOptions) => TypedConfigItem[];
|
|
|
9087
9092
|
|
|
9088
9093
|
declare const unocss: (options?: ConfigUnoCSSOptions) => TypedConfigItem[];
|
|
9089
9094
|
|
|
9090
|
-
declare const
|
|
9095
|
+
declare const gitignore: (options?: ConfigGitIgnoreOptions) => TypedConfigItem[];
|
|
9096
|
+
|
|
9097
|
+
declare const command: (options?: ConfigCommandOptions) => TypedConfigItem[];
|
|
9091
9098
|
|
|
9092
9099
|
declare const vitest: (options?: ConfigVitestOptions) => TypedConfigItem[];
|
|
9093
9100
|
|
|
@@ -9105,4 +9112,4 @@ declare const jsonc: (options?: ConfigJsoncOptions) => TypedConfigItem[];
|
|
|
9105
9112
|
|
|
9106
9113
|
declare const markdown: (options?: ConfigMarkdownOptions) => TypedConfigItem[];
|
|
9107
9114
|
|
|
9108
|
-
export { type Arrayable, type Awaitable, type ConfigCommentsOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigName, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVitestOptions, type ConfigVueOptions, type ConfigYmlOptions, 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_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsFiles, type OptionsOverrides, type ParserOptions, type ResolvedOptions, type RuleOptions, type TypedConfigItem, command, comments, getOverrides, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortI18nLocale, sortPackageJson, sortTsConfig, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|
|
9115
|
+
export { type Arrayable, type Awaitable, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigName, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVitestOptions, type ConfigVueOptions, type ConfigYmlOptions, 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_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsFiles, type OptionsOverrides, type ParserOptions, type ResolvedOptions, type RuleOptions, type TypedConfigItem, command, comments, getOverrides, gitignore, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortI18nLocale, sortPackageJson, sortTsConfig, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Linter } from 'eslint';
|
|
2
|
+
import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
|
|
3
|
+
import { ESLintPluginCommandOptions } from 'eslint-plugin-command/types';
|
|
2
4
|
export { default as tseslint } from 'typescript-eslint';
|
|
3
5
|
import * as eslintPluginRegexp from 'eslint-plugin-regexp';
|
|
4
6
|
export { eslintPluginRegexp as pluginRegexp };
|
|
@@ -8861,7 +8863,7 @@ type YmlSpacedComment = [] | [("always" | "never")] | [
|
|
|
8861
8863
|
markers?: string[];
|
|
8862
8864
|
}
|
|
8863
8865
|
];
|
|
8864
|
-
type ConfigName = 'ntnyq/command' | 'ntnyq/eslint-comments' | 'ntnyq/ignores' | 'ntnyq/imports' | '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/extensions' | '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';
|
|
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/extensions' | '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';
|
|
8865
8867
|
|
|
8866
8868
|
/**
|
|
8867
8869
|
* Typed flat config item
|
|
@@ -8894,6 +8896,8 @@ interface OptionsOverrides<Rules extends TypedConfigItem['rules'] = TypedConfigI
|
|
|
8894
8896
|
overrides?: Rules;
|
|
8895
8897
|
}
|
|
8896
8898
|
type ConfigIgnoresOptions = string[];
|
|
8899
|
+
type ConfigGitIgnoreOptions = FlatGitignoreOptions;
|
|
8900
|
+
type ConfigCommandOptions = ESLintPluginCommandOptions;
|
|
8897
8901
|
interface ConfigJsdocOptions extends OptionsOverrides {
|
|
8898
8902
|
}
|
|
8899
8903
|
interface ConfigUnoCSSOptions extends OptionsOverrides {
|
|
@@ -8960,11 +8964,12 @@ interface ConfigUnusedImportsOptions extends OptionsOverrides {
|
|
|
8960
8964
|
* Config factory options
|
|
8961
8965
|
*/
|
|
8962
8966
|
interface ConfigOptions {
|
|
8963
|
-
command?: boolean;
|
|
8964
8967
|
sortTsConfig?: boolean;
|
|
8965
8968
|
sortI18nLocale?: boolean;
|
|
8966
8969
|
sortPackageJson?: boolean;
|
|
8967
8970
|
ignores?: ConfigIgnoresOptions;
|
|
8971
|
+
command?: boolean | ConfigCommandOptions;
|
|
8972
|
+
gitignore?: boolean | ConfigGitIgnoreOptions;
|
|
8968
8973
|
imports?: ConfigImportsOptions;
|
|
8969
8974
|
javascript?: ConfigJavaScriptOptions;
|
|
8970
8975
|
typescript?: ConfigTypeScriptOptions;
|
|
@@ -9087,7 +9092,9 @@ declare const regexp: (options?: ConfigRegexpOptions) => TypedConfigItem[];
|
|
|
9087
9092
|
|
|
9088
9093
|
declare const unocss: (options?: ConfigUnoCSSOptions) => TypedConfigItem[];
|
|
9089
9094
|
|
|
9090
|
-
declare const
|
|
9095
|
+
declare const gitignore: (options?: ConfigGitIgnoreOptions) => TypedConfigItem[];
|
|
9096
|
+
|
|
9097
|
+
declare const command: (options?: ConfigCommandOptions) => TypedConfigItem[];
|
|
9091
9098
|
|
|
9092
9099
|
declare const vitest: (options?: ConfigVitestOptions) => TypedConfigItem[];
|
|
9093
9100
|
|
|
@@ -9105,4 +9112,4 @@ declare const jsonc: (options?: ConfigJsoncOptions) => TypedConfigItem[];
|
|
|
9105
9112
|
|
|
9106
9113
|
declare const markdown: (options?: ConfigMarkdownOptions) => TypedConfigItem[];
|
|
9107
9114
|
|
|
9108
|
-
export { type Arrayable, type Awaitable, type ConfigCommentsOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigName, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVitestOptions, type ConfigVueOptions, type ConfigYmlOptions, 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_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsFiles, type OptionsOverrides, type ParserOptions, type ResolvedOptions, type RuleOptions, type TypedConfigItem, command, comments, getOverrides, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortI18nLocale, sortPackageJson, sortTsConfig, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|
|
9115
|
+
export { type Arrayable, type Awaitable, type ConfigCommandOptions, type ConfigCommentsOptions, type ConfigGitIgnoreOptions, type ConfigIgnoresOptions, type ConfigImportsOptions, type ConfigJavaScriptOptions, type ConfigJsdocOptions, type ConfigJsoncOptions, type ConfigMarkdownOptions, type ConfigName, type ConfigNodeOptions, type ConfigOptions, type ConfigPerfectionistOptions, type ConfigPrettierOptions, type ConfigRegexpOptions, type ConfigTomlOptions, type ConfigTypeScriptOptions, type ConfigUnicornOptions, type ConfigUnoCSSOptions, type ConfigUnusedImportsOptions, type ConfigVitestOptions, type ConfigVueOptions, type ConfigYmlOptions, 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_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropModuleDefault, type OptionsFiles, type OptionsOverrides, type ParserOptions, type ResolvedOptions, type RuleOptions, type TypedConfigItem, command, comments, getOverrides, gitignore, hasTypeScript, hasUnoCSS, hasVitest, hasVue, ignores, imports, interopDefault, javascript, jsdoc, jsonc, jsx, loadPlugin, markdown, node, ntnyq, perfectionist, prettier, regexp, resolveSubOptions, sortI18nLocale, sortPackageJson, sortTsConfig, toArray, toml, typescript, typescriptCore, unicorn, unocss, unusedImports, vitest, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -273,6 +273,7 @@ var unicorn = (options = {}) => [
|
|
|
273
273
|
},
|
|
274
274
|
rules: {
|
|
275
275
|
// Disabled for now
|
|
276
|
+
"unicorn/better-regex": "off",
|
|
276
277
|
"unicorn/prefer-top-level-await": "off",
|
|
277
278
|
"unicorn/explicit-length-check": "off",
|
|
278
279
|
"unicorn/no-array-callback-reference": "off",
|
|
@@ -287,7 +288,6 @@ var unicorn = (options = {}) => [
|
|
|
287
288
|
"unicorn/switch-case-braces": ["error", "avoid"],
|
|
288
289
|
"unicorn/no-typeof-undefined": "error",
|
|
289
290
|
"unicorn/prefer-set-size": "error",
|
|
290
|
-
"unicorn/better-regex": "error",
|
|
291
291
|
"unicorn/prefer-regexp-test": "error",
|
|
292
292
|
"unicorn/no-static-only-class": "error",
|
|
293
293
|
"unicorn/no-zero-fractions": "error",
|
|
@@ -879,11 +879,20 @@ var unocss = (options = {}) => [
|
|
|
879
879
|
}
|
|
880
880
|
];
|
|
881
881
|
|
|
882
|
+
// src/configs/gitignore.ts
|
|
883
|
+
import createGitIgnore from "eslint-config-flat-gitignore";
|
|
884
|
+
var gitignore = (options = {}) => [
|
|
885
|
+
{
|
|
886
|
+
...createGitIgnore(options),
|
|
887
|
+
name: "ntnyq/gitignore"
|
|
888
|
+
}
|
|
889
|
+
];
|
|
890
|
+
|
|
882
891
|
// src/configs/command.ts
|
|
883
892
|
import createCommandPlugin from "eslint-plugin-command/config";
|
|
884
|
-
var command = () => [
|
|
893
|
+
var command = (options = {}) => [
|
|
885
894
|
{
|
|
886
|
-
...createCommandPlugin(),
|
|
895
|
+
...createCommandPlugin(options),
|
|
887
896
|
name: "ntnyq/command"
|
|
888
897
|
}
|
|
889
898
|
];
|
|
@@ -1252,6 +1261,7 @@ var sortPackageJson = () => [
|
|
|
1252
1261
|
"publisher",
|
|
1253
1262
|
"name",
|
|
1254
1263
|
"displayName",
|
|
1264
|
+
"preview",
|
|
1255
1265
|
"type",
|
|
1256
1266
|
"version",
|
|
1257
1267
|
"private",
|
|
@@ -1456,6 +1466,7 @@ var sortTsConfig = () => [
|
|
|
1456
1466
|
];
|
|
1457
1467
|
var sortI18nLocale = () => [
|
|
1458
1468
|
{
|
|
1469
|
+
name: "ntnyq/sort/i18n-locale",
|
|
1459
1470
|
files: ["**/{locales,i18n}/*.json", "**/{locales,i18n}/*.y?(a)ml"],
|
|
1460
1471
|
rules: {
|
|
1461
1472
|
"jsonc/sort-keys": [
|
|
@@ -1546,10 +1557,15 @@ var markdown = (options = {}) => [
|
|
|
1546
1557
|
|
|
1547
1558
|
// src/core.ts
|
|
1548
1559
|
function ntnyq(options = {}, customConfig = []) {
|
|
1549
|
-
const configs = [
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1560
|
+
const configs = [];
|
|
1561
|
+
if (options.gitignore ?? true) {
|
|
1562
|
+
configs.push(
|
|
1563
|
+
...gitignore({
|
|
1564
|
+
...resolveSubOptions(options, "gitignore")
|
|
1565
|
+
})
|
|
1566
|
+
);
|
|
1567
|
+
}
|
|
1568
|
+
configs.push(
|
|
1553
1569
|
...ignores(options.ignores),
|
|
1554
1570
|
...jsx(),
|
|
1555
1571
|
...node({
|
|
@@ -1562,7 +1578,7 @@ function ntnyq(options = {}, customConfig = []) {
|
|
|
1562
1578
|
...resolveSubOptions(options, "javascript"),
|
|
1563
1579
|
overrides: getOverrides(options, "javascript")
|
|
1564
1580
|
})
|
|
1565
|
-
|
|
1581
|
+
);
|
|
1566
1582
|
if (options.unicorn ?? true) {
|
|
1567
1583
|
configs.push(
|
|
1568
1584
|
...unicorn({
|
|
@@ -1659,7 +1675,11 @@ function ntnyq(options = {}, customConfig = []) {
|
|
|
1659
1675
|
);
|
|
1660
1676
|
}
|
|
1661
1677
|
if (options.command ?? true) {
|
|
1662
|
-
configs.push(
|
|
1678
|
+
configs.push(
|
|
1679
|
+
...command({
|
|
1680
|
+
...resolveSubOptions(options, "command")
|
|
1681
|
+
})
|
|
1682
|
+
);
|
|
1663
1683
|
}
|
|
1664
1684
|
configs.push(...toArray(customConfig));
|
|
1665
1685
|
if (options.prettier ?? true) {
|
|
@@ -1703,6 +1723,7 @@ export {
|
|
|
1703
1723
|
command,
|
|
1704
1724
|
comments,
|
|
1705
1725
|
getOverrides,
|
|
1726
|
+
gitignore,
|
|
1706
1727
|
hasTypeScript,
|
|
1707
1728
|
hasUnoCSS,
|
|
1708
1729
|
hasVitest,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.7",
|
|
5
5
|
"packageManager": "pnpm@9.9.0",
|
|
6
6
|
"description": "ESLint flat config of ntnyq",
|
|
7
7
|
"keywords": [
|
|
@@ -56,10 +56,10 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.0",
|
|
59
|
-
"@eslint/js": "^9.
|
|
60
|
-
"@types/eslint": "^9.6.1",
|
|
59
|
+
"@eslint/js": "^9.10.0",
|
|
61
60
|
"@unocss/eslint-plugin": "^0.62.3",
|
|
62
61
|
"@vitest/eslint-plugin": "^1.1.0",
|
|
62
|
+
"eslint-config-flat-gitignore": "^0.3.0",
|
|
63
63
|
"eslint-flat-config-utils": "^0.3.1",
|
|
64
64
|
"eslint-plugin-command": "^0.2.3",
|
|
65
65
|
"eslint-plugin-import-x": "^4.2.1",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"@ntnyq/prettier-config": "^1.21.2",
|
|
89
89
|
"@types/node": "^22.5.4",
|
|
90
90
|
"bumpp": "^9.5.2",
|
|
91
|
-
"eslint": "^9.
|
|
91
|
+
"eslint": "^9.10.0",
|
|
92
92
|
"eslint-typegen": "^0.3.1",
|
|
93
93
|
"husky": "^9.1.5",
|
|
94
94
|
"nano-staged": "^0.8.0",
|