@ivanmaxlogiudice/eslint-config 3.0.0-beta.3 → 3.0.0-beta.4
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.js +2 -2
- package/dist/index.d.ts +87 -35
- package/dist/index.js +743 -651
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,7 @@ import c from "picocolors";
|
|
|
11
11
|
// package.json
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "@ivanmaxlogiudice/eslint-config",
|
|
14
|
-
version: "3.0.0-beta.
|
|
14
|
+
version: "3.0.0-beta.4",
|
|
15
15
|
packageManager: "bun@1.1.24",
|
|
16
16
|
description: "Personal ESLint config",
|
|
17
17
|
type: "module",
|
|
@@ -246,7 +246,7 @@ async function updateEslintFiles(result) {
|
|
|
246
246
|
configLines.push(`unocss: true,`);
|
|
247
247
|
for (const framework of result.frameworks)
|
|
248
248
|
configLines.push(`${framework}: true,`);
|
|
249
|
-
const mainConfig = configLines.map((i) => `
|
|
249
|
+
const mainConfig = configLines.map((i) => ` ${i}`).join("\n");
|
|
250
250
|
const additionalConfig = [];
|
|
251
251
|
const eslintConfigContent = getEslintConfigContent(mainConfig, additionalConfig);
|
|
252
252
|
await fsp.writeFile(pathFlatConfig, eslintConfigContent);
|
package/dist/index.d.ts
CHANGED
|
@@ -13286,6 +13286,12 @@ type TypedFlatConfigItem = Omit<Linter.Config<Linter.RulesRecord & Rules>, 'plug
|
|
|
13286
13286
|
*/
|
|
13287
13287
|
plugins?: Record<string, any>;
|
|
13288
13288
|
};
|
|
13289
|
+
interface OptionsFiles {
|
|
13290
|
+
/**
|
|
13291
|
+
* Override the `files` option to provide custom globs.
|
|
13292
|
+
*/
|
|
13293
|
+
files?: string[];
|
|
13294
|
+
}
|
|
13289
13295
|
interface OptionsComponentExts {
|
|
13290
13296
|
/**
|
|
13291
13297
|
* Additional extensions for components.
|
|
@@ -13295,6 +13301,9 @@ interface OptionsComponentExts {
|
|
|
13295
13301
|
*/
|
|
13296
13302
|
componentExts?: string[];
|
|
13297
13303
|
}
|
|
13304
|
+
interface OptionsOverrides {
|
|
13305
|
+
overrides?: TypedFlatConfigItem['rules'];
|
|
13306
|
+
}
|
|
13298
13307
|
interface OptionsProjectType {
|
|
13299
13308
|
/**
|
|
13300
13309
|
* Type of the project. `lib` will enable more strict rules for libraries.
|
|
@@ -13303,7 +13312,10 @@ interface OptionsProjectType {
|
|
|
13303
13312
|
*/
|
|
13304
13313
|
type?: 'app' | 'lib';
|
|
13305
13314
|
}
|
|
13306
|
-
interface
|
|
13315
|
+
interface OptionsIsInEditor {
|
|
13316
|
+
isInEditor?: boolean;
|
|
13317
|
+
}
|
|
13318
|
+
interface OptionsUnoCSS extends OptionsOverrides {
|
|
13307
13319
|
/**
|
|
13308
13320
|
* Enable attributify support.
|
|
13309
13321
|
* @default false
|
|
@@ -13319,6 +13331,10 @@ interface OptionsHasTypeScript {
|
|
|
13319
13331
|
typescript?: boolean;
|
|
13320
13332
|
}
|
|
13321
13333
|
interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
13334
|
+
/**
|
|
13335
|
+
* Core rules. Can't be disabled.
|
|
13336
|
+
*/
|
|
13337
|
+
javascript?: OptionsOverrides;
|
|
13322
13338
|
/**
|
|
13323
13339
|
* Enable TypeScript support.
|
|
13324
13340
|
*
|
|
@@ -13326,26 +13342,52 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
13326
13342
|
*
|
|
13327
13343
|
* @default auto-detect based on the dependencies
|
|
13328
13344
|
*/
|
|
13329
|
-
typescript?: boolean;
|
|
13330
|
-
/**
|
|
13331
|
-
* Enable regexp rules.
|
|
13332
|
-
*
|
|
13333
|
-
* @see https://ota-meshi.github.io/eslint-plugin-regexp/
|
|
13334
|
-
* @default false
|
|
13335
|
-
*/
|
|
13336
|
-
regexp?: boolean;
|
|
13345
|
+
typescript?: boolean | OptionsOverrides;
|
|
13337
13346
|
/**
|
|
13338
13347
|
* Enable test support.
|
|
13339
13348
|
*
|
|
13340
13349
|
* @default true
|
|
13341
13350
|
*/
|
|
13342
|
-
test?: boolean;
|
|
13351
|
+
test?: boolean | OptionsOverrides;
|
|
13343
13352
|
/**
|
|
13344
13353
|
* Enable Vue support.
|
|
13345
13354
|
*
|
|
13346
13355
|
* @default auto-detect based on the dependencies
|
|
13347
13356
|
*/
|
|
13348
|
-
vue?: boolean;
|
|
13357
|
+
vue?: boolean | OptionsOverrides;
|
|
13358
|
+
/**
|
|
13359
|
+
* Enable JSONC support.
|
|
13360
|
+
*
|
|
13361
|
+
* @default true
|
|
13362
|
+
*/
|
|
13363
|
+
jsonc?: boolean | OptionsOverrides;
|
|
13364
|
+
/**
|
|
13365
|
+
* Enable YAML support.
|
|
13366
|
+
*
|
|
13367
|
+
* @default false
|
|
13368
|
+
*/
|
|
13369
|
+
yaml?: boolean | OptionsOverrides;
|
|
13370
|
+
/**
|
|
13371
|
+
* Enable linting for **code snippets** in Markdown.
|
|
13372
|
+
*
|
|
13373
|
+
* For formatting Markdown content.
|
|
13374
|
+
*
|
|
13375
|
+
* @default false
|
|
13376
|
+
*/
|
|
13377
|
+
markdown?: boolean | OptionsOverrides;
|
|
13378
|
+
/**
|
|
13379
|
+
* Enable stylistic rules.
|
|
13380
|
+
*
|
|
13381
|
+
* @see https://eslint.style/
|
|
13382
|
+
*/
|
|
13383
|
+
stylistic?: OptionsOverrides;
|
|
13384
|
+
/**
|
|
13385
|
+
* Enable regexp rules.
|
|
13386
|
+
*
|
|
13387
|
+
* @see https://ota-meshi.github.io/eslint-plugin-regexp/
|
|
13388
|
+
* @default false
|
|
13389
|
+
*/
|
|
13390
|
+
regexp?: boolean | OptionsOverrides;
|
|
13349
13391
|
/**
|
|
13350
13392
|
* Enable unocss rules.
|
|
13351
13393
|
*
|
|
@@ -13356,60 +13398,70 @@ interface OptionsConfig extends OptionsComponentExts, OptionsProjectType {
|
|
|
13356
13398
|
*/
|
|
13357
13399
|
unocss?: boolean | OptionsUnoCSS;
|
|
13358
13400
|
/**
|
|
13359
|
-
*
|
|
13401
|
+
* Control to disable some rules in editors.
|
|
13360
13402
|
*
|
|
13361
|
-
* @default
|
|
13403
|
+
* @default auto-detect based on the process.env
|
|
13362
13404
|
*/
|
|
13363
|
-
|
|
13405
|
+
isInEditor?: boolean;
|
|
13364
13406
|
/**
|
|
13365
|
-
*
|
|
13407
|
+
* Provide overrides for rules for each integration.
|
|
13366
13408
|
*
|
|
13367
|
-
* @
|
|
13409
|
+
* @deprecated use `overrides` option in each integration key instead
|
|
13368
13410
|
*/
|
|
13369
|
-
|
|
13411
|
+
overrides?: {
|
|
13412
|
+
stylistic?: TypedFlatConfigItem['rules'];
|
|
13413
|
+
javascript?: TypedFlatConfigItem['rules'];
|
|
13414
|
+
typescript?: TypedFlatConfigItem['rules'];
|
|
13415
|
+
test?: TypedFlatConfigItem['rules'];
|
|
13416
|
+
vue?: TypedFlatConfigItem['rules'];
|
|
13417
|
+
jsonc?: TypedFlatConfigItem['rules'];
|
|
13418
|
+
markdown?: TypedFlatConfigItem['rules'];
|
|
13419
|
+
yaml?: TypedFlatConfigItem['rules'];
|
|
13420
|
+
};
|
|
13370
13421
|
}
|
|
13371
13422
|
|
|
13372
13423
|
declare function config(options?: OptionsConfig, ...userConfigs: Awaitable<TypedFlatConfigItem | TypedFlatConfigItem[] | Linter.Config[]>[]): Promise<Linter.Config[]>;
|
|
13373
13424
|
type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
13374
13425
|
declare function resolveSubOptions<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): ResolvedOptions<OptionsConfig[K]>;
|
|
13426
|
+
declare function getOverrides<K extends keyof OptionsConfig>(options: OptionsConfig, key: K): Partial<Linter.RulesRecord & RuleOptions>;
|
|
13375
13427
|
|
|
13376
|
-
declare
|
|
13428
|
+
declare function comments(): TypedFlatConfigItem[];
|
|
13377
13429
|
|
|
13378
13430
|
declare function ignores(): TypedFlatConfigItem[];
|
|
13379
13431
|
|
|
13380
|
-
declare
|
|
13432
|
+
declare function imports(): TypedFlatConfigItem[];
|
|
13381
13433
|
|
|
13382
13434
|
declare const restrictedSyntaxJs: string[];
|
|
13383
|
-
declare
|
|
13435
|
+
declare function javascript(options?: OptionsIsInEditor & OptionsOverrides): TypedFlatConfigItem[];
|
|
13384
13436
|
|
|
13385
|
-
declare
|
|
13437
|
+
declare function jsdoc(): TypedFlatConfigItem[];
|
|
13386
13438
|
|
|
13387
|
-
declare
|
|
13439
|
+
declare function jsonc(options?: OptionsFiles & OptionsOverrides): TypedFlatConfigItem[];
|
|
13388
13440
|
|
|
13389
|
-
declare function markdown(options?: OptionsComponentExts): Promise<TypedFlatConfigItem[]>;
|
|
13441
|
+
declare function markdown(options?: OptionsFiles & OptionsOverrides & OptionsComponentExts): Promise<TypedFlatConfigItem[]>;
|
|
13390
13442
|
|
|
13391
|
-
declare
|
|
13443
|
+
declare function node(): TypedFlatConfigItem[];
|
|
13392
13444
|
|
|
13393
|
-
declare
|
|
13445
|
+
declare function perfectionist(): TypedFlatConfigItem[];
|
|
13394
13446
|
|
|
13395
|
-
declare function regexp(): Promise<TypedFlatConfigItem[]>;
|
|
13447
|
+
declare function regexp(options?: OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
13396
13448
|
|
|
13397
|
-
declare
|
|
13398
|
-
declare
|
|
13449
|
+
declare function sortPackageJson(): TypedFlatConfigItem[];
|
|
13450
|
+
declare function sortTsconfig(): TypedFlatConfigItem[];
|
|
13399
13451
|
|
|
13400
|
-
declare
|
|
13452
|
+
declare function stylistic(options?: OptionsOverrides): TypedFlatConfigItem[];
|
|
13401
13453
|
|
|
13402
|
-
declare function test(): Promise<TypedFlatConfigItem[]>;
|
|
13454
|
+
declare function test(options?: OptionsIsInEditor & OptionsFiles & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
13403
13455
|
|
|
13404
|
-
declare function typescript(options?: OptionsComponentExts & OptionsProjectType): TypedFlatConfigItem[];
|
|
13456
|
+
declare function typescript(options?: OptionsFiles & OptionsOverrides & OptionsComponentExts & OptionsProjectType): TypedFlatConfigItem[];
|
|
13405
13457
|
|
|
13406
|
-
declare
|
|
13458
|
+
declare function unicorn(): TypedFlatConfigItem[];
|
|
13407
13459
|
|
|
13408
13460
|
declare function unocss(options?: OptionsUnoCSS): Promise<TypedFlatConfigItem[]>;
|
|
13409
13461
|
|
|
13410
|
-
declare function vue(options?: OptionsHasTypeScript): Promise<TypedFlatConfigItem[]>;
|
|
13462
|
+
declare function vue(options?: OptionsFiles & OptionsOverrides & OptionsHasTypeScript): Promise<TypedFlatConfigItem[]>;
|
|
13411
13463
|
|
|
13412
|
-
declare function yaml(): Promise<TypedFlatConfigItem[]>;
|
|
13464
|
+
declare function yaml(options?: OptionsFiles & OptionsOverrides): Promise<TypedFlatConfigItem[]>;
|
|
13413
13465
|
|
|
13414
13466
|
declare const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
|
|
13415
13467
|
declare const GLOB_SRC = "**/*.?([cm])[jt]s?(x)";
|
|
@@ -13445,4 +13497,4 @@ declare function spawnAsync(command: string, args?: readonly string[], options?:
|
|
|
13445
13497
|
stderr: string;
|
|
13446
13498
|
}>;
|
|
13447
13499
|
|
|
13448
|
-
export { GLOB_ALL_SRC, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_VUE, GLOB_YAML, type ResolvedOptions, clearPackageCache, combine, comments, config, config as default, ensurePackages, findUp, hasSomePackage, ignores, imports, interopDefault, isInEditorEnv, javascript, jsdoc, jsonc, markdown, node, packageExists, perfectionist, regexp, renameRules, resolveSubOptions, restrictedSyntaxJs, sortPackageJson, sortTsconfig, spawnAsync, stylistic, test, typescript, unicorn, unocss, vue, yaml };
|
|
13500
|
+
export { GLOB_ALL_SRC, GLOB_EXCLUDE, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_SRC, GLOB_SRC_EXT, GLOB_TESTS, GLOB_TS, GLOB_VUE, GLOB_YAML, type ResolvedOptions, clearPackageCache, combine, comments, config, config as default, ensurePackages, findUp, getOverrides, hasSomePackage, ignores, imports, interopDefault, isInEditorEnv, javascript, jsdoc, jsonc, markdown, node, packageExists, perfectionist, regexp, renameRules, resolveSubOptions, restrictedSyntaxJs, sortPackageJson, sortTsconfig, spawnAsync, stylistic, test, typescript, unicorn, unocss, vue, yaml };
|