@fabdeh/eslint-config 0.8.0-beta.2 → 0.8.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/index.d.ts +4 -2
- package/dist/index.js +8 -6
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -15113,7 +15113,8 @@ interface CreateProjectConfigOptions extends IgnoresOptions, ProjectTypeOptions
|
|
|
15113
15113
|
/**
|
|
15114
15114
|
* Enable or disable JSDoc rules.
|
|
15115
15115
|
*
|
|
15116
|
-
* @default true
|
|
15116
|
+
* @default true if `type` property is set to `lib`, otherwise false.
|
|
15117
|
+
* @see type
|
|
15117
15118
|
*/
|
|
15118
15119
|
jsdoc?: boolean;
|
|
15119
15120
|
/**
|
|
@@ -15201,9 +15202,10 @@ declare function formatters(options?: FormattersOptions | true, stylistic?: Styl
|
|
|
15201
15202
|
* Generates a configuration array for ESLint with default and user-defined ignore patterns.
|
|
15202
15203
|
*
|
|
15203
15204
|
* @param userIgnores - An array of user-defined glob patterns to ignore. Defaults to an empty array.
|
|
15205
|
+
* @param fromFactory - An optional suffix to add to the config name.
|
|
15204
15206
|
* @returns A TypedConfigArray object containing the combined "ignore" patterns.
|
|
15205
15207
|
*/
|
|
15206
|
-
declare function ignores(userIgnores?: string[]): TypedConfigArray;
|
|
15208
|
+
declare function ignores(userIgnores?: string[], fromFactory?: "project" | "workspace"): TypedConfigArray;
|
|
15207
15209
|
//#endregion
|
|
15208
15210
|
//#region src/configs/imports.d.ts
|
|
15209
15211
|
/**
|
package/dist/index.js
CHANGED
|
@@ -603,12 +603,13 @@ async function formatters(options = {}, stylistic$1 = {}, hasAngularTemplatePars
|
|
|
603
603
|
* Generates a configuration array for ESLint with default and user-defined ignore patterns.
|
|
604
604
|
*
|
|
605
605
|
* @param userIgnores - An array of user-defined glob patterns to ignore. Defaults to an empty array.
|
|
606
|
+
* @param fromFactory - An optional suffix to add to the config name.
|
|
606
607
|
* @returns A TypedConfigArray object containing the combined "ignore" patterns.
|
|
607
608
|
*/
|
|
608
|
-
function ignores(userIgnores = []) {
|
|
609
|
+
function ignores(userIgnores = [], fromFactory) {
|
|
609
610
|
return tseslint.config({
|
|
610
|
-
name:
|
|
611
|
-
ignores: [
|
|
611
|
+
name: `fabdeh/ignores${fromFactory ? `/${fromFactory}` : ""}`,
|
|
612
|
+
ignores: [...!fromFactory || fromFactory === "workspace" ? GLOB_EXCLUDE : [], ...userIgnores]
|
|
612
613
|
});
|
|
613
614
|
}
|
|
614
615
|
|
|
@@ -2284,9 +2285,10 @@ const OPTIONS_SYMBOL = Symbol("options");
|
|
|
2284
2285
|
async function defineProjectConfig(baseConfig, options = {}, ...userConfigs) {
|
|
2285
2286
|
const resolvedBaseConfig = await baseConfig;
|
|
2286
2287
|
const workspaceOptions = resolvedBaseConfig[OPTIONS_SYMBOL];
|
|
2287
|
-
const { angular: enableAngular = isPackageExists("@angular/core"), jsdoc: enableJsdoc =
|
|
2288
|
+
const { angular: enableAngular = isPackageExists("@angular/core"), jsdoc: enableJsdoc = options.type === "lib", ngrx: enableNgrx = NGRX_PACKAGES.some((p) => isPackageExists(p)), tailwindcss: enableTailwind = false, typescript: typescriptOptions, vitest: enableVitest = isPackageExists("vitest") } = options;
|
|
2288
2289
|
if (enableNgrx && !enableAngular) throw new Error("NgRx rules can only be enabled if Angular rules are also enabled.");
|
|
2289
2290
|
const configs$1 = [];
|
|
2291
|
+
if (options.ignores && options.ignores.length > 0) configs$1.push(ignores(options.ignores));
|
|
2290
2292
|
if (enableJsdoc) {
|
|
2291
2293
|
const stylisticOptions = workspaceOptions.stylistic === false ? false : typeof workspaceOptions.stylistic === "object" ? workspaceOptions.stylistic : {};
|
|
2292
2294
|
configs$1.push(jsdoc({ stylistic: stylisticOptions }));
|
|
@@ -2340,7 +2342,7 @@ async function defineProjectConfig(baseConfig, options = {}, ...userConfigs) {
|
|
|
2340
2342
|
* ```
|
|
2341
2343
|
*/
|
|
2342
2344
|
async function defineConfig(options = {}, ...userConfigs) {
|
|
2343
|
-
const { angular: enableAngular = isPackageExists("@angular/core"), gitignore: enableGitignore = true, jsdoc: enableJsdoc =
|
|
2345
|
+
const { angular: enableAngular = isPackageExists("@angular/core"), gitignore: enableGitignore = true, jsdoc: enableJsdoc = options.type === "lib", ngrx: enableNgrx = NGRX_PACKAGES.some((p) => isPackageExists(p)), pnpm: enableCatalogs = false, regexp: enableRegexp = true, tailwindcss: enableTailwind = false, typescript: enableTypescript = isPackageExists("typescript"), unicorn: enableUnicorn = true, vitest: enableVitest = isPackageExists("vitest") } = options;
|
|
2344
2346
|
if (enableNgrx && !enableAngular) throw new Error("NgRx rules can only be enabled if Angular rules are also enabled.");
|
|
2345
2347
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
2346
2348
|
const configs$1 = [];
|
|
@@ -2448,7 +2450,7 @@ async function defineWorkspaceConfig(options = {}, ...userConfigs) {
|
|
|
2448
2450
|
name: "fabdeh/gitignore",
|
|
2449
2451
|
strict: true
|
|
2450
2452
|
}))));
|
|
2451
|
-
configs$1.push(ignores(options.ignores), javascript({ overrides: options.javascript?.overrides }), comments(), node(), imports({ stylistic: stylisticOptions }), perfectionist());
|
|
2453
|
+
configs$1.push(ignores(options.ignores, "workspace"), javascript({ overrides: options.javascript?.overrides }), comments(), node(), imports({ stylistic: stylisticOptions }), perfectionist());
|
|
2452
2454
|
if (enableUnicorn) {
|
|
2453
2455
|
const unicornOptions = resolveSubOptions(options, "unicorn");
|
|
2454
2456
|
configs$1.push(unicorn(unicornOptions));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabdeh/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.4",
|
|
5
5
|
"description": "My personal eslint config preset",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Fabien Dehopré",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"tsx": "^4.20.6",
|
|
140
140
|
"typescript": "~5.8.3",
|
|
141
141
|
"vitest": "^3.2.4",
|
|
142
|
-
"@fabdeh/eslint-config": "0.8.0-beta.
|
|
142
|
+
"@fabdeh/eslint-config": "0.8.0-beta.4"
|
|
143
143
|
},
|
|
144
144
|
"resolutions": {
|
|
145
145
|
"eslint": "catalog:peer"
|