@eienjs/eslint-config 1.0.2 → 1.1.1
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/cli/index.d.ts +1 -1
- package/dist/cli/index.js +11 -10
- package/dist/configs/index.d.ts +13 -13
- package/dist/configs/index.js +1 -1
- package/dist/{configs-2UAjGCgy.js → configs-C3wibJFB.js} +28 -30
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/{types-Dox_r0zd.d.ts → types-BOQRnHTY.d.ts} +13 -4
- package/package.json +10 -10
package/dist/cli/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/dist/cli/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import parse from "parse-gitignore";
|
|
|
9
9
|
import { execSync } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.
|
|
12
|
+
var version = "1.1.1";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/cli/constants.ts
|
|
@@ -131,7 +131,7 @@ async function updateEslintFiles(result) {
|
|
|
131
131
|
p.log.success(c.green`Created ${configFileName}`);
|
|
132
132
|
const files = fs.readdirSync(cwd);
|
|
133
133
|
const legacyConfig = [];
|
|
134
|
-
for (const file of files) if (/eslint|prettier/.test(file) &&
|
|
134
|
+
for (const file of files) if (/eslint|prettier/.test(file) && !file.includes("eslint.config.")) legacyConfig.push(file);
|
|
135
135
|
if (legacyConfig.length > 0) p.note(c.dim(legacyConfig.join(", ")), "You can now remove those files manually");
|
|
136
136
|
}
|
|
137
137
|
|
|
@@ -173,7 +173,7 @@ async function updatePackageJson(result) {
|
|
|
173
173
|
}
|
|
174
174
|
for (const framework of result.frameworks) {
|
|
175
175
|
const deps = dependenciesMap[framework];
|
|
176
|
-
if (deps) for (const f of deps) {
|
|
176
|
+
if (deps.length > 0) for (const f of deps) {
|
|
177
177
|
pkg.devDependencies[f] = versionsMap[f];
|
|
178
178
|
addedPackages.push(f);
|
|
179
179
|
}
|
|
@@ -208,8 +208,8 @@ async function updateVscodeSettings(result) {
|
|
|
208
208
|
//#region src/cli/run.ts
|
|
209
209
|
async function run(options = {}) {
|
|
210
210
|
const argSkipPrompt = Boolean(process.env.SKIP_PROMPT) || options.yes;
|
|
211
|
-
const argTemplate = options.frameworks?.map((m) => m
|
|
212
|
-
const argExtra = options.extra?.map((m) => m
|
|
211
|
+
const argTemplate = options.frameworks?.map((m) => m.trim()).filter(Boolean);
|
|
212
|
+
const argExtra = options.extra?.map((m) => m.trim()).filter(Boolean);
|
|
213
213
|
if (fs.existsSync(path.join(process.cwd(), "eslint.config.js"))) {
|
|
214
214
|
p.log.warn(c.yellow`eslint.config.js already exists, migration wizard exited.`);
|
|
215
215
|
return process.exit(1);
|
|
@@ -223,16 +223,16 @@ async function run(options = {}) {
|
|
|
223
223
|
if (!argSkipPrompt) {
|
|
224
224
|
result = await p.group({
|
|
225
225
|
uncommittedConfirmed: async () => {
|
|
226
|
-
if (
|
|
226
|
+
if (isGitClean()) return true;
|
|
227
227
|
return p.confirm({
|
|
228
228
|
initialValue: false,
|
|
229
229
|
message: "There are uncommitted changes in the current repository, are you sure to continue?"
|
|
230
230
|
});
|
|
231
231
|
},
|
|
232
232
|
frameworks: async ({ results }) => {
|
|
233
|
-
const isArgTemplateValid = typeof argTemplate === "string" &&
|
|
233
|
+
const isArgTemplateValid = typeof argTemplate === "string" && frameworks.includes(argTemplate);
|
|
234
234
|
if (!results.uncommittedConfirmed || isArgTemplateValid) return;
|
|
235
|
-
const message =
|
|
235
|
+
const message = argTemplate ? `"${argTemplate.toString()}" isn't a valid template. Please choose from below: ` : "Select a framework:";
|
|
236
236
|
return p.multiselect({
|
|
237
237
|
message: c.reset(message),
|
|
238
238
|
options: frameworkOptions,
|
|
@@ -242,7 +242,7 @@ async function run(options = {}) {
|
|
|
242
242
|
extra: async ({ results }) => {
|
|
243
243
|
const isArgExtraValid = argExtra?.length && argExtra.filter((element) => !extra.includes(element)).length === 0;
|
|
244
244
|
if (!results.uncommittedConfirmed || isArgExtraValid) return;
|
|
245
|
-
const message =
|
|
245
|
+
const message = argExtra ? `"${argExtra.toString()}" isn't a valid extra util. Please choose from below: ` : "Select a extra utils:";
|
|
246
246
|
return p.multiselect({
|
|
247
247
|
message: c.reset(message),
|
|
248
248
|
options: extraOptions,
|
|
@@ -290,4 +290,5 @@ cli.help();
|
|
|
290
290
|
cli.version(version);
|
|
291
291
|
cli.parse();
|
|
292
292
|
|
|
293
|
-
//#endregion
|
|
293
|
+
//#endregion
|
|
294
|
+
export { };
|
package/dist/configs/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OptionsAdonisJS, OptionsComponentExts, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsNuxt, OptionsOverrides, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsVue, StylisticConfig, TypedFlatConfigItem } from "../types-
|
|
1
|
+
import { OptionsAdonisJS, OptionsComponentExts, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsNuxt, OptionsOverrides, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsVue, StylisticConfig, TypedFlatConfigItem } from "../types-BOQRnHTY.js";
|
|
2
2
|
|
|
3
3
|
//#region src/configs/adonisjs.d.ts
|
|
4
4
|
declare function adonisjs(options?: OptionsAdonisJS): Promise<TypedFlatConfigItem[]>;
|
|
@@ -7,25 +7,25 @@ declare function adonisjs(options?: OptionsAdonisJS): Promise<TypedFlatConfigIte
|
|
|
7
7
|
declare function astro(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/configs/command.d.ts
|
|
10
|
-
declare function command():
|
|
10
|
+
declare function command(): TypedFlatConfigItem[];
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/configs/comments.d.ts
|
|
13
|
-
declare function comments():
|
|
13
|
+
declare function comments(): TypedFlatConfigItem[];
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/configs/disables.d.ts
|
|
16
|
-
declare function disables():
|
|
16
|
+
declare function disables(): TypedFlatConfigItem[];
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region src/configs/formatters.d.ts
|
|
19
19
|
declare function formatters(options?: OptionsFormatters | true, stylistic?: StylisticConfig): Promise<TypedFlatConfigItem[]>;
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region src/configs/ignores.d.ts
|
|
22
|
-
declare function ignores(userIgnores?: string[]):
|
|
22
|
+
declare function ignores(userIgnores?: string[]): TypedFlatConfigItem[];
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/configs/imports.d.ts
|
|
25
|
-
declare function imports(options?: OptionsOverrides & OptionsStylistic):
|
|
25
|
+
declare function imports(options?: OptionsOverrides & OptionsStylistic): TypedFlatConfigItem[];
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region src/configs/javascript.d.ts
|
|
28
|
-
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides):
|
|
28
|
+
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): TypedFlatConfigItem[];
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/configs/jsdoc.d.ts
|
|
31
31
|
declare function jsdoc(options?: OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
@@ -37,7 +37,7 @@ declare function jsonc(options?: OptionsFiles & OptionsStylistic & OptionsOverri
|
|
|
37
37
|
declare function markdown(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/configs/node.d.ts
|
|
40
|
-
declare function node():
|
|
40
|
+
declare function node(): TypedFlatConfigItem[];
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/configs/nuxt.d.ts
|
|
43
43
|
declare function nuxt(options?: OptionsNuxt & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
@@ -48,13 +48,13 @@ declare function nuxt(options?: OptionsNuxt & OptionsStylistic): Promise<TypedFl
|
|
|
48
48
|
*
|
|
49
49
|
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
50
50
|
*/
|
|
51
|
-
declare function perfectionist():
|
|
51
|
+
declare function perfectionist(): TypedFlatConfigItem[];
|
|
52
52
|
//#endregion
|
|
53
53
|
//#region src/configs/pnpm.d.ts
|
|
54
54
|
declare function pnpm(): Promise<TypedFlatConfigItem[]>;
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/configs/regexp.d.ts
|
|
57
|
-
declare function regexp(options?: OptionsRegExp & OptionsOverrides):
|
|
57
|
+
declare function regexp(options?: OptionsRegExp & OptionsOverrides): TypedFlatConfigItem[];
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/configs/sort.d.ts
|
|
60
60
|
/**
|
|
@@ -62,7 +62,7 @@ declare function regexp(options?: OptionsRegExp & OptionsOverrides): Promise<Typ
|
|
|
62
62
|
*
|
|
63
63
|
* Requires `jsonc` config
|
|
64
64
|
*/
|
|
65
|
-
declare function sortPackageJson():
|
|
65
|
+
declare function sortPackageJson(): TypedFlatConfigItem[];
|
|
66
66
|
/**
|
|
67
67
|
* Sort tsconfig.json
|
|
68
68
|
*
|
|
@@ -82,10 +82,10 @@ declare function test(options?: OptionsFiles & OptionsIsInEditor & OptionsOverri
|
|
|
82
82
|
declare function toml(options?: OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/configs/typescript.d.ts
|
|
85
|
-
declare function typescript(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions): Promise<TypedFlatConfigItem[]>;
|
|
85
|
+
declare function typescript(options?: OptionsFiles & OptionsComponentExts & OptionsOverrides & OptionsTypeScriptWithTypes & OptionsTypeScriptParserOptions & OptionsStylistic): Promise<TypedFlatConfigItem[]>;
|
|
86
86
|
//#endregion
|
|
87
87
|
//#region src/configs/unicorn.d.ts
|
|
88
|
-
declare function unicorn(options?: OptionsOverrides):
|
|
88
|
+
declare function unicorn(options?: OptionsOverrides): TypedFlatConfigItem[];
|
|
89
89
|
//#endregion
|
|
90
90
|
//#region src/configs/vue.d.ts
|
|
91
91
|
declare function vue(options?: OptionsVue & OptionsHasTypeScript & OptionsOverrides & OptionsStylistic & OptionsFiles): Promise<TypedFlatConfigItem[]>;
|
package/dist/configs/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StylisticConfigDefaults, adonisjs, astro, command, comments, disables, formatters, ignores, imports, javascript, jsdoc, jsonc, markdown, node, nuxt, perfectionist, pnpm, regexp, sortPackageJson, sortTsconfig, stylistic, test, toml, typescript, unicorn, vue, yaml } from "../configs-
|
|
1
|
+
import { StylisticConfigDefaults, adonisjs, astro, command, comments, disables, formatters, ignores, imports, javascript, jsdoc, jsonc, markdown, node, nuxt, perfectionist, pnpm, regexp, sortPackageJson, sortTsconfig, stylistic, test, toml, typescript, unicorn, vue, yaml } from "../configs-C3wibJFB.js";
|
|
2
2
|
|
|
3
3
|
export { StylisticConfigDefaults, adonisjs, astro, command, comments, disables, formatters, ignores, imports, javascript, jsdoc, jsonc, markdown, node, nuxt, perfectionist, pnpm, regexp, sortPackageJson, sortTsconfig, stylistic, test, toml, typescript, unicorn, vue, yaml };
|
|
@@ -142,7 +142,7 @@ function isPackageInScope(name) {
|
|
|
142
142
|
return isPackageExists(name, { paths: [scopeUrl] });
|
|
143
143
|
}
|
|
144
144
|
async function ensurePackages(packages) {
|
|
145
|
-
if (process.env.CI || process.stdout.isTTY
|
|
145
|
+
if (process.env.CI || !process.stdout.isTTY || !isCwdInScope) return;
|
|
146
146
|
const nonExistingPackages = packages.filter((i) => i && !isPackageInScope(i));
|
|
147
147
|
if (nonExistingPackages.length === 0) return;
|
|
148
148
|
const p = await import("@clack/prompts");
|
|
@@ -318,7 +318,7 @@ async function astro(options = {}) {
|
|
|
318
318
|
|
|
319
319
|
//#endregion
|
|
320
320
|
//#region src/configs/command.ts
|
|
321
|
-
|
|
321
|
+
function command() {
|
|
322
322
|
return [{
|
|
323
323
|
...createCommand(),
|
|
324
324
|
name: "eienjs/command/rules"
|
|
@@ -327,7 +327,7 @@ async function command() {
|
|
|
327
327
|
|
|
328
328
|
//#endregion
|
|
329
329
|
//#region src/configs/comments.ts
|
|
330
|
-
|
|
330
|
+
function comments() {
|
|
331
331
|
return [{
|
|
332
332
|
name: "eienjs/eslint-comments/rules",
|
|
333
333
|
plugins: { "@eslint-community/eslint-comments": pluginComments },
|
|
@@ -343,7 +343,7 @@ async function comments() {
|
|
|
343
343
|
|
|
344
344
|
//#endregion
|
|
345
345
|
//#region src/configs/disables.ts
|
|
346
|
-
|
|
346
|
+
function disables() {
|
|
347
347
|
return [
|
|
348
348
|
{
|
|
349
349
|
files: [`**/scripts/${GLOB_SRC}`],
|
|
@@ -351,7 +351,8 @@ async function disables() {
|
|
|
351
351
|
rules: {
|
|
352
352
|
"antfu/no-top-level-await": "off",
|
|
353
353
|
"no-console": "off",
|
|
354
|
-
"@typescript-eslint/explicit-function-return-type": "off"
|
|
354
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
355
|
+
"@typescript-eslint/no-deprecated": "off"
|
|
355
356
|
}
|
|
356
357
|
},
|
|
357
358
|
{
|
|
@@ -360,7 +361,8 @@ async function disables() {
|
|
|
360
361
|
rules: {
|
|
361
362
|
"antfu/no-top-level-await": "off",
|
|
362
363
|
"no-console": "off",
|
|
363
|
-
"unicorn/no-process-exit": "off"
|
|
364
|
+
"unicorn/no-process-exit": "off",
|
|
365
|
+
"@typescript-eslint/no-unnecessary-condition": "off"
|
|
364
366
|
}
|
|
365
367
|
},
|
|
366
368
|
{
|
|
@@ -624,7 +626,7 @@ async function formatters(options = {}, stylistic$1 = {}) {
|
|
|
624
626
|
|
|
625
627
|
//#endregion
|
|
626
628
|
//#region src/configs/ignores.ts
|
|
627
|
-
|
|
629
|
+
function ignores(userIgnores = []) {
|
|
628
630
|
return [{
|
|
629
631
|
ignores: [...GLOB_EXCLUDE, ...userIgnores],
|
|
630
632
|
name: "eienjs/ignores"
|
|
@@ -633,7 +635,7 @@ async function ignores(userIgnores = []) {
|
|
|
633
635
|
|
|
634
636
|
//#endregion
|
|
635
637
|
//#region src/configs/imports.ts
|
|
636
|
-
|
|
638
|
+
function imports(options = {}) {
|
|
637
639
|
const { overrides = {}, stylistic: stylistic$1 = true } = options;
|
|
638
640
|
return [{
|
|
639
641
|
name: "eienjs/imports/rules",
|
|
@@ -658,23 +660,19 @@ async function imports(options = {}) {
|
|
|
658
660
|
|
|
659
661
|
//#endregion
|
|
660
662
|
//#region src/configs/javascript.ts
|
|
661
|
-
|
|
663
|
+
function javascript(options = {}) {
|
|
662
664
|
const { isInEditor = false, overrides = {} } = options;
|
|
663
665
|
return [{
|
|
664
666
|
languageOptions: {
|
|
665
|
-
ecmaVersion: 2022,
|
|
666
667
|
globals: {
|
|
667
668
|
...globals.browser,
|
|
668
|
-
...globals.
|
|
669
|
+
...globals.es2025,
|
|
669
670
|
...globals.node,
|
|
670
671
|
document: "readonly",
|
|
671
672
|
navigator: "readonly",
|
|
672
673
|
window: "readonly"
|
|
673
674
|
},
|
|
674
|
-
parserOptions: {
|
|
675
|
-
ecmaVersion: 2022,
|
|
676
|
-
sourceType: "module"
|
|
677
|
-
},
|
|
675
|
+
parserOptions: { sourceType: "module" },
|
|
678
676
|
sourceType: "module"
|
|
679
677
|
},
|
|
680
678
|
linterOptions: { reportUnusedDisableDirectives: true },
|
|
@@ -892,10 +890,7 @@ async function javascript(options = {}) {
|
|
|
892
890
|
],
|
|
893
891
|
"one-var": ["error", { initialized: "never" }],
|
|
894
892
|
"operator-assignment": ["error", "always"],
|
|
895
|
-
"prefer-arrow-callback":
|
|
896
|
-
allowNamedFunctions: false,
|
|
897
|
-
allowUnboundThis: true
|
|
898
|
-
}],
|
|
893
|
+
"prefer-arrow-callback": "off",
|
|
899
894
|
"prefer-const": [isInEditor ? "warn" : "error", {
|
|
900
895
|
destructuring: "all",
|
|
901
896
|
ignoreReadBeforeAssign: true
|
|
@@ -1106,7 +1101,7 @@ async function markdown(options = {}) {
|
|
|
1106
1101
|
|
|
1107
1102
|
//#endregion
|
|
1108
1103
|
//#region src/configs/node.ts
|
|
1109
|
-
|
|
1104
|
+
function node() {
|
|
1110
1105
|
return [{
|
|
1111
1106
|
name: "eienjs/node/rules",
|
|
1112
1107
|
plugins: { n: pluginNode },
|
|
@@ -1143,9 +1138,9 @@ async function nuxt(options = {}) {
|
|
|
1143
1138
|
dirs.utils = dirs.utils ?? dirs.src.map((src) => `${src}/utils`);
|
|
1144
1139
|
dirs.componentsPrefixed = dirs.componentsPrefixed ?? [];
|
|
1145
1140
|
const fileSingleRoot = [
|
|
1146
|
-
...dirs.layouts
|
|
1147
|
-
...dirs.pages
|
|
1148
|
-
...dirs.components
|
|
1141
|
+
...dirs.layouts.map((layoutsDir) => join(layoutsDir, `**/*.${GLOB_EXTS}`)),
|
|
1142
|
+
...dirs.pages.map((pagesDir) => join(pagesDir, `**/*.${GLOB_EXTS}`)),
|
|
1143
|
+
...dirs.components.map((componentsDir) => join(componentsDir, `**/*.server.${GLOB_EXTS}`))
|
|
1149
1144
|
].sort();
|
|
1150
1145
|
const INLINE_ELEMENTS = [
|
|
1151
1146
|
"a",
|
|
@@ -1262,7 +1257,7 @@ async function nuxt(options = {}) {
|
|
|
1262
1257
|
*
|
|
1263
1258
|
* @see https://github.com/azat-io/eslint-plugin-perfectionist
|
|
1264
1259
|
*/
|
|
1265
|
-
|
|
1260
|
+
function perfectionist() {
|
|
1266
1261
|
return [{
|
|
1267
1262
|
name: "eienjs/perfectionist/setup",
|
|
1268
1263
|
plugins: { perfectionist: pluginPerfectionist },
|
|
@@ -1340,7 +1335,7 @@ async function pnpm() {
|
|
|
1340
1335
|
|
|
1341
1336
|
//#endregion
|
|
1342
1337
|
//#region src/configs/regexp.ts
|
|
1343
|
-
|
|
1338
|
+
function regexp(options = {}) {
|
|
1344
1339
|
const config = configs["flat/recommended"];
|
|
1345
1340
|
const rules = { ...config.rules };
|
|
1346
1341
|
if (options.level === "warn") {
|
|
@@ -1363,7 +1358,7 @@ async function regexp(options = {}) {
|
|
|
1363
1358
|
*
|
|
1364
1359
|
* Requires `jsonc` config
|
|
1365
1360
|
*/
|
|
1366
|
-
|
|
1361
|
+
function sortPackageJson() {
|
|
1367
1362
|
return [{
|
|
1368
1363
|
files: ["**/package.json"],
|
|
1369
1364
|
name: "eienjs/sort/package-json",
|
|
@@ -1668,7 +1663,7 @@ async function toml(options = {}) {
|
|
|
1668
1663
|
//#endregion
|
|
1669
1664
|
//#region src/configs/typescript.ts
|
|
1670
1665
|
async function typescript(options = {}) {
|
|
1671
|
-
const { componentExts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {} } = options;
|
|
1666
|
+
const { componentExts = [], overrides = {}, overridesTypeAware = {}, parserOptions = {}, stylistic: stylistic$1 = true } = options;
|
|
1672
1667
|
const files = options.files ?? [
|
|
1673
1668
|
GLOB_TS,
|
|
1674
1669
|
GLOB_TSX,
|
|
@@ -1676,7 +1671,7 @@ async function typescript(options = {}) {
|
|
|
1676
1671
|
];
|
|
1677
1672
|
const filesTypeAware = options.filesTypeAware ?? [GLOB_TS, GLOB_TSX];
|
|
1678
1673
|
const ignoresTypeAware = options.ignoresTypeAware ?? [`${GLOB_MARKDOWN}/**`, GLOB_ASTRO_TS];
|
|
1679
|
-
const tsconfigPath = options
|
|
1674
|
+
const tsconfigPath = options.tsconfigPath ?? void 0;
|
|
1680
1675
|
const isTypeAware = Boolean(tsconfigPath);
|
|
1681
1676
|
const typeAwareRules = {
|
|
1682
1677
|
"dot-notation": "off",
|
|
@@ -1794,8 +1789,9 @@ async function typescript(options = {}) {
|
|
|
1794
1789
|
files,
|
|
1795
1790
|
name: "eienjs/typescript/rules",
|
|
1796
1791
|
rules: {
|
|
1797
|
-
...pluginTs.configs["eslint-recommended"].overrides[0].rules,
|
|
1792
|
+
...pluginTs.configs["eslint-recommended"].overrides?.[0].rules,
|
|
1798
1793
|
...pluginTs.configs.strict.rules,
|
|
1794
|
+
...stylistic$1 ? pluginTs.configs.stylistic.rules : {},
|
|
1799
1795
|
"no-dupe-class-members": "off",
|
|
1800
1796
|
"no-redeclare": "off",
|
|
1801
1797
|
"no-use-before-define": "off",
|
|
@@ -1843,6 +1839,8 @@ async function typescript(options = {}) {
|
|
|
1843
1839
|
ignores: ignoresTypeAware,
|
|
1844
1840
|
name: "eienjs/typescript/rules-type-aware",
|
|
1845
1841
|
rules: {
|
|
1842
|
+
...pluginTs.configs["strict-type-checked"].rules,
|
|
1843
|
+
...stylistic$1 ? pluginTs.configs["stylistic-type-checked"].rules : {},
|
|
1846
1844
|
...typeAwareRules,
|
|
1847
1845
|
...overridesTypeAware
|
|
1848
1846
|
}
|
|
@@ -1852,7 +1850,7 @@ async function typescript(options = {}) {
|
|
|
1852
1850
|
|
|
1853
1851
|
//#endregion
|
|
1854
1852
|
//#region src/configs/unicorn.ts
|
|
1855
|
-
|
|
1853
|
+
function unicorn(options = {}) {
|
|
1856
1854
|
const { overrides = {} } = options;
|
|
1857
1855
|
return [{
|
|
1858
1856
|
name: "eienjs/unicorn/rules",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Awaitable, ConfigNames, OptionsAdonisJS, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsNuxt, OptionsOverrides, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsVue, RuleOptions, Rules, StylisticConfig, TypedFlatConfigItem } from "./types-
|
|
1
|
+
import { Awaitable, ConfigNames, OptionsAdonisJS, OptionsComponentExts, OptionsConfig, OptionsFiles, OptionsFormatters, OptionsHasTypeScript, OptionsIsInEditor, OptionsNuxt, OptionsOverrides, OptionsRegExp, OptionsStylistic, OptionsTypeScriptParserOptions, OptionsTypeScriptWithTypes, OptionsTypescript, OptionsVue, RuleOptions, Rules, StylisticConfig, TypedFlatConfigItem } from "./types-BOQRnHTY.js";
|
|
2
2
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
3
|
import { Linter } from "eslint";
|
|
4
4
|
|
|
@@ -11,7 +11,7 @@ declare const defaultPluginRenaming: {
|
|
|
11
11
|
declare function eienjs(options?: OptionsConfig & Omit<TypedFlatConfigItem, 'files'>): FlatConfigComposer<TypedFlatConfigItem, ConfigNames>;
|
|
12
12
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
13
13
|
declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
|
|
14
|
-
declare function getOverrides
|
|
14
|
+
declare function getOverrides(options: OptionsConfig, key: keyof OptionsConfig): Partial<Linter.RulesRecord & RuleOptions>;
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/globs.d.ts
|
|
17
17
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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, adonisjs, astro, combine, command, comments, disables, ensurePackages, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, markdown, node, nuxt, parserPlain, perfectionist, pnpm, regexp, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, vue, yaml } from "./configs-
|
|
1
|
+
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, adonisjs, astro, combine, command, comments, disables, ensurePackages, formatters, ignores, imports, interopDefault, isInEditorEnv, isInGitHooksOrLintStaged, isPackageInScope, javascript, jsdoc, jsonc, markdown, node, nuxt, parserPlain, perfectionist, pnpm, regexp, sortPackageJson, sortTsconfig, stylistic, test, toArray, toml, typescript, unicorn, vue, yaml } from "./configs-C3wibJFB.js";
|
|
2
2
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
3
3
|
import { isPackageExists } from "local-pkg";
|
|
4
4
|
|
|
@@ -54,6 +54,7 @@ function eienjs(options = {}) {
|
|
|
54
54
|
if (enableTypeScript) configs.push(typescript({
|
|
55
55
|
...typescriptOptions,
|
|
56
56
|
componentExts,
|
|
57
|
+
stylistic: stylisticOptions,
|
|
57
58
|
overrides: getOverrides(options, "typescript")
|
|
58
59
|
}));
|
|
59
60
|
if (stylisticOptions) configs.push(stylistic({
|
|
@@ -11235,10 +11235,17 @@ type NoRestrictedExports = [] | [({
|
|
|
11235
11235
|
};
|
|
11236
11236
|
})];
|
|
11237
11237
|
// ----- no-restricted-globals -----
|
|
11238
|
-
type NoRestrictedGlobals = (string | {
|
|
11238
|
+
type NoRestrictedGlobals = ((string | {
|
|
11239
11239
|
name: string;
|
|
11240
11240
|
message?: string;
|
|
11241
|
-
})[]
|
|
11241
|
+
})[] | [] | [{
|
|
11242
|
+
globals: (string | {
|
|
11243
|
+
name: string;
|
|
11244
|
+
message?: string;
|
|
11245
|
+
})[];
|
|
11246
|
+
checkGlobalObject?: boolean;
|
|
11247
|
+
globalObjects?: string[];
|
|
11248
|
+
}]);
|
|
11242
11249
|
// ----- no-restricted-imports -----
|
|
11243
11250
|
type NoRestrictedImports = ((string | {
|
|
11244
11251
|
name: string;
|
|
@@ -11466,6 +11473,8 @@ type OneVar = [] | [(("always" | "never" | "consecutive") | {
|
|
|
11466
11473
|
var?: ("always" | "never" | "consecutive");
|
|
11467
11474
|
let?: ("always" | "never" | "consecutive");
|
|
11468
11475
|
const?: ("always" | "never" | "consecutive");
|
|
11476
|
+
using?: ("always" | "never" | "consecutive");
|
|
11477
|
+
awaitUsing?: ("always" | "never" | "consecutive");
|
|
11469
11478
|
} | {
|
|
11470
11479
|
initialized?: ("always" | "never" | "consecutive");
|
|
11471
11480
|
uninitialized?: ("always" | "never" | "consecutive");
|
|
@@ -15448,7 +15457,7 @@ interface VendoredPrettierOptionsRequired {
|
|
|
15448
15457
|
/**
|
|
15449
15458
|
* Provide ability to support new languages to prettier.
|
|
15450
15459
|
*/
|
|
15451
|
-
plugins:
|
|
15460
|
+
plugins: unknown[];
|
|
15452
15461
|
/**
|
|
15453
15462
|
* How to handle whitespaces in HTML.
|
|
15454
15463
|
* @default "css"
|
|
@@ -15498,7 +15507,7 @@ interface VendoredPrettierOptionsRequired {
|
|
|
15498
15507
|
//#endregion
|
|
15499
15508
|
//#region src/types.d.ts
|
|
15500
15509
|
type Awaitable<T> = T | Promise<T>;
|
|
15501
|
-
type Rules = Record<string, Linter.RuleEntry
|
|
15510
|
+
type Rules = Record<string, Linter.RuleEntry | undefined> & RuleOptions;
|
|
15502
15511
|
/**
|
|
15503
15512
|
* An updated version of ESLint's `Linter.Config`, which provides autocompletion
|
|
15504
15513
|
* for `rules` and relaxes type limitations for `plugins` and `rules`, because
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eienjs/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.1",
|
|
5
5
|
"description": "EienJS ESLint Config",
|
|
6
6
|
"author": "Fernando Isidro <luffynando@gmail.com> (https://github.com/luffynando/)",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"engines": {
|
|
33
|
-
"node": ">=20.
|
|
33
|
+
"node": ">=20.19"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@adonisjs/eslint-plugin": "^2.0.1",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"@clack/prompts": "^0.11.0",
|
|
71
71
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
72
72
|
"@eslint/markdown": "^7.1.0",
|
|
73
|
-
"@stylistic/eslint-plugin": "^5.2.
|
|
74
|
-
"@typescript-eslint/eslint-plugin": "^8.39.
|
|
75
|
-
"@typescript-eslint/parser": "^8.39.
|
|
73
|
+
"@stylistic/eslint-plugin": "^5.2.3",
|
|
74
|
+
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
|
75
|
+
"@typescript-eslint/parser": "^8.39.1",
|
|
76
76
|
"@vitest/eslint-plugin": "^1.3.4",
|
|
77
77
|
"ansis": "^4.1.0",
|
|
78
78
|
"cac": "^6.7.14",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
89
89
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
90
90
|
"eslint-plugin-pnpm": "^1.1.0",
|
|
91
|
-
"eslint-plugin-regexp": "^2.
|
|
91
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
92
92
|
"eslint-plugin-toml": "^0.12.0",
|
|
93
93
|
"eslint-plugin-unicorn": "^60.0.0",
|
|
94
94
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
@@ -108,10 +108,10 @@
|
|
|
108
108
|
"@adonisjs/eslint-plugin": "^2.0.1",
|
|
109
109
|
"@commitlint/cli": "^19.8.1",
|
|
110
110
|
"@commitlint/config-conventional": "^19.8.1",
|
|
111
|
-
"@eslint/config-inspector": "^1.
|
|
111
|
+
"@eslint/config-inspector": "^1.2.0",
|
|
112
112
|
"@nuxt/eslint-plugin": "^1.8.0",
|
|
113
113
|
"@prettier/plugin-xml": "^3.4.2",
|
|
114
|
-
"@types/node": "^22.17.
|
|
114
|
+
"@types/node": "^22.17.1",
|
|
115
115
|
"astro-eslint-parser": "^1.2.2",
|
|
116
116
|
"auto-changelog": "^2.5.0",
|
|
117
117
|
"eslint": "^9.32.0",
|
|
@@ -121,8 +121,8 @@
|
|
|
121
121
|
"husky": "^9.1.7",
|
|
122
122
|
"np": "^10.2.0",
|
|
123
123
|
"prettier-plugin-astro": "^0.14.1",
|
|
124
|
-
"tsdown": "^0.
|
|
125
|
-
"tsx": "^4.20.
|
|
124
|
+
"tsdown": "^0.14.1",
|
|
125
|
+
"tsx": "^4.20.4",
|
|
126
126
|
"typescript": "^5.9.2"
|
|
127
127
|
},
|
|
128
128
|
"resolutions": {
|