@eienjs/eslint-config 2.0.0 → 2.1.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/LICENSE +1 -1
- package/bin/index.mjs +3 -0
- package/dist/cli/{constants.js → constants.mjs} +3 -0
- package/dist/cli/{constants_generated.js → constants_generated.mjs} +7 -4
- package/dist/cli/index.d.mts +2 -0
- package/dist/cli/{index.js → index.mjs} +5 -2
- package/dist/cli/{run.js → run.mjs} +12 -9
- package/dist/cli/stages/{update_eslint_files.js → update_eslint_files.mjs} +4 -1
- package/dist/cli/stages/{update_package_json.js → update_package_json.mjs} +15 -13
- package/dist/cli/stages/{update_vscode_settings.js → update_vscode_settings.mjs} +5 -2
- package/dist/cli/{utils.js → utils.mjs} +3 -0
- package/dist/config_presets.d.mts +9 -0
- package/dist/{config_presets.js → config_presets.mjs} +3 -0
- package/dist/configs/adonisjs.d.mts +8 -0
- package/dist/configs/{adonisjs.js → adonisjs.mjs} +27 -24
- package/dist/configs/{astro.d.ts → astro.d.mts} +3 -1
- package/dist/configs/{astro.js → astro.mjs} +6 -3
- package/dist/configs/command.d.mts +8 -0
- package/dist/configs/{command.js → command.mjs} +3 -0
- package/dist/configs/comments.d.mts +8 -0
- package/dist/configs/{comments.js → comments.mjs} +4 -1
- package/dist/configs/disables.d.mts +8 -0
- package/dist/configs/{disables.js → disables.mjs} +4 -1
- package/dist/configs/e18e.d.mts +8 -0
- package/dist/configs/{e18e.js → e18e.mjs} +7 -4
- package/dist/configs/{formatters.d.ts → formatters.d.mts} +3 -1
- package/dist/configs/{formatters.js → formatters.mjs} +6 -3
- package/dist/configs/ignores.d.mts +8 -0
- package/dist/configs/{ignores.js → ignores.mjs} +6 -3
- package/dist/configs/{imports.d.ts → imports.d.mts} +3 -1
- package/dist/configs/{imports.js → imports.mjs} +5 -2
- package/dist/configs/index.d.mts +29 -0
- package/dist/configs/index.mjs +30 -0
- package/dist/configs/{javascript.d.ts → javascript.d.mts} +3 -1
- package/dist/configs/{javascript.js → javascript.mjs} +5 -7
- package/dist/configs/{jsdoc.d.ts → jsdoc.d.mts} +3 -1
- package/dist/configs/{jsdoc.js → jsdoc.mjs} +7 -4
- package/dist/configs/{jsonc.d.ts → jsonc.d.mts} +3 -1
- package/dist/configs/{jsonc.js → jsonc.mjs} +7 -4
- package/dist/configs/{markdown.d.ts → markdown.d.mts} +3 -1
- package/dist/configs/{markdown.js → markdown.mjs} +5 -2
- package/dist/configs/node.d.mts +8 -0
- package/dist/configs/{node.js → node.mjs} +5 -2
- package/dist/configs/{nuxt.d.ts → nuxt.d.mts} +3 -1
- package/dist/configs/{nuxt.js → nuxt.mjs} +18 -15
- package/dist/configs/{perfectionist.d.ts → perfectionist.d.mts} +3 -1
- package/dist/configs/{perfectionist.js → perfectionist.mjs} +4 -1
- package/dist/configs/pnpm.d.mts +8 -0
- package/dist/configs/{pnpm.js → pnpm.mjs} +6 -6
- package/dist/configs/{regexp.d.ts → regexp.d.mts} +3 -1
- package/dist/configs/{regexp.js → regexp.mjs} +3 -0
- package/dist/configs/{sort.d.ts → sort.d.mts} +3 -1
- package/dist/configs/{sort.js → sort.mjs} +3 -0
- package/dist/configs/{stylistic.d.ts → stylistic.d.mts} +3 -1
- package/dist/configs/{stylistic.js → stylistic.mjs} +5 -2
- package/dist/configs/{test.d.ts → test.d.mts} +3 -1
- package/dist/configs/{test.js → test.mjs} +5 -2
- package/dist/configs/{toml.d.ts → toml.d.mts} +3 -1
- package/dist/configs/{toml.js → toml.mjs} +7 -4
- package/dist/configs/{typescript.d.ts → typescript.d.mts} +3 -1
- package/dist/configs/{typescript.js → typescript.mjs} +17 -14
- package/dist/configs/unicorn.d.mts +8 -0
- package/dist/configs/unicorn.mjs +66 -0
- package/dist/configs/{vue.d.ts → vue.d.mts} +3 -1
- package/dist/configs/{vue.js → vue.mjs} +22 -11
- package/dist/configs/{yaml.d.ts → yaml.d.mts} +3 -1
- package/dist/configs/{yaml.js → yaml.mjs} +7 -4
- package/dist/{factory.d.ts → factory.d.mts} +4 -2
- package/dist/{factory.js → factory.mjs} +36 -33
- package/dist/{globs.d.ts → globs.d.mts} +2 -0
- package/dist/{globs.js → globs.mjs} +3 -0
- package/dist/{index.d.ts → index.d.mts} +9 -7
- package/dist/{index.js → index.mjs} +7 -4
- package/dist/node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/{index.js → index.mjs} +3 -0
- package/dist/package.mjs +7 -0
- package/dist/{plugins.js → plugins.mjs} +3 -0
- package/dist/{typegen.d.ts → typegen.d.mts} +1248 -218
- package/dist/{types.d.ts → types.d.mts} +14 -4
- package/dist/{utils.d.ts → utils.d.mts} +3 -1
- package/dist/{utils.js → utils.mjs} +4 -1
- package/dist/vendored/{prettier_types.d.ts → prettier_types.d.mts} +3 -1
- package/package.json +80 -49
- package/bin/index.js +0 -3
- package/dist/cli/index.d.ts +0 -1
- package/dist/config_presets.d.ts +0 -7
- package/dist/configs/adonisjs.d.ts +0 -6
- package/dist/configs/command.d.ts +0 -6
- package/dist/configs/comments.d.ts +0 -6
- package/dist/configs/disables.d.ts +0 -6
- package/dist/configs/e18e.d.ts +0 -6
- package/dist/configs/ignores.d.ts +0 -6
- package/dist/configs/index.d.ts +0 -27
- package/dist/configs/index.js +0 -27
- package/dist/configs/node.d.ts +0 -6
- package/dist/configs/pnpm.d.ts +0 -6
- package/dist/configs/unicorn.d.ts +0 -6
- package/dist/configs/unicorn.js +0 -40
- package/dist/package.js +0 -4
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import "./configs/
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { findUpSync } from "./node_modules/.pnpm/find-up-simple@1.0.1/node_modules/find-up-simple/index.mjs";
|
|
5
|
+
import { GLOB_MARKDOWN } from "./globs.mjs";
|
|
6
|
+
import { interopDefault, isInEditorEnv } from "./utils.mjs";
|
|
7
|
+
import { adonisjs } from "./configs/adonisjs.mjs";
|
|
8
|
+
import { astro } from "./configs/astro.mjs";
|
|
9
|
+
import { command } from "./configs/command.mjs";
|
|
10
|
+
import { comments } from "./configs/comments.mjs";
|
|
11
|
+
import { disables } from "./configs/disables.mjs";
|
|
12
|
+
import { e18e } from "./configs/e18e.mjs";
|
|
13
|
+
import { stylistic } from "./configs/stylistic.mjs";
|
|
14
|
+
import { formatters } from "./configs/formatters.mjs";
|
|
15
|
+
import { ignores } from "./configs/ignores.mjs";
|
|
16
|
+
import { imports } from "./configs/imports.mjs";
|
|
17
|
+
import { javascript } from "./configs/javascript.mjs";
|
|
18
|
+
import { jsdoc } from "./configs/jsdoc.mjs";
|
|
19
|
+
import { jsonc } from "./configs/jsonc.mjs";
|
|
20
|
+
import { markdown } from "./configs/markdown.mjs";
|
|
21
|
+
import { node } from "./configs/node.mjs";
|
|
22
|
+
import { nuxt } from "./configs/nuxt.mjs";
|
|
23
|
+
import { perfectionist } from "./configs/perfectionist.mjs";
|
|
24
|
+
import { pnpm } from "./configs/pnpm.mjs";
|
|
25
|
+
import { regexp } from "./configs/regexp.mjs";
|
|
26
|
+
import { sortPackageJson, sortTsconfig } from "./configs/sort.mjs";
|
|
27
|
+
import { test } from "./configs/test.mjs";
|
|
28
|
+
import { toml } from "./configs/toml.mjs";
|
|
29
|
+
import { typescript } from "./configs/typescript.mjs";
|
|
30
|
+
import { unicorn } from "./configs/unicorn.mjs";
|
|
31
|
+
import { vue } from "./configs/vue.mjs";
|
|
32
|
+
import { yaml } from "./configs/yaml.mjs";
|
|
33
|
+
import "./configs/index.mjs";
|
|
31
34
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
32
35
|
import { isPackageExists } from "local-pkg";
|
|
33
36
|
//#region src/factory.ts
|
|
@@ -80,7 +83,7 @@ function eienjs(options = {}) {
|
|
|
80
83
|
stylistic: stylisticOptions,
|
|
81
84
|
...resolveSubOptions(options, "imports")
|
|
82
85
|
}));
|
|
83
|
-
if (enableE18e) configs.push(e18e({ ...enableE18e
|
|
86
|
+
if (enableE18e) configs.push(e18e({ ...enableE18e !== true && enableE18e }));
|
|
84
87
|
if (enableUnicorn) configs.push(unicorn(enableUnicorn === true ? {} : enableUnicorn));
|
|
85
88
|
if (enableVue) componentExts.push("vue");
|
|
86
89
|
if (enableTypeScript) configs.push(typescript({
|
|
@@ -149,7 +152,7 @@ function eienjs(options = {}) {
|
|
|
149
152
|
"Place it in the second or later config instead."
|
|
150
153
|
].join(""));
|
|
151
154
|
const fusedConfig = flatConfigProps.reduce((acc, key) => {
|
|
152
|
-
if (key
|
|
155
|
+
if (Object.hasOwn(options, key)) acc[key] = options[key];
|
|
153
156
|
return acc;
|
|
154
157
|
}, {});
|
|
155
158
|
if (Object.keys(fusedConfig).length > 0) configs.push([fusedConfig]);
|
|
@@ -169,7 +172,7 @@ function resolveSubOptions(options, key) {
|
|
|
169
172
|
}
|
|
170
173
|
function getOverrides(options, key) {
|
|
171
174
|
const sub = resolveSubOptions(options, key);
|
|
172
|
-
return { ..."overrides" in sub
|
|
175
|
+
return { ..."overrides" in sub && sub.overrides };
|
|
173
176
|
}
|
|
174
177
|
//#endregion
|
|
175
178
|
export { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import __tsdown_shims_path from 'node:path';
|
|
2
|
+
import __tsdown_shims_url from 'node:url';
|
|
3
|
+
import { ConfigNames, RuleOptions } from "./typegen.mjs";
|
|
4
|
+
import { Awaitable, OptionsAdonisJS, OptionsComponentExts, OptionsConfig, OptionsE18e, OptionsErasableSyntaxOnly, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsMarkdown, OptionsNuxt, OptionsOverrides, OptionsPnpm, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsTypescriptWithErasableSyntaxOnly, OptionsUnicorn, OptionsVue, Rules, StylisticConfig, TypedFlatConfigItem } from "./types.mjs";
|
|
5
|
+
import { ResolvedOptions, defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions } from "./factory.mjs";
|
|
6
|
+
import { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON } from "./config_presets.mjs";
|
|
7
|
+
import { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML } from "./globs.mjs";
|
|
8
|
+
import { combine, ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, toArray } from "./utils.mjs";
|
|
9
|
+
export { type Awaitable, CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON, type ConfigNames, GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML, type OptionsAdonisJS, type OptionsComponentExts, type OptionsConfig, type OptionsE18e, type OptionsErasableSyntaxOnly, type OptionsFiles, type OptionsFormatters, type OptionsHasTypeScript, type OptionsIsInEditor, type OptionsMarkdown, type OptionsNuxt, type OptionsOverrides, type OptionsPnpm, type OptionsRegExp, type OptionsStylistic, type OptionsTypeScriptParserOptions, type OptionsTypeScriptWithTypes, type OptionsTypescript, type OptionsTypescriptWithErasableSyntaxOnly, type OptionsUnicorn, type OptionsVue, ResolvedOptions, type RuleOptions, type Rules, type StylisticConfig, type TypedFlatConfigItem, combine, eienjs as default, defaultPluginRenaming, eienjs, ensurePackages, getOverrides, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, resolveSubOptions, toArray };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import "node:path";
|
|
2
|
+
import "node:url";
|
|
3
|
+
import.meta.url;
|
|
4
|
+
import { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_EXCLUDE, GLOB_EXTS, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_IN_MARKDOWN, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVG, GLOB_TESTS, GLOB_TOML, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_XML, GLOB_YAML } from "./globs.mjs";
|
|
5
|
+
import { combine, ensurePackages, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, parserPlain, toArray } from "./utils.mjs";
|
|
6
|
+
import { defaultPluginRenaming, eienjs, getOverrides, resolveSubOptions } from "./factory.mjs";
|
|
7
|
+
import { CONFIG_PRESET_FULL_OFF, CONFIG_PRESET_FULL_ON } from "./config_presets.mjs";
|
|
5
8
|
//#region src/index.ts
|
|
6
9
|
var src_default = eienjs;
|
|
7
10
|
//#endregion
|
package/dist/package.mjs
ADDED