@fabdeh/eslint-config 0.6.0 → 0.6.2
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.mts +24 -5
- package/dist/index.mjs +46 -15
- package/package.json +36 -37
package/dist/index.d.mts
CHANGED
|
@@ -241,6 +241,18 @@ interface AngularOptions {
|
|
|
241
241
|
* @default true
|
|
242
242
|
*/
|
|
243
243
|
preferOnPushOnly?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Disallow using code which is marked as experimental.
|
|
246
|
+
*
|
|
247
|
+
* @default true
|
|
248
|
+
*/
|
|
249
|
+
banExperimentalApi?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Disallow using code which is marked as developer preview.
|
|
252
|
+
*
|
|
253
|
+
* @default true
|
|
254
|
+
*/
|
|
255
|
+
banDeveloperPreviewApi?: boolean;
|
|
244
256
|
}
|
|
245
257
|
/**
|
|
246
258
|
* Interface representing configuration options for enforcing NgRx operators rules.
|
|
@@ -364,12 +376,20 @@ interface TailwindCssOptions {
|
|
|
364
376
|
*/
|
|
365
377
|
tags?: Tags;
|
|
366
378
|
}
|
|
379
|
+
interface ProjectTypeOptions {
|
|
380
|
+
/**
|
|
381
|
+
* Type of the project. `lib` will enable more strict rules for libraries.
|
|
382
|
+
*
|
|
383
|
+
* @default 'app'
|
|
384
|
+
*/
|
|
385
|
+
type?: 'app' | 'lib';
|
|
386
|
+
}
|
|
367
387
|
/**
|
|
368
388
|
* Options for creating an ESLint configuration.
|
|
369
389
|
*
|
|
370
390
|
* @see createConfig function
|
|
371
391
|
*/
|
|
372
|
-
interface CreateConfigOptions {
|
|
392
|
+
interface CreateConfigOptions extends ProjectTypeOptions {
|
|
373
393
|
/**
|
|
374
394
|
* Enable gitignore support.
|
|
375
395
|
*
|
|
@@ -527,11 +547,10 @@ declare function imports(options?: StylisticOptions): ConfigArray;
|
|
|
527
547
|
*
|
|
528
548
|
* @param options - Configuration options for the JavaScript setup.
|
|
529
549
|
* @param options.overrides - Additional rule overrides.
|
|
530
|
-
* @param options.allowAngularDecorator - Allows specific Angular decorators to be used without new-cap errors.
|
|
531
550
|
* @returns A configuration array for ESLint.
|
|
532
551
|
* @example
|
|
533
552
|
* ```typescript
|
|
534
|
-
* const config = javascript(
|
|
553
|
+
* const config = javascript();
|
|
535
554
|
* ```
|
|
536
555
|
*/
|
|
537
556
|
declare function javascript(options?: OverridesOptions): ConfigArray;
|
|
@@ -703,7 +722,7 @@ declare function toml(options?: FilesOptions & OverridesOptions & StylisticOptio
|
|
|
703
722
|
* @param options.overrides - Additional rule overrides.
|
|
704
723
|
* @returns A ConfigArray containing the TypeScript ESLint configuration.
|
|
705
724
|
*/
|
|
706
|
-
declare function typescript(options?: OverridesOptions & StylisticOptions & TypeScriptErasableSyntaxOnlyOptions & TypeScriptParserOptions): Promise<ConfigArray>;
|
|
725
|
+
declare function typescript(options?: OverridesOptions & ProjectTypeOptions & StylisticOptions & TypeScriptErasableSyntaxOnlyOptions & TypeScriptParserOptions): Promise<ConfigArray>;
|
|
707
726
|
|
|
708
727
|
/**
|
|
709
728
|
* Generates a configuration array for the Unicorn plugin with the specified options.
|
|
@@ -850,4 +869,4 @@ type ResolvedOptions<T> = T extends boolean ? never : NonNullable<T>;
|
|
|
850
869
|
declare function resolveSubOptions<K extends keyof CreateConfigOptions>(options: CreateConfigOptions, key: K): ResolvedOptions<CreateConfigOptions[K]>;
|
|
851
870
|
|
|
852
871
|
export { GLOB_HTML, GLOB_JS, GLOB_SRC, GLOB_TESTS, GLOB_TS, STYLISTIC_CONFIG_DEFAULT, angular, comments, defineConfig, ensurePackages, findNearestPackageJsonName, getTsConfigFileName, getWorkspaceRoot, ignores, imports, interopDefault, isPackageInScope, javascript, jsdoc, jsonc, markdown, ngrx, perfectionist, regexp, resolveSubOptions, sortPackageJson, sortTsConfig, stylistic, tailwindcss, toml, typescript, unicorn, vitest, yaml };
|
|
853
|
-
export type { AngularOptions, Awaitable, CreateConfigOptions, FilesOptions, FormattersOptions, NgrxOperators, NgrxOptions, OverridesOptions, RegExpOptions, ResolvedOptions, StylisticConfig, StylisticOptions, TailwindCssOptions, TestingOptions, TypeScriptErasableSyntaxOnlyOptions, TypeScriptParserOptions, UnicornOptions };
|
|
872
|
+
export type { AngularOptions, Awaitable, CreateConfigOptions, FilesOptions, FormattersOptions, NgrxOperators, NgrxOptions, OverridesOptions, ProjectTypeOptions, RegExpOptions, ResolvedOptions, StylisticConfig, StylisticOptions, TailwindCssOptions, TestingOptions, TypeScriptErasableSyntaxOnlyOptions, TypeScriptParserOptions, UnicornOptions };
|
package/dist/index.mjs
CHANGED
|
@@ -148,7 +148,17 @@ function resolveSubOptions(options, key) {
|
|
|
148
148
|
|
|
149
149
|
async function angular(options = {}) {
|
|
150
150
|
const angularEslint = await interopDefault(import('angular-eslint'));
|
|
151
|
-
const {
|
|
151
|
+
const {
|
|
152
|
+
enableAccessibilityRules = true,
|
|
153
|
+
tsOverrides = {},
|
|
154
|
+
htmlOverrides = {},
|
|
155
|
+
prefix = "app",
|
|
156
|
+
ignoreClassNamePatternForInjectableProvidedIn: ignoreClassNamePattern,
|
|
157
|
+
componentStylesMode = "string",
|
|
158
|
+
preferOnPushOnly = true,
|
|
159
|
+
banExperimentalApi = true,
|
|
160
|
+
banDeveloperPreviewApi = true
|
|
161
|
+
} = options;
|
|
152
162
|
return tseslint.config(
|
|
153
163
|
{
|
|
154
164
|
name: "fabdeh/angular/rules",
|
|
@@ -209,7 +219,9 @@ async function angular(options = {}) {
|
|
|
209
219
|
"@angular-eslint/no-async-lifecycle-method": "error",
|
|
210
220
|
"@angular-eslint/no-attribute-decorator": "error",
|
|
211
221
|
"@angular-eslint/no-conflicting-lifecycle": "error",
|
|
222
|
+
...banDeveloperPreviewApi ? { "@angular-eslint/no-developer-preview": "error" } : {},
|
|
212
223
|
"@angular-eslint/no-duplicates-in-metadata-arrays": "error",
|
|
224
|
+
...banExperimentalApi ? { "@angular-eslint/no-experimental": "error" } : {},
|
|
213
225
|
"@angular-eslint/no-forward-ref": "error",
|
|
214
226
|
"@angular-eslint/no-lifecycle-call": "error",
|
|
215
227
|
"@angular-eslint/no-pipe-impure": "error",
|
|
@@ -405,7 +417,27 @@ function javascript(options = {}) {
|
|
|
405
417
|
"no-octal-escape": "error",
|
|
406
418
|
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
|
|
407
419
|
"no-proto": "error",
|
|
408
|
-
|
|
420
|
+
/*
|
|
421
|
+
'no-restricted-syntax': [
|
|
422
|
+
'error',
|
|
423
|
+
{
|
|
424
|
+
selector: 'TSEnumDeclaration',
|
|
425
|
+
message: '',
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
selector: 'TSExportAssignment',
|
|
429
|
+
message: '',
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
selector: 'ForInStatement',
|
|
433
|
+
message: '',
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
selector: ':matches(PropertyDefinition, MethodDefinition)[accessibility="private"]',
|
|
437
|
+
message: 'Use `#private` members instead.',
|
|
438
|
+
},
|
|
439
|
+
],
|
|
440
|
+
*/
|
|
409
441
|
"no-self-compare": "error",
|
|
410
442
|
"no-sequences": "error",
|
|
411
443
|
"no-template-curly-in-string": "error",
|
|
@@ -1349,7 +1381,7 @@ const memberOrdering = {
|
|
|
1349
1381
|
};
|
|
1350
1382
|
|
|
1351
1383
|
async function typescript(options = {}) {
|
|
1352
|
-
const { stylistic = true, parserOptions = {}, overrides = {}, enableErasableSyntaxOnly = false } = options;
|
|
1384
|
+
const { stylistic = true, parserOptions = {}, overrides = {}, enableErasableSyntaxOnly = false, type = "app" } = options;
|
|
1353
1385
|
let erasableSyntaxOnlyPlugin;
|
|
1354
1386
|
let erasableSyntaxOnlyRules;
|
|
1355
1387
|
if (enableErasableSyntaxOnly) {
|
|
@@ -1405,17 +1437,15 @@ async function typescript(options = {}) {
|
|
|
1405
1437
|
prefer: "type-imports"
|
|
1406
1438
|
}],
|
|
1407
1439
|
"@typescript-eslint/dot-notation": "error",
|
|
1408
|
-
"
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
}
|
|
1418
|
-
],
|
|
1440
|
+
...type === "lib" ? {
|
|
1441
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
1442
|
+
"error",
|
|
1443
|
+
{
|
|
1444
|
+
allowExpressions: true,
|
|
1445
|
+
allowIIFEs: true
|
|
1446
|
+
}
|
|
1447
|
+
]
|
|
1448
|
+
} : { "@typescript-eslint/explicit-module-boundary-types": "error" },
|
|
1419
1449
|
"@typescript-eslint/explicit-member-accessibility": ["error", { accessibility: "no-public" }],
|
|
1420
1450
|
"@typescript-eslint/member-ordering": ["error", memberOrdering],
|
|
1421
1451
|
"@typescript-eslint/method-signature-style": "error",
|
|
@@ -1961,7 +1991,8 @@ async function defineConfig(options = {}, ...userConfigs) {
|
|
|
1961
1991
|
const typescriptOptions = resolveSubOptions(options, "typescript");
|
|
1962
1992
|
configs.push(typescript({
|
|
1963
1993
|
...typescriptOptions,
|
|
1964
|
-
stylistic: stylisticOptions
|
|
1994
|
+
stylistic: stylisticOptions,
|
|
1995
|
+
type: options.type
|
|
1965
1996
|
}));
|
|
1966
1997
|
}
|
|
1967
1998
|
if (stylisticOptions) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabdeh/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.6.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "0.6.2",
|
|
5
|
+
"packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad",
|
|
6
6
|
"description": "My personal eslint config preset",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Fabien Dehopré",
|
|
@@ -79,74 +79,73 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@antfu/install-pkg": "^1.1.0",
|
|
82
|
-
"@clack/prompts": "^0.
|
|
82
|
+
"@clack/prompts": "^0.11.0",
|
|
83
83
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
84
|
-
"@eslint/js": "^9.
|
|
85
|
-
"@eslint/markdown": "^
|
|
86
|
-
"@ngrx/eslint-plugin": "^
|
|
87
|
-
"@stylistic/eslint-plugin": "^
|
|
88
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
89
|
-
"@typescript-eslint/parser": "^8.
|
|
90
|
-
"@typescript-eslint/utils": "^8.
|
|
91
|
-
"@vitest/eslint-plugin": "^1.
|
|
92
|
-
"angular-eslint": "^20.
|
|
84
|
+
"@eslint/js": "^9.32.0",
|
|
85
|
+
"@eslint/markdown": "^7.1.0",
|
|
86
|
+
"@ngrx/eslint-plugin": "^20.0.0",
|
|
87
|
+
"@stylistic/eslint-plugin": "^5.2.2",
|
|
88
|
+
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
|
89
|
+
"@typescript-eslint/parser": "^8.38.0",
|
|
90
|
+
"@typescript-eslint/utils": "^8.38.0",
|
|
91
|
+
"@vitest/eslint-plugin": "^1.3.4",
|
|
92
|
+
"angular-eslint": "^20.1.1",
|
|
93
93
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
94
|
-
"eslint-flat-config-utils": "^2.1.
|
|
94
|
+
"eslint-flat-config-utils": "^2.1.1",
|
|
95
95
|
"eslint-merge-processors": "^2.0.0",
|
|
96
|
-
"eslint-plugin-import-x": "^4.
|
|
96
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
97
97
|
"eslint-plugin-jest-dom": "^5.5.0",
|
|
98
|
-
"eslint-plugin-jsdoc": "^
|
|
98
|
+
"eslint-plugin-jsdoc": "^52.0.1",
|
|
99
99
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
100
|
-
"eslint-plugin-perfectionist": "^4.
|
|
100
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
101
101
|
"eslint-plugin-prefer-arrow-functions": "^3.6.2",
|
|
102
102
|
"eslint-plugin-regexp": "^2.9.0",
|
|
103
|
-
"eslint-plugin-testing-library": "^7.
|
|
103
|
+
"eslint-plugin-testing-library": "^7.6.3",
|
|
104
104
|
"eslint-plugin-toml": "^0.12.0",
|
|
105
|
-
"eslint-plugin-unicorn": "^
|
|
105
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
106
106
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
107
107
|
"eslint-plugin-yml": "^1.18.0",
|
|
108
|
-
"globals": "^16.
|
|
108
|
+
"globals": "^16.3.0",
|
|
109
109
|
"jsonc-eslint-parser": "^2.4.0",
|
|
110
110
|
"local-pkg": "^1.1.1",
|
|
111
111
|
"toml-eslint-parser": "^0.10.0",
|
|
112
|
-
"typescript-eslint": "^8.
|
|
112
|
+
"typescript-eslint": "^8.38.0",
|
|
113
113
|
"yaml-eslint-parser": "^1.3.0"
|
|
114
114
|
},
|
|
115
115
|
"devDependencies": {
|
|
116
|
-
"@angular/core": "^20.
|
|
116
|
+
"@angular/core": "^20.1.3",
|
|
117
117
|
"@commitlint/cli": "^19.8.1",
|
|
118
118
|
"@commitlint/config-conventional": "^19.8.1",
|
|
119
119
|
"@commitlint/cz-commitlint": "^19.8.1",
|
|
120
120
|
"@fabdeh/eslint-config": "workspace:*",
|
|
121
|
-
"@ngrx/effects": "^
|
|
122
|
-
"@ngrx/operators": "^
|
|
123
|
-
"@ngrx/signals": "^
|
|
124
|
-
"@ngrx/store": "^
|
|
125
|
-
"@prettier/plugin-xml": "^3.4.
|
|
121
|
+
"@ngrx/effects": "^20.0.0",
|
|
122
|
+
"@ngrx/operators": "^20.0.0",
|
|
123
|
+
"@ngrx/signals": "^20.0.0",
|
|
124
|
+
"@ngrx/store": "^20.0.0",
|
|
125
|
+
"@prettier/plugin-xml": "^3.4.2",
|
|
126
126
|
"@testing-library/angular": "^17.4.0",
|
|
127
|
-
"@testing-library/jest-dom": "^6.6.
|
|
127
|
+
"@testing-library/jest-dom": "^6.6.4",
|
|
128
128
|
"@types/fs-extra": "^11.0.4",
|
|
129
|
-
"@types/node": "^22.
|
|
130
|
-
"bumpp": "^10.
|
|
131
|
-
"changelogithub": "^13.
|
|
129
|
+
"@types/node": "^22.17.0",
|
|
130
|
+
"bumpp": "^10.2.1",
|
|
131
|
+
"changelogithub": "^13.16.0",
|
|
132
132
|
"commitizen": "^4.3.1",
|
|
133
|
-
"eslint": "^9.
|
|
134
|
-
"eslint-plugin-better-tailwindcss": "^3.
|
|
133
|
+
"eslint": "^9.32.0",
|
|
134
|
+
"eslint-plugin-better-tailwindcss": "^3.7.2",
|
|
135
135
|
"eslint-plugin-erasable-syntax-only": "^0.3.1",
|
|
136
136
|
"eslint-plugin-format": "^1.0.1",
|
|
137
137
|
"execa": "^9.6.0",
|
|
138
138
|
"fast-glob": "^3.3.3",
|
|
139
139
|
"fs-extra": "^11.3.0",
|
|
140
|
-
"inquirer": "^9.3.7",
|
|
141
140
|
"is-ci": "^4.1.0",
|
|
142
|
-
"jiti": "^2.
|
|
141
|
+
"jiti": "^2.5.1",
|
|
143
142
|
"nano-staged": "^0.8.0",
|
|
144
143
|
"prettier-plugin-slidev": "^1.0.5",
|
|
145
144
|
"simple-git-hooks": "^2.13.0",
|
|
146
|
-
"tailwindcss": "^4.1.
|
|
145
|
+
"tailwindcss": "^4.1.11",
|
|
147
146
|
"typescript": "^5.8.3",
|
|
148
|
-
"unbuild": "^3.
|
|
149
|
-
"vitest": "^3.2.
|
|
147
|
+
"unbuild": "^3.6.0",
|
|
148
|
+
"vitest": "^3.2.4"
|
|
150
149
|
},
|
|
151
150
|
"pnpm": {
|
|
152
151
|
"overrides": {
|