@fabdeh/eslint-config 0.8.0-beta.2 → 0.8.0-beta.3
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 +7 -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,11 +603,12 @@ 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
|
+
name: `fabdeh/ignores${fromFactory ? `/${fromFactory}` : ""}`,
|
|
611
612
|
ignores: [...GLOB_EXCLUDE, ...userIgnores]
|
|
612
613
|
});
|
|
613
614
|
}
|
|
@@ -2284,9 +2285,9 @@ 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
|
-
const configs$1 = [];
|
|
2290
|
+
const configs$1 = [ignores(options.ignores, "project")];
|
|
2290
2291
|
if (enableJsdoc) {
|
|
2291
2292
|
const stylisticOptions = workspaceOptions.stylistic === false ? false : typeof workspaceOptions.stylistic === "object" ? workspaceOptions.stylistic : {};
|
|
2292
2293
|
configs$1.push(jsdoc({ stylistic: stylisticOptions }));
|
|
@@ -2340,7 +2341,7 @@ async function defineProjectConfig(baseConfig, options = {}, ...userConfigs) {
|
|
|
2340
2341
|
* ```
|
|
2341
2342
|
*/
|
|
2342
2343
|
async function defineConfig(options = {}, ...userConfigs) {
|
|
2343
|
-
const { angular: enableAngular = isPackageExists("@angular/core"), gitignore: enableGitignore = true, jsdoc: enableJsdoc =
|
|
2344
|
+
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
2345
|
if (enableNgrx && !enableAngular) throw new Error("NgRx rules can only be enabled if Angular rules are also enabled.");
|
|
2345
2346
|
const stylisticOptions = options.stylistic === false ? false : typeof options.stylistic === "object" ? options.stylistic : {};
|
|
2346
2347
|
const configs$1 = [];
|
|
@@ -2448,7 +2449,7 @@ async function defineWorkspaceConfig(options = {}, ...userConfigs) {
|
|
|
2448
2449
|
name: "fabdeh/gitignore",
|
|
2449
2450
|
strict: true
|
|
2450
2451
|
}))));
|
|
2451
|
-
configs$1.push(ignores(options.ignores), javascript({ overrides: options.javascript?.overrides }), comments(), node(), imports({ stylistic: stylisticOptions }), perfectionist());
|
|
2452
|
+
configs$1.push(ignores(options.ignores, "workspace"), javascript({ overrides: options.javascript?.overrides }), comments(), node(), imports({ stylistic: stylisticOptions }), perfectionist());
|
|
2452
2453
|
if (enableUnicorn) {
|
|
2453
2454
|
const unicornOptions = resolveSubOptions(options, "unicorn");
|
|
2454
2455
|
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.3",
|
|
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.3"
|
|
143
143
|
},
|
|
144
144
|
"resolutions": {
|
|
145
145
|
"eslint": "catalog:peer"
|