@fabdeh/eslint-config 0.12.0 → 0.12.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 +9 -1
- package/dist/index.mjs +18 -19
- package/package.json +26 -26
package/dist/index.d.mts
CHANGED
|
@@ -2059,6 +2059,7 @@ type EnforceLogicalProperties = [] | [{
|
|
|
2059
2059
|
detectComponentClasses?: boolean;
|
|
2060
2060
|
rootFontSize?: number;
|
|
2061
2061
|
cwd?: string;
|
|
2062
|
+
ignore?: string[];
|
|
2062
2063
|
}]; // ----- enforce-shorthand-classes -----
|
|
2063
2064
|
type EnforceShorthandClasses = [] | [{
|
|
2064
2065
|
selectors?: ({
|
|
@@ -18080,7 +18081,7 @@ type SpacedComment = [] | [("always" | "never")] | [("always" | "never"), {
|
|
|
18080
18081
|
//#endregion
|
|
18081
18082
|
//#region src/typegen/index.d.ts
|
|
18082
18083
|
type RuleOptions = AngularEslintRuleOptions | AngularEslintTemplateRuleOptions | BetterTailwindcssRuleOptions | DefaultRuleOptions | EslintCommunityEslintCommentsRuleOptions | ImportXRuleOptions | JestDomYaRuleOptions | JsdocRuleOptions | JsoncRuleOptions | MarkdownRuleOptions | NgrxRuleOptions | NRuleOptions | PerfectionistRuleOptions | PnpmRuleOptions | PreferArrowFunctionsRuleOptions | RegexpRuleOptions | StylisticRuleOptions | TomlRuleOptions | TypescriptEslintRuleOptions | UnicornRuleOptions | UnusedImportsRuleOptions | VitestRuleOptions | YamlRuleOptions | TestingLibraryRuleOptions;
|
|
18083
|
-
type ConfigNames = '
|
|
18084
|
+
type ConfigNames = 'fabdeh/angular-template/rules' | 'fabdeh/angular/rules' | 'fabdeh/app/typescript/rules' | 'fabdeh/app/typescript/setup' | 'fabdeh/comments/rules' | 'fabdeh/ignores' | 'fabdeh/imports/rules' | 'fabdeh/imports/ts-disables' | 'fabdeh/javascript/rules' | 'fabdeh/javascript/setup' | 'fabdeh/jsdoc/rules' | 'fabdeh/jsdoc/ts-only/rules' | 'fabdeh/jsonc/rules' | 'fabdeh/jsonc/setup' | 'fabdeh/markdown/disables' | 'fabdeh/markdown/parser' | 'fabdeh/markdown/processor' | 'fabdeh/markdown/rules' | 'fabdeh/markdown/setup' | 'fabdeh/ngrx-effects/rules' | 'fabdeh/ngrx-operators/rules' | 'fabdeh/ngrx-signals/rules' | 'fabdeh/ngrx-store/rules' | 'fabdeh/ngrx/setup' | 'fabdeh/node/rules' | 'fabdeh/perfectionist/rules' | 'fabdeh/pnpm/package-json' | 'fabdeh/pnpm/pnpm-workspace-yaml' | 'fabdeh/pnpm/pnpm-workspace-yaml-sort' | 'fabdeh/regexp/rules' | 'fabdeh/sort/package-json' | 'fabdeh/sort/tsconfig-json' | 'fabdeh/stylistic/rules' | 'fabdeh/tailwindcss/rules' | 'fabdeh/toml/rules' | 'fabdeh/toml/setup' | 'fabdeh/unicorn/rules' | 'fabdeh/vitest/rules' | 'fabdeh/yaml/rules' | 'fabdeh/yaml/setup';
|
|
18084
18085
|
//#endregion
|
|
18085
18086
|
//#region src/shared/constants.d.ts
|
|
18086
18087
|
declare const OPTIONS_SYMBOL: unique symbol;
|
|
@@ -18233,6 +18234,13 @@ interface NamingConventionOptions {
|
|
|
18233
18234
|
* @default false
|
|
18234
18235
|
*/
|
|
18235
18236
|
useRelaxedNamingConventionForCamelAndPascalCases?: boolean;
|
|
18237
|
+
/**
|
|
18238
|
+
* Indicates whether function names should allow PascalCase in addition to camelCase.
|
|
18239
|
+
* Enable this when using JSX/TSX syntax.
|
|
18240
|
+
*
|
|
18241
|
+
* @default false
|
|
18242
|
+
*/
|
|
18243
|
+
allowJsx?: boolean;
|
|
18236
18244
|
}
|
|
18237
18245
|
/**
|
|
18238
18246
|
* Options for configuring Angular-specific linting rules.
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,7 @@ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
|
|
|
14
14
|
import nodePlugin from "eslint-plugin-n";
|
|
15
15
|
import perfectionistPlugin from "eslint-plugin-perfectionist";
|
|
16
16
|
import { readFile } from "node:fs/promises";
|
|
17
|
-
import {
|
|
17
|
+
import { up } from "empathic/find";
|
|
18
18
|
import { configs } from "eslint-plugin-regexp";
|
|
19
19
|
import unicornPlugin from "eslint-plugin-unicorn";
|
|
20
20
|
import { FlatConfigComposer } from "eslint-flat-config-utils";
|
|
@@ -1519,7 +1519,7 @@ async function playwright(options = {}) {
|
|
|
1519
1519
|
* @returns `true` when catalog configuration is present; otherwise `false`.
|
|
1520
1520
|
*/
|
|
1521
1521
|
async function detectCatalogUsage() {
|
|
1522
|
-
const workspaceFile =
|
|
1522
|
+
const workspaceFile = up("pnpm-workspace.yaml");
|
|
1523
1523
|
if (!workspaceFile) return false;
|
|
1524
1524
|
const yaml = await readFile(workspaceFile, "utf-8");
|
|
1525
1525
|
return yaml.includes("catalog:") || yaml.includes("catalogs:");
|
|
@@ -1531,18 +1531,14 @@ async function detectCatalogUsage() {
|
|
|
1531
1531
|
* @returns An array defining PNPM workspace rules, plugins, and their configurations.
|
|
1532
1532
|
*/
|
|
1533
1533
|
async function pnpm(options = {}) {
|
|
1534
|
-
const [pluginPnpm, pluginYaml
|
|
1535
|
-
interopDefault(import("eslint-plugin-pnpm")),
|
|
1536
|
-
interopDefault(import("eslint-plugin-yml")),
|
|
1537
|
-
interopDefault(import("yaml-eslint-parser"))
|
|
1538
|
-
]);
|
|
1534
|
+
const [pluginPnpm, pluginYaml] = await Promise.all([interopDefault(import("eslint-plugin-pnpm")), interopDefault(import("eslint-plugin-yml"))]);
|
|
1539
1535
|
const { catalogs = await detectCatalogUsage(), isInEditor = false, json = true, sort = true, yaml = true } = options;
|
|
1540
1536
|
const configs = [];
|
|
1541
1537
|
if (json) configs.push({
|
|
1542
1538
|
name: "fabdeh/pnpm/package-json",
|
|
1543
1539
|
files: ["package.json", "**/package.json"],
|
|
1544
|
-
language: "jsonc/x",
|
|
1545
1540
|
plugins: { pnpm: pluginPnpm },
|
|
1541
|
+
language: "jsonc/x",
|
|
1546
1542
|
rules: {
|
|
1547
1543
|
...catalogs ? { "pnpm/json-enforce-catalog": ["error", {
|
|
1548
1544
|
autofix: !isInEditor,
|
|
@@ -1555,22 +1551,25 @@ async function pnpm(options = {}) {
|
|
|
1555
1551
|
if (yaml) configs.push({
|
|
1556
1552
|
name: "fabdeh/pnpm/pnpm-workspace-yaml",
|
|
1557
1553
|
files: ["pnpm-workspace.yaml"],
|
|
1558
|
-
languageOptions: { parser: yamlParser },
|
|
1559
1554
|
plugins: { pnpm: pluginPnpm },
|
|
1555
|
+
language: "yaml/yaml",
|
|
1560
1556
|
rules: {
|
|
1561
|
-
"pnpm/yaml-enforce-settings": ["error", {
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1557
|
+
"pnpm/yaml-enforce-settings": ["error", {
|
|
1558
|
+
autofix: !isInEditor,
|
|
1559
|
+
settings: {
|
|
1560
|
+
shellEmulator: true,
|
|
1561
|
+
trustPolicy: "no-downgrade"
|
|
1562
|
+
}
|
|
1563
|
+
}],
|
|
1565
1564
|
"pnpm/yaml-no-duplicate-catalog-item": "error",
|
|
1566
1565
|
"pnpm/yaml-no-unused-catalog-item": "error"
|
|
1567
1566
|
}
|
|
1568
1567
|
});
|
|
1569
1568
|
if (sort) configs.push({
|
|
1569
|
+
name: "fabdeh/pnpm/pnpm-workspace-yaml-sort",
|
|
1570
1570
|
files: ["pnpm-workspace.yaml"],
|
|
1571
|
-
languageOptions: { parser: yamlParser },
|
|
1572
|
-
name: "antfu/pnpm/pnpm-workspace-yaml-sort",
|
|
1573
1571
|
plugins: { yaml: pluginYaml },
|
|
1572
|
+
language: "yaml/yaml",
|
|
1574
1573
|
rules: { "yaml/sort-keys": [
|
|
1575
1574
|
"error",
|
|
1576
1575
|
{
|
|
@@ -2095,7 +2094,7 @@ const MEMBER_ORDERING_OPTIONS = { default: [
|
|
|
2095
2094
|
* @returns A TypedConfig[] containing the TypeScript ESLint configuration.
|
|
2096
2095
|
*/
|
|
2097
2096
|
async function typescript(options = {}, isWorkspaceProject = false) {
|
|
2098
|
-
const { enableErasableSyntaxOnly = false, overrides = {}, parserOptions = {}, stylistic = true, type = "app", useRelaxedNamingConventionForCamelAndPascalCases = false } = options;
|
|
2097
|
+
const { enableErasableSyntaxOnly = false, overrides = {}, parserOptions = {}, stylistic = true, type = "app", useRelaxedNamingConventionForCamelAndPascalCases = false, allowJsx = false } = options;
|
|
2099
2098
|
let erasableSyntaxOnlyPlugin;
|
|
2100
2099
|
let erasableSyntaxOnlyRules;
|
|
2101
2100
|
if (enableErasableSyntaxOnly) {
|
|
@@ -2170,7 +2169,7 @@ async function typescript(options = {}, isWorkspaceProject = false) {
|
|
|
2170
2169
|
...type === "workspace" ? {} : { "@typescript-eslint/explicit-module-boundary-types": "error" },
|
|
2171
2170
|
"@typescript-eslint/member-ordering": ["error", MEMBER_ORDERING_OPTIONS],
|
|
2172
2171
|
"@typescript-eslint/method-signature-style": "error",
|
|
2173
|
-
"@typescript-eslint/naming-convention": ["error", ...namingConvention(!useRelaxedNamingConventionForCamelAndPascalCases)],
|
|
2172
|
+
"@typescript-eslint/naming-convention": ["error", ...namingConvention(!useRelaxedNamingConventionForCamelAndPascalCases, allowJsx)],
|
|
2174
2173
|
"@typescript-eslint/no-base-to-string": "error",
|
|
2175
2174
|
"@typescript-eslint/no-confusing-non-null-assertion": "error",
|
|
2176
2175
|
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
|
|
@@ -2547,7 +2546,7 @@ function defineProjectConfig(baseConfig, options = {}, ...userConfigs) {
|
|
|
2547
2546
|
* ```
|
|
2548
2547
|
*/
|
|
2549
2548
|
function defineConfig(options = {}, ...userConfigs) {
|
|
2550
|
-
const { angular: enableAngular = isPackageExists("@angular/core"), gitignore: enableGitignore = true, jsdoc: enableJsdoc = options.type === "lib", ngrx: enableNgrx = NGRX_PACKAGES.some((p) => isPackageExists(p)), playwright: enablePlaywright = PLAYWRIGHT_PACKAGES.some((p) => isPackageExists(p)), pnpm: enableCatalogs = !!
|
|
2549
|
+
const { angular: enableAngular = isPackageExists("@angular/core"), gitignore: enableGitignore = true, jsdoc: enableJsdoc = options.type === "lib", ngrx: enableNgrx = NGRX_PACKAGES.some((p) => isPackageExists(p)), playwright: enablePlaywright = PLAYWRIGHT_PACKAGES.some((p) => isPackageExists(p)), pnpm: enableCatalogs = !!up("pnpm-workspace.yaml"), regexp: enableRegexp = true, tailwindcss: enableTailwind = false, typescript: enableTypescript = isPackageExists("typescript"), unicorn: enableUnicorn = true, vitest: enableVitest = isPackageExists("vitest") } = options;
|
|
2551
2550
|
let isInEditor = options.isInEditor;
|
|
2552
2551
|
if (isInEditor === void 0) {
|
|
2553
2552
|
isInEditor = isInEditorEnv();
|
|
@@ -2678,7 +2677,7 @@ function defineConfig(options = {}, ...userConfigs) {
|
|
|
2678
2677
|
* ```
|
|
2679
2678
|
*/
|
|
2680
2679
|
function defineWorkspaceConfig(options = {}, ...userConfigs) {
|
|
2681
|
-
const { gitignore: enableGitignore = true, pnpm: enableCatalogs = !!
|
|
2680
|
+
const { gitignore: enableGitignore = true, pnpm: enableCatalogs = !!up("pnpm-workspace.yaml"), regexp: enableRegexp = true, typescript: enableTypescript = isPackageExists("typescript"), unicorn: enableUnicorn = true } = options;
|
|
2682
2681
|
let isInEditor = options.isInEditor;
|
|
2683
2682
|
if (isInEditor === void 0) {
|
|
2684
2683
|
isInEditor = isInEditorEnv();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fabdeh/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.2",
|
|
5
5
|
"description": "My personal eslint config preset",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Fabien Dehopré",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"eslint": "^9.38.0 || ^10.0.0",
|
|
40
|
-
"eslint-plugin-better-tailwindcss": "^4.
|
|
41
|
-
"eslint-plugin-erasable-syntax-only": "^0.4.
|
|
40
|
+
"eslint-plugin-better-tailwindcss": "^4.6.0",
|
|
41
|
+
"eslint-plugin-erasable-syntax-only": "^0.4.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"eslint-plugin-better-tailwindcss": {
|
|
@@ -55,20 +55,21 @@
|
|
|
55
55
|
"@eslint/markdown": "^8.0.2",
|
|
56
56
|
"@ngrx/eslint-plugin": "^21.1.1",
|
|
57
57
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^8.61.
|
|
59
|
-
"@typescript-eslint/parser": "^8.61.
|
|
60
|
-
"@typescript-eslint/utils": "^8.61.
|
|
61
|
-
"@vitest/eslint-plugin": "^1.6.
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^8.61.1",
|
|
59
|
+
"@typescript-eslint/parser": "^8.61.1",
|
|
60
|
+
"@typescript-eslint/utils": "^8.61.1",
|
|
61
|
+
"@vitest/eslint-plugin": "^1.6.20",
|
|
62
62
|
"angular-eslint": "^22.0.0",
|
|
63
|
+
"empathic": "^2.0.1",
|
|
63
64
|
"eslint-config-flat-gitignore": "^2.3.0",
|
|
64
65
|
"eslint-flat-config-utils": "^3.2.0",
|
|
65
66
|
"eslint-merge-processors": "^2.0.0",
|
|
66
67
|
"eslint-plugin-import-x": "^4.16.2",
|
|
67
68
|
"eslint-plugin-jest-dom-ya": "^1.0.1",
|
|
68
|
-
"eslint-plugin-jsdoc": "^63.0.
|
|
69
|
+
"eslint-plugin-jsdoc": "^63.0.6",
|
|
69
70
|
"eslint-plugin-jsonc": "^3.2.0",
|
|
70
71
|
"eslint-plugin-n": "^18.1.0",
|
|
71
|
-
"eslint-plugin-perfectionist": "^5.9.
|
|
72
|
+
"eslint-plugin-perfectionist": "^5.9.1",
|
|
72
73
|
"eslint-plugin-playwright": "^2.10.4",
|
|
73
74
|
"eslint-plugin-pnpm": "^1.6.1",
|
|
74
75
|
"eslint-plugin-prefer-arrow-functions": "^3.9.1",
|
|
@@ -78,16 +79,15 @@
|
|
|
78
79
|
"eslint-plugin-unicorn": "^65.0.1",
|
|
79
80
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
80
81
|
"eslint-plugin-yml": "^3.4.0",
|
|
81
|
-
"find-up-simple": "^1.0.1",
|
|
82
82
|
"glob": "^13.0.6",
|
|
83
83
|
"globals": "^17.6.0",
|
|
84
84
|
"jsonc-eslint-parser": "^3.1.0",
|
|
85
85
|
"local-pkg": "^1.2.1",
|
|
86
|
-
"typescript-eslint": "^8.61.
|
|
87
|
-
"yaml-eslint-parser": "^2.0.0"
|
|
86
|
+
"typescript-eslint": "^8.61.1"
|
|
88
87
|
},
|
|
89
88
|
"devDependencies": {
|
|
90
|
-
"@angular/
|
|
89
|
+
"@angular/cli": "^22.0.2",
|
|
90
|
+
"@angular/core": "^22.0.2",
|
|
91
91
|
"@arethetypeswrong/cli": "^0.18.3",
|
|
92
92
|
"@commitlint/cli": "^21.0.2",
|
|
93
93
|
"@commitlint/config-conventional": "^21.0.2",
|
|
@@ -101,31 +101,31 @@
|
|
|
101
101
|
"@testing-library/angular": "^19.4.1",
|
|
102
102
|
"@testing-library/jest-dom": "^6.9.1",
|
|
103
103
|
"@types/fs-extra": "^11.0.4",
|
|
104
|
-
"@types/node": "^24.13.
|
|
105
|
-
"@vitest/coverage-v8": "^4.1.
|
|
106
|
-
"@vitest/ui": "^4.1.
|
|
104
|
+
"@types/node": "^24.13.2",
|
|
105
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
106
|
+
"@vitest/ui": "^4.1.9",
|
|
107
107
|
"bumpp": "^11.1.0",
|
|
108
108
|
"change-case": "^5.4.4",
|
|
109
109
|
"changelogithub": "^14.0.0",
|
|
110
|
-
"commitizen": "^4.3.
|
|
111
|
-
"eslint": "^10.
|
|
112
|
-
"eslint-plugin-better-tailwindcss": "^4.
|
|
113
|
-
"eslint-plugin-erasable-syntax-only": "^0.4.
|
|
110
|
+
"commitizen": "^4.3.2",
|
|
111
|
+
"eslint": "^10.5.0",
|
|
112
|
+
"eslint-plugin-better-tailwindcss": "^4.6.0",
|
|
113
|
+
"eslint-plugin-erasable-syntax-only": "^0.4.2",
|
|
114
114
|
"eslint-typegen": "^2.3.1",
|
|
115
115
|
"execa": "^9.6.1",
|
|
116
116
|
"fs-extra": "^11.3.5",
|
|
117
117
|
"is-ci": "^4.1.0",
|
|
118
118
|
"jiti": "^2.7.0",
|
|
119
119
|
"nano-staged": "^1.0.2",
|
|
120
|
-
"playwright": "^1.
|
|
121
|
-
"semver": "^7.8.
|
|
120
|
+
"playwright": "^1.61.0",
|
|
121
|
+
"semver": "^7.8.4",
|
|
122
122
|
"simple-git-hooks": "^2.13.1",
|
|
123
|
-
"tailwindcss": "^4.3.
|
|
124
|
-
"tsdown": "^0.22.
|
|
123
|
+
"tailwindcss": "^4.3.1",
|
|
124
|
+
"tsdown": "^0.22.3",
|
|
125
125
|
"tsx": "^4.22.4",
|
|
126
126
|
"typescript": "^6.0.3",
|
|
127
|
-
"vitest": "^4.1.
|
|
128
|
-
"@fabdeh/eslint-config": "0.12.
|
|
127
|
+
"vitest": "^4.1.9",
|
|
128
|
+
"@fabdeh/eslint-config": "0.12.2"
|
|
129
129
|
},
|
|
130
130
|
"simple-git-hooks": {
|
|
131
131
|
"pre-commit": "pnpm nano-staged",
|