eslint-config-axkit 1.4.0 → 1.5.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 +7 -6
- package/dist/index.d.ts +7 -0
- package/dist/index.js +34 -2
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -83,12 +83,13 @@ export default [
|
|
|
83
83
|
|
|
84
84
|
## Options
|
|
85
85
|
|
|
86
|
-
| Option | Type | Description
|
|
87
|
-
| --------------- | --------- |
|
|
88
|
-
| `gitignorePath` | `string` | Path to `.gitignore` file. Patterns will be added to ESLint's ignore list.
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
86
|
+
| Option | Type | Description |
|
|
87
|
+
| --------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| `gitignorePath` | `string` | Path to `.gitignore` file. Patterns will be added to ESLint's ignore list. |
|
|
89
|
+
| `fastify` | `boolean` | Relax rules that conflict with idiomatic Fastify patterns. Configures `unicorn/prevent-abbreviations` with an allowList for common terms (`app`, `db`, `req`, etc.) and disables `@typescript-eslint/require-await` and `@typescript-eslint/strict-void-return`. |
|
|
90
|
+
| `nextjs` | `boolean` | Enable Next.js rules (`eslint-config-next` core-web-vitals + typescript). Requires `eslint-config-next` to be installed. |
|
|
91
|
+
| `storybook` | `boolean` | Enable Storybook rules (`eslint-plugin-storybook` flat/recommended). Requires `eslint-plugin-storybook` to be installed. |
|
|
92
|
+
| `tailwindcss` | `string` | Path to the Tailwind CSS entry point (e.g. `"src/app/globals.css"`). Enables `eslint-plugin-better-tailwindcss` recommended rules enforcing stylistic and correctness rules. Requires `eslint-plugin-better-tailwindcss` to be installed. |
|
|
92
93
|
|
|
93
94
|
## Requirements
|
|
94
95
|
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export type Options = {
|
|
|
11
11
|
* Requires `eslint-config-next` to be installed.
|
|
12
12
|
*/
|
|
13
13
|
nextjs?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Relax rules that conflict with idiomatic Fastify patterns:
|
|
16
|
+
* - `unicorn/prevent-abbreviations` — configured with allowList for common Fastify terms (`app`, `db`, `req`, `res`, `opts`, `params`, etc.)
|
|
17
|
+
* - `@typescript-eslint/require-await` — disabled; `FastifyPluginAsync` requires `async` but plugin bodies often contain no `await`
|
|
18
|
+
* - `@typescript-eslint/strict-void-return` — disabled; route handlers use `return reply.notFound()` as control flow
|
|
19
|
+
*/
|
|
20
|
+
fastify?: boolean;
|
|
14
21
|
/**
|
|
15
22
|
* Enable Storybook rules (eslint-plugin-storybook flat/recommended).
|
|
16
23
|
* Requires `eslint-plugin-storybook` to be installed.
|
package/dist/index.js
CHANGED
|
@@ -22,8 +22,13 @@ import { vitestConfig } from "./vitest-config.js";
|
|
|
22
22
|
* - Tailwind CSS rules (better-tailwindcss/recommended) via `tailwindcss: "path/to/entry.css"`
|
|
23
23
|
*/
|
|
24
24
|
export async function axkit(options = {}) {
|
|
25
|
-
const { gitignorePath, nextjs, storybook, tailwindcss } = options;
|
|
26
|
-
const configs = [
|
|
25
|
+
const { gitignorePath, fastify, nextjs, storybook, tailwindcss } = options;
|
|
26
|
+
const configs = [
|
|
27
|
+
{
|
|
28
|
+
name: "axkit/ignores",
|
|
29
|
+
ignores: [".agents/", ".claude/"],
|
|
30
|
+
},
|
|
31
|
+
];
|
|
27
32
|
// ── Gitignore ──────────────────────────────────────────────────────
|
|
28
33
|
if (gitignorePath) {
|
|
29
34
|
configs.push(includeIgnoreFile(gitignorePath, "Copy patterns from .gitignore"));
|
|
@@ -54,6 +59,33 @@ export async function axkit(options = {}) {
|
|
|
54
59
|
files: ["*.config.{js,ts,mjs,mts}"],
|
|
55
60
|
...tseslint.configs.disableTypeChecked,
|
|
56
61
|
}, vitestConfig);
|
|
62
|
+
// ── Fastify (disable conflicting rules) ────────────────────────────
|
|
63
|
+
if (fastify) {
|
|
64
|
+
configs.push({
|
|
65
|
+
name: "axkit/fastify",
|
|
66
|
+
rules: {
|
|
67
|
+
"unicorn/prevent-abbreviations": [
|
|
68
|
+
"error",
|
|
69
|
+
{
|
|
70
|
+
allowList: {
|
|
71
|
+
app: true,
|
|
72
|
+
args: true,
|
|
73
|
+
ctx: true,
|
|
74
|
+
db: true,
|
|
75
|
+
env: true,
|
|
76
|
+
err: true,
|
|
77
|
+
opts: true,
|
|
78
|
+
params: true,
|
|
79
|
+
req: true,
|
|
80
|
+
res: true,
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
"@typescript-eslint/require-await": "off",
|
|
85
|
+
"@typescript-eslint/strict-void-return": "off",
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
57
89
|
// ── Storybook (after base, before Prettier) ────────────────────────
|
|
58
90
|
if (storybook) {
|
|
59
91
|
const storybookPlugin = (await importOptional("eslint-plugin-storybook"));
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "eslint-config-axkit",
|
|
3
3
|
"author": "Łukasz Jerciński",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.5.0",
|
|
6
6
|
"description": "Reusable ESLint flat config for TypeScript + Node.js projects with strict type checking, Prettier, Unicorn, and Vitest",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"vitest",
|
|
54
54
|
"axkit"
|
|
55
55
|
],
|
|
56
|
-
"packageManager": "pnpm@10.30.
|
|
56
|
+
"packageManager": "pnpm@10.30.3",
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=22.14.0"
|
|
59
59
|
},
|
|
@@ -75,22 +75,22 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@eslint/compat": "^2.0.
|
|
78
|
+
"@eslint/compat": "^2.0.3",
|
|
79
79
|
"@eslint/js": "^10.0.1",
|
|
80
80
|
"@vitest/eslint-plugin": "^1.6.9",
|
|
81
81
|
"eslint-config-prettier": "^10.1.8",
|
|
82
82
|
"eslint-plugin-unicorn": "^63.0.0",
|
|
83
|
-
"globals": "^17.
|
|
84
|
-
"typescript-eslint": "^8.56.
|
|
83
|
+
"globals": "^17.4.0",
|
|
84
|
+
"typescript-eslint": "^8.56.1"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
88
|
-
"@types/node": "^25.3.
|
|
88
|
+
"@types/node": "^25.3.5",
|
|
89
89
|
"@vitest/coverage-v8": "^4.0.18",
|
|
90
|
-
"eslint": "^10.0.
|
|
90
|
+
"eslint": "^10.0.3",
|
|
91
91
|
"fta-check": "^1.5.1",
|
|
92
92
|
"fta-cli": "^3.0.0",
|
|
93
|
-
"knip": "^5.
|
|
93
|
+
"knip": "^5.85.0",
|
|
94
94
|
"prettier": "3.8.1",
|
|
95
95
|
"semantic-release": "^25.0.3",
|
|
96
96
|
"typescript": "^5.9.3",
|