eslint-config-axkit 1.2.1 → 1.3.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 -4
- package/dist/index.d.ts +8 -0
- package/dist/index.js +15 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -83,14 +83,17 @@ export default [
|
|
|
83
83
|
|
|
84
84
|
## Options
|
|
85
85
|
|
|
86
|
-
| Option | Type
|
|
87
|
-
| --------------- |
|
|
88
|
-
| `gitignorePath` | `string`
|
|
86
|
+
| Option | Type | Description |
|
|
87
|
+
| --------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| `gitignorePath` | `string` | Path to `.gitignore` file. Patterns will be added to ESLint's ignore list. |
|
|
89
|
+
| `nextjs` | `boolean` | Enable Next.js rules (`eslint-config-next` core-web-vitals + typescript). Requires `eslint-config-next` to be installed. |
|
|
90
|
+
| `storybook` | `boolean` | Enable Storybook rules (`eslint-plugin-storybook` flat/recommended). Requires `eslint-plugin-storybook` to be installed. |
|
|
91
|
+
| `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. |
|
|
89
92
|
|
|
90
93
|
## Requirements
|
|
91
94
|
|
|
92
95
|
- Node.js >= 22.14.0
|
|
93
|
-
- ESLint >=
|
|
96
|
+
- ESLint >= 10
|
|
94
97
|
|
|
95
98
|
## License
|
|
96
99
|
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,13 @@ export type Options = {
|
|
|
16
16
|
* Requires `eslint-plugin-storybook` to be installed.
|
|
17
17
|
*/
|
|
18
18
|
storybook?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Path to the Tailwind CSS entry point (e.g. `"src/app/globals.css"`).
|
|
21
|
+
* Enables eslint-plugin-better-tailwindcss recommended rules and configures
|
|
22
|
+
* the plugin to resolve project-specific classes, variants, and plugins.
|
|
23
|
+
* Requires `eslint-plugin-better-tailwindcss` to be installed.
|
|
24
|
+
*/
|
|
25
|
+
tailwindcss?: string;
|
|
19
26
|
};
|
|
20
27
|
/**
|
|
21
28
|
* Creates a complete ESLint flat config for TypeScript projects.
|
|
@@ -30,5 +37,6 @@ export type Options = {
|
|
|
30
37
|
* Optional:
|
|
31
38
|
* - Next.js rules (core-web-vitals + typescript) via `nextjs: true`
|
|
32
39
|
* - Storybook rules (flat/recommended) via `storybook: true`
|
|
40
|
+
* - Tailwind CSS rules (better-tailwindcss/recommended) via `tailwindcss: "path/to/entry.css"`
|
|
33
41
|
*/
|
|
34
42
|
export declare function axkit(options?: Options): Promise<Linter.Config[]>;
|
package/dist/index.js
CHANGED
|
@@ -19,9 +19,10 @@ import { vitestConfig } from "./vitest-config.js";
|
|
|
19
19
|
* Optional:
|
|
20
20
|
* - Next.js rules (core-web-vitals + typescript) via `nextjs: true`
|
|
21
21
|
* - Storybook rules (flat/recommended) via `storybook: true`
|
|
22
|
+
* - Tailwind CSS rules (better-tailwindcss/recommended) via `tailwindcss: "path/to/entry.css"`
|
|
22
23
|
*/
|
|
23
24
|
export async function axkit(options = {}) {
|
|
24
|
-
const { gitignorePath, nextjs, storybook } = options;
|
|
25
|
+
const { gitignorePath, nextjs, storybook, tailwindcss } = options;
|
|
25
26
|
const configs = [];
|
|
26
27
|
// ── Gitignore ──────────────────────────────────────────────────────
|
|
27
28
|
if (gitignorePath) {
|
|
@@ -58,6 +59,19 @@ export async function axkit(options = {}) {
|
|
|
58
59
|
const storybookPlugin = (await importOptional("eslint-plugin-storybook"));
|
|
59
60
|
configs.push(...storybookPlugin.configs["flat/recommended"]);
|
|
60
61
|
}
|
|
62
|
+
// ── Tailwind CSS (before Prettier) ─────────────────────────────────
|
|
63
|
+
if (tailwindcss) {
|
|
64
|
+
const tailwindPlugin = (await importOptional("eslint-plugin-better-tailwindcss"));
|
|
65
|
+
const tailwindConfig = tailwindPlugin.configs.recommended;
|
|
66
|
+
configs.push(...(Array.isArray(tailwindConfig) ? tailwindConfig : [tailwindConfig]), {
|
|
67
|
+
name: "axkit/tailwindcss-entry-point",
|
|
68
|
+
settings: {
|
|
69
|
+
"better-tailwindcss": {
|
|
70
|
+
entryPoint: tailwindcss,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
61
75
|
// ── Prettier compatibility (must be last) ──────────────────────────
|
|
62
76
|
configs.push(eslintConfigPrettier);
|
|
63
77
|
return configs;
|
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.3.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",
|
|
@@ -60,12 +60,16 @@
|
|
|
60
60
|
"peerDependencies": {
|
|
61
61
|
"eslint": ">=10",
|
|
62
62
|
"eslint-config-next": ">=16",
|
|
63
|
+
"eslint-plugin-better-tailwindcss": ">=4",
|
|
63
64
|
"eslint-plugin-storybook": ">=10"
|
|
64
65
|
},
|
|
65
66
|
"peerDependenciesMeta": {
|
|
66
67
|
"eslint-config-next": {
|
|
67
68
|
"optional": true
|
|
68
69
|
},
|
|
70
|
+
"eslint-plugin-better-tailwindcss": {
|
|
71
|
+
"optional": true
|
|
72
|
+
},
|
|
69
73
|
"eslint-plugin-storybook": {
|
|
70
74
|
"optional": true
|
|
71
75
|
}
|