@creo-team/eslint-config 2.5.6 → 5.0.0
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/README.md +36 -13
- package/dist/constants.d.ts +47 -49
- package/dist/constants.js +7 -7
- package/dist/constants.js.map +1 -1
- package/dist/eslint.config.d.ts +2 -85
- package/dist/eslint.config.js +9 -21
- package/dist/eslint.config.js.map +1 -1
- package/dist/index.d.mts +5 -0
- package/dist/index.mjs +5 -0
- package/dist/index.mjs.map +1 -0
- package/dist/rules.d.ts +283 -330
- package/dist/rules.js +24 -57
- package/dist/rules.js.map +1 -1
- package/dist/structure.d.ts +13 -7
- package/dist/utils.d.ts +7 -2
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @creo-team/eslint-config
|
|
2
2
|
|
|
3
|
-
ESLint flat config for TypeScript/React: strict type-checking, Prettier, JSDoc, complexity limits, and no magic numbers. One style and one set of rules so code stays consistent and reviewable—and so tools like Cursor and Claude can fix and generate code that matches. Works with the [ESLint MCP server](https://eslint.org/docs/latest/use/mcp).
|
|
3
|
+
ESLint flat config for TypeScript/React: strict type-checking, Prettier, JSDoc, complexity limits, async correctness, and no magic numbers. One style and one set of rules so code stays consistent and reviewable — and so tools like Cursor and Claude can fix and generate code that matches. Works with the [ESLint MCP server](https://eslint.org/docs/latest/use/mcp).
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@creo-team/eslint-config)
|
|
6
6
|
[](./LICENSE)
|
|
@@ -11,7 +11,7 @@ ESLint flat config for TypeScript/React: strict type-checking, Prettier, JSDoc,
|
|
|
11
11
|
npm install @creo-team/eslint-config --save-dev
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
**Node:**
|
|
14
|
+
**Node:** `^22.22.2 || >=24.15.0`. Prefer Node 24. **TypeScript 7** works alongside this config; see [TypeScript](#typescript).
|
|
15
15
|
|
|
16
16
|
## Usage patterns
|
|
17
17
|
|
|
@@ -46,6 +46,8 @@ module.exports = createConfig({
|
|
|
46
46
|
})
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
In ESM (`eslint.config.mjs`), use `import { createConfig } from '@creo-team/eslint-config'`.
|
|
50
|
+
|
|
49
51
|
### 3. Monorepo — one root config (recommended)
|
|
50
52
|
|
|
51
53
|
Multiple packages (e.g. `app/`, `lib/`, `infra/`), each with its own `tsconfig.json`. Use **projectService** so type-aware rules resolve the nearest tsconfig per file. One `eslint.config.js` at the repo root; run `eslint .` from the root.
|
|
@@ -79,8 +81,8 @@ module.exports = createConfig({
|
|
|
79
81
|
"fix": "eslint . --fix"
|
|
80
82
|
},
|
|
81
83
|
"devDependencies": {
|
|
82
|
-
"@creo-team/eslint-config": "^
|
|
83
|
-
"eslint": "^
|
|
84
|
+
"@creo-team/eslint-config": "^5.0.0",
|
|
85
|
+
"eslint": "^10.11.0"
|
|
84
86
|
}
|
|
85
87
|
}
|
|
86
88
|
```
|
|
@@ -115,6 +117,17 @@ In any setup, add to the package that runs ESLint:
|
|
|
115
117
|
|
|
116
118
|
Type-aware rules need a `tsconfig.json` (or `tsconfig.eslint.json`) that includes your source. With **projectService** (monorepo), each file uses the nearest tsconfig. Without it, one tsconfig is used (see [typed linting](https://typescript-eslint.io/getting-started/typed-linting)).
|
|
117
119
|
|
|
120
|
+
**TypeScript 7.** TypeScript 7 ships no JavaScript API yet, so typescript-eslint runs on the TypeScript 6 API ([typescript-eslint#10940](https://github.com/typescript-eslint/typescript-eslint/issues/10940)). This config depends on it, so a monorepo with TypeScript 7 only inside its workspaces lints as-is. If the package that runs ESLint installs `typescript@7` itself, lint crashes. Use the [official side-by-side setup](https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/#running-side-by-side-with-typescript-6.0) instead: `tsc` stays TypeScript 7 and `tsc6` is TypeScript 6.
|
|
121
|
+
|
|
122
|
+
```json
|
|
123
|
+
{
|
|
124
|
+
"devDependencies": {
|
|
125
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
126
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
118
131
|
### Extending
|
|
119
132
|
|
|
120
133
|
Spread and override:
|
|
@@ -252,13 +265,16 @@ module.exports = [
|
|
|
252
265
|
|
|
253
266
|
| Rule / area | Benefit |
|
|
254
267
|
|-------------|--------|
|
|
255
|
-
| **Strict type-checked** (typescript-eslint) | Catches type errors and unsafe `any` before runtime. Fewer “works until it doesn’t” bugs
|
|
256
|
-
| **JSDoc** (params, returns, descriptions) | Public API is self-describing. IDE hints and “go to definition”
|
|
257
|
-
| **complexity (max 15)** | Branches and conditionals stay bounded. Functions stay testable and easier to reason about
|
|
258
|
-
| **max-lines-per-function (200)** | Long functions get split. Easier to name, test, and reuse
|
|
259
|
-
| **no-magic-numbers (warn)** | Literals become named constants. Changing a threshold or status code happens in one place
|
|
260
|
-
| **
|
|
261
|
-
| **
|
|
268
|
+
| **Strict type-checked** (typescript-eslint) | Catches type errors and unsafe `any` before runtime. Fewer “works until it doesn’t” bugs |
|
|
269
|
+
| **JSDoc** (params, returns, descriptions) | Public API is self-describing. IDE hints and “go to definition” work without opening the implementation |
|
|
270
|
+
| **complexity (max 15)** | Branches and conditionals stay bounded. Functions stay testable and easier to reason about |
|
|
271
|
+
| **max-lines-per-function (200)** | Long functions get split. Easier to name, test, and reuse |
|
|
272
|
+
| **no-magic-numbers (warn)** | Literals become named constants. Changing a threshold or status code happens in one place |
|
|
273
|
+
| **no-promise-executor-return** | Catches returning values from Promise executors — always a bug |
|
|
274
|
+
| **no-await-in-loop (warn)** | Flags sequential awaits that should be `Promise.all()` |
|
|
275
|
+
| **no-console (warn)** | Catches leftover debug logging, especially from AI-generated code |
|
|
276
|
+
| **Import rules** (no-cycle, order, resolver) | No circular deps; consistent import order; TypeScript path resolution works |
|
|
277
|
+
| **Prettier** | One formatter. No style churn in code review |
|
|
262
278
|
|
|
263
279
|
**LLM- and assistant-friendly.** Cursor, Claude, and other tools behave better when the codebase is consistent and documented. This config enforces one style (so generated code matches), requires JSDoc on public surfaces (so the model has context), and keeps complexity and magic numbers in check (so suggestions stay in the same style and refactors are local). Use the [ESLint MCP server](https://eslint.org/docs/latest/use/mcp) so the assistant can run ESLint and fix violations in your editor.
|
|
264
280
|
|
|
@@ -358,10 +374,17 @@ Import rule values and presets — no magic strings:
|
|
|
358
374
|
|
|
359
375
|
- **TypeScript ESLint** — recommended + strict type-checked, stylistic
|
|
360
376
|
- **Prettier** — formatting (tabs, 120 print width, no semicolons)
|
|
361
|
-
- **JSDoc** — require descriptions, params, returns
|
|
377
|
+
- **JSDoc** — require descriptions, params, returns on declarations/methods (not arrow functions)
|
|
362
378
|
- **Import** — order, no cycles, resolver TypeScript
|
|
363
379
|
- **Perfectionist** — alphabetical sort (imports sort disabled)
|
|
364
|
-
- **
|
|
380
|
+
- **Async correctness** — no-promise-executor-return (error), no-await-in-loop (warn)
|
|
381
|
+
- **Quality** — complexity (max 15), max-lines, max-lines-per-function, no-magic-numbers (warn), no-console (warn)
|
|
382
|
+
|
|
383
|
+
## Docs
|
|
384
|
+
|
|
385
|
+
- [ESLINT-STANDARDS.md](./docs/ESLINT-STANDARDS.md) — architecture and rule philosophy
|
|
386
|
+
- [ESLINT-AUDIT.md](./docs/ESLINT-AUDIT.md) — v3.0.0 audit findings and decisions
|
|
387
|
+
- [AI-CODE-STANDARDS.md](./docs/AI-CODE-STANDARDS.md) — guidelines for AI assistants
|
|
365
388
|
|
|
366
389
|
## Release flow
|
|
367
390
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,50 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}[];
|
|
49
|
-
export {};
|
|
1
|
+
declare const _exports: {
|
|
2
|
+
all: "all";
|
|
3
|
+
always: "always";
|
|
4
|
+
AppStructurePreset: {
|
|
5
|
+
Express: string;
|
|
6
|
+
NextJs: string;
|
|
7
|
+
NextJsAppRouter: string;
|
|
8
|
+
React: string;
|
|
9
|
+
Src: string;
|
|
10
|
+
};
|
|
11
|
+
error: "error";
|
|
12
|
+
FilenameCase: {
|
|
13
|
+
CamelCase: string;
|
|
14
|
+
KebabCase: string;
|
|
15
|
+
PascalCase: string;
|
|
16
|
+
};
|
|
17
|
+
FilesPattern: {
|
|
18
|
+
TsAndTsx: string[];
|
|
19
|
+
};
|
|
20
|
+
namingConvention: {
|
|
21
|
+
default: {
|
|
22
|
+
format: string[];
|
|
23
|
+
selector: string;
|
|
24
|
+
}[];
|
|
25
|
+
withUpperCaseVariables: {
|
|
26
|
+
format: string[];
|
|
27
|
+
selector: string;
|
|
28
|
+
}[];
|
|
29
|
+
};
|
|
30
|
+
NamingFormat: {
|
|
31
|
+
CamelCase: string;
|
|
32
|
+
PascalCase: string;
|
|
33
|
+
UpperCase: string;
|
|
34
|
+
};
|
|
35
|
+
NamingSelector: {
|
|
36
|
+
Default: string;
|
|
37
|
+
EnumMember: string;
|
|
38
|
+
Import: string;
|
|
39
|
+
TypeLike: string;
|
|
40
|
+
Variable: string;
|
|
41
|
+
};
|
|
42
|
+
never: "never";
|
|
43
|
+
none: "none";
|
|
44
|
+
off: "off";
|
|
45
|
+
warn: "warn";
|
|
46
|
+
};
|
|
47
|
+
export = _exports;
|
|
50
48
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const off = 'off';
|
|
3
|
-
const warn = 'warn';
|
|
4
|
-
const error = 'error';
|
|
5
|
-
const always = 'always';
|
|
6
|
-
const never = 'never';
|
|
7
|
-
const none = 'none';
|
|
8
|
-
const all = 'all';
|
|
2
|
+
const off = ('off');
|
|
3
|
+
const warn = ('warn');
|
|
4
|
+
const error = ('error');
|
|
5
|
+
const always = ('always');
|
|
6
|
+
const never = ('never');
|
|
7
|
+
const none = ('none');
|
|
8
|
+
const all = ('all');
|
|
9
9
|
const NamingFormat = {
|
|
10
10
|
CamelCase: 'camelCase',
|
|
11
11
|
PascalCase: 'PascalCase',
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.js"],"names":[],"mappings":";AAmBA,MAAM,GAAG,GAAwB,CAAC,KAAK,CAAC,CAAA;AACxC,MAAM,IAAI,GAAwB,CAAC,MAAM,CAAC,CAAA;AAC1C,MAAM,KAAK,GAAwB,CAAC,OAAO,CAAC,CAAA;AAE5C,MAAM,MAAM,GAAwB,CAAC,QAAQ,CAAC,CAAA;AAC9C,MAAM,KAAK,GAAwB,CAAC,OAAO,CAAC,CAAA;AAC5C,MAAM,IAAI,GAAwB,CAAC,MAAM,CAAC,CAAA;AAC1C,MAAM,GAAG,GAAwB,CAAC,KAAK,CAAC,CAAA;AAExC,MAAM,YAAY,GAAG;IACpB,SAAS,EAAE,WAAW;IACtB,UAAU,E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AE,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACxE,EAAE,MAAM,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,cAAc,CAAC,UAAU,EAAE;CAC1E,CAAA;AAED,MAAM,gBAAgB,GAAG;IACxB,OAAO,EAAE,uBAAuB;IAChC,sBAAsB,EAAE,sCAAsC;CAC9D,CAAA;AAED,MAAM,YAAY,GAAG;IACpB,QAAQ,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;CACjC,CAAA;AAED,MAAM,YAAY,GAAG;IACpB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;CACxB,CAAA;AAED,MAAM,kBAAkB,GAAG;IAC1B,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;IAChB,eAAe,EAAE,iBAAiB;IAClC,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;CACV,CAAA;AAED,MAAM,CAAC,OAAO,GAAG;IAChB,GAAG;IACH,MAAM;IACN,kBAAkB;IAClB,KAAK;IACL,YAAY;IACZ,YAAY;IACZ,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,KAAK;IACL,IAAI;IACJ,GAAG;IACH,IAAI;CACJ,CAAA"}
|
package/dist/eslint.config.d.ts
CHANGED
|
@@ -1,89 +1,6 @@
|
|
|
1
|
-
declare const _exports: {
|
|
2
|
-
[n: number]: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config;
|
|
3
|
-
length: number;
|
|
4
|
-
toString(): string;
|
|
5
|
-
toLocaleString(): string;
|
|
6
|
-
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string;
|
|
7
|
-
pop(): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config | undefined;
|
|
8
|
-
push(...items: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]): number;
|
|
9
|
-
concat(...items: ConcatArray<import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config>[]): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[];
|
|
10
|
-
concat(...items: (import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config | ConcatArray<import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config>)[]): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[];
|
|
11
|
-
join(separator?: string): string;
|
|
12
|
-
reverse(): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[];
|
|
13
|
-
shift(): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config | undefined;
|
|
14
|
-
slice(start?: number, end?: number): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[];
|
|
15
|
-
sort(compareFn?: ((a: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, b: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config) => number) | undefined): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.ConfigArray;
|
|
16
|
-
splice(start: number, deleteCount?: number): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[];
|
|
17
|
-
splice(start: number, deleteCount: number, ...items: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[];
|
|
18
|
-
unshift(...items: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]): number;
|
|
19
|
-
indexOf(searchElement: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, fromIndex?: number): number;
|
|
20
|
-
lastIndexOf(searchElement: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, fromIndex?: number): number;
|
|
21
|
-
every<S extends import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config>(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => value is S, thisArg?: any): this is S[];
|
|
22
|
-
every(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => unknown, thisArg?: any): boolean;
|
|
23
|
-
some(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => unknown, thisArg?: any): boolean;
|
|
24
|
-
forEach(callbackfn: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => void, thisArg?: any): void;
|
|
25
|
-
map<U>(callbackfn: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => U, thisArg?: any): U[];
|
|
26
|
-
filter<S extends import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config>(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => value is S, thisArg?: any): S[];
|
|
27
|
-
filter(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => unknown, thisArg?: any): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[];
|
|
28
|
-
reduce(callbackfn: (previousValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentIndex: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config;
|
|
29
|
-
reduce(callbackfn: (previousValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentIndex: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, initialValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config;
|
|
30
|
-
reduce<U>(callbackfn: (previousValue: U, currentValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentIndex: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => U, initialValue: U): U;
|
|
31
|
-
reduceRight(callbackfn: (previousValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentIndex: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config;
|
|
32
|
-
reduceRight(callbackfn: (previousValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentIndex: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, initialValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config;
|
|
33
|
-
reduceRight<U>(callbackfn: (previousValue: U, currentValue: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, currentIndex: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => U, initialValue: U): U;
|
|
34
|
-
find<S extends import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config>(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, obj: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => value is S, thisArg?: any): S | undefined;
|
|
35
|
-
find(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, obj: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => unknown, thisArg?: any): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config | undefined;
|
|
36
|
-
findIndex(predicate: (value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, obj: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => unknown, thisArg?: any): number;
|
|
37
|
-
fill(value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, start?: number, end?: number): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.ConfigArray;
|
|
38
|
-
copyWithin(target: number, start: number, end?: number): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.ConfigArray;
|
|
39
|
-
entries(): ArrayIterator<[number, import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config]>;
|
|
40
|
-
keys(): ArrayIterator<number>;
|
|
41
|
-
values(): ArrayIterator<import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config>;
|
|
42
|
-
includes(searchElement: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, fromIndex?: number): boolean;
|
|
43
|
-
flatMap<U, This = undefined>(callback: (this: This, value: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config, index: number, array: import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config[]) => U | readonly U[], thisArg?: This | undefined): U[];
|
|
44
|
-
flat<A, D extends number = 1>(this: A, depth?: D | undefined): FlatArray<A, D>[];
|
|
45
|
-
at(index: number): import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config | undefined;
|
|
46
|
-
[Symbol.iterator](): ArrayIterator<import("@typescript-eslint/utils/dist/ts-eslint/Config.js").FlatConfig.Config>;
|
|
47
|
-
readonly [Symbol.unscopables]: {
|
|
48
|
-
[x: number]: boolean | undefined;
|
|
49
|
-
length?: boolean | undefined;
|
|
50
|
-
toString?: boolean | undefined;
|
|
51
|
-
toLocaleString?: boolean | undefined;
|
|
52
|
-
pop?: boolean | undefined;
|
|
53
|
-
push?: boolean | undefined;
|
|
54
|
-
concat?: boolean | undefined;
|
|
55
|
-
join?: boolean | undefined;
|
|
56
|
-
reverse?: boolean | undefined;
|
|
57
|
-
shift?: boolean | undefined;
|
|
58
|
-
slice?: boolean | undefined;
|
|
59
|
-
sort?: boolean | undefined;
|
|
60
|
-
splice?: boolean | undefined;
|
|
61
|
-
unshift?: boolean | undefined;
|
|
62
|
-
indexOf?: boolean | undefined;
|
|
63
|
-
lastIndexOf?: boolean | undefined;
|
|
64
|
-
every?: boolean | undefined;
|
|
65
|
-
some?: boolean | undefined;
|
|
66
|
-
forEach?: boolean | undefined;
|
|
67
|
-
map?: boolean | undefined;
|
|
68
|
-
filter?: boolean | undefined;
|
|
69
|
-
reduce?: boolean | undefined;
|
|
70
|
-
reduceRight?: boolean | undefined;
|
|
71
|
-
find?: boolean | undefined;
|
|
72
|
-
findIndex?: boolean | undefined;
|
|
73
|
-
fill?: boolean | undefined;
|
|
74
|
-
copyWithin?: boolean | undefined;
|
|
75
|
-
entries?: boolean | undefined;
|
|
76
|
-
keys?: boolean | undefined;
|
|
77
|
-
values?: boolean | undefined;
|
|
78
|
-
includes?: boolean | undefined;
|
|
79
|
-
flatMap?: boolean | undefined;
|
|
80
|
-
flat?: boolean | undefined;
|
|
81
|
-
at?: boolean | undefined;
|
|
82
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
83
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
84
|
-
};
|
|
1
|
+
declare const _exports: import("eslint").Linter.Config<import("@eslint/core").RulesConfig>[] & {
|
|
85
2
|
createConfig: typeof createConfig;
|
|
86
3
|
};
|
|
87
4
|
export = _exports;
|
|
88
|
-
declare function createConfig(options?: {}): import(
|
|
5
|
+
declare function createConfig(options?: {}): import('eslint').Linter.Config[];
|
|
89
6
|
//# sourceMappingURL=eslint.config.d.ts.map
|
package/dist/eslint.config.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const eslint = require('@eslint/js');
|
|
3
|
+
const { defineConfig } = require('eslint/config');
|
|
3
4
|
const pluginStylistic = require('@stylistic/eslint-plugin');
|
|
4
|
-
const pluginImport = require('eslint-plugin-import');
|
|
5
|
-
const
|
|
5
|
+
const pluginImport = require('eslint-plugin-import-x');
|
|
6
|
+
const { createTypeScriptImportResolver } = require('eslint-import-resolver-typescript');
|
|
7
|
+
const { default: jsdoc } = require('eslint-plugin-jsdoc');
|
|
6
8
|
const perfectionist = require('eslint-plugin-perfectionist');
|
|
7
9
|
const prettier = require('eslint-plugin-prettier');
|
|
8
10
|
const tsEslint = require('typescript-eslint');
|
|
@@ -39,13 +41,6 @@ function createConfig(options = {}) {
|
|
|
39
41
|
}
|
|
40
42
|
const configBlocks = [
|
|
41
43
|
{ ignores },
|
|
42
|
-
{
|
|
43
|
-
files: ['constants.js', 'rules.js'],
|
|
44
|
-
rules: {
|
|
45
|
-
'@typescript-eslint/naming-convention': off,
|
|
46
|
-
'perfectionist/sort-objects': off,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
44
|
...(projectStructureBlock ? [projectStructureBlock] : []),
|
|
50
45
|
eslint.configs.recommended,
|
|
51
46
|
...tsEslint.configs.recommendedTypeChecked,
|
|
@@ -69,18 +64,13 @@ function createConfig(options = {}) {
|
|
|
69
64
|
},
|
|
70
65
|
plugins: {
|
|
71
66
|
'@stylistic': pluginStylistic,
|
|
72
|
-
import: pluginImport,
|
|
67
|
+
'import-x': pluginImport,
|
|
73
68
|
jsdoc,
|
|
74
69
|
prettier,
|
|
75
70
|
},
|
|
76
|
-
rules
|
|
77
|
-
...rules,
|
|
78
|
-
'@typescript-eslint/no-misused-spread': off,
|
|
79
|
-
},
|
|
71
|
+
rules,
|
|
80
72
|
settings: {
|
|
81
|
-
'import/resolver':
|
|
82
|
-
typescript: {},
|
|
83
|
-
},
|
|
73
|
+
'import-x/resolver-next': [createTypeScriptImportResolver()],
|
|
84
74
|
},
|
|
85
75
|
},
|
|
86
76
|
{
|
|
@@ -92,7 +82,6 @@ function createConfig(options = {}) {
|
|
|
92
82
|
rules: {
|
|
93
83
|
...rules,
|
|
94
84
|
'@typescript-eslint/naming-convention': ['error', ...namingConvention.default],
|
|
95
|
-
'@typescript-eslint/no-misused-spread': off,
|
|
96
85
|
'@typescript-eslint/no-unsafe-return': off,
|
|
97
86
|
},
|
|
98
87
|
},
|
|
@@ -104,8 +93,7 @@ function createConfig(options = {}) {
|
|
|
104
93
|
},
|
|
105
94
|
},
|
|
106
95
|
];
|
|
107
|
-
return
|
|
96
|
+
return defineConfig(...configBlocks);
|
|
108
97
|
}
|
|
109
|
-
module.exports = createConfig({ ignores: ['dist/**', 'test/**', 'examples/**'] });
|
|
110
|
-
module.exports.createConfig = createConfig;
|
|
98
|
+
module.exports = Object.assign(createConfig({ ignores: ['dist/**', 'test/**', 'examples/**'] }), { createConfig });
|
|
111
99
|
//# sourceMappingURL=eslint.config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.config.js","sourceRoot":"","sources":["../eslint.config.js"],"names":[],"mappings":";AAEA,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACpC,MAAM,eAAe,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"eslint.config.js","sourceRoot":"","sources":["../eslint.config.js"],"names":[],"mappings":";AAEA,MAAM,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACpC,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAA;AAC3D,MAAM,YAAY,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AACtD,MAAM,EAAE,8BAA8B,EAAE,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAA;AACvF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AACzD,MAAM,aAAa,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAA;AAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAA;AAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;AAE7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAC3D,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AACvC,MAAM,EAAE,oBAAoB,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;AAC1D,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;AAEjD,MAAM,eAAe,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;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EAAE,OAAO,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,YAAY,EAAE,CAAC,CAAA"}
|
package/dist/index.d.mts
ADDED
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../index.mjs"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAA;AAEvC,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,CAAA;AAE/B,OAAO,EAAE,YAAY,EAAE,CAAA;AACvB,eAAe,MAAM,CAAA"}
|