@acfatah/eslint-preset 1.3.0 → 1.3.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/README.md +22 -5
- package/dist/index.d.ts +16 -0
- package/dist/index.mjs +10 -4
- package/package.json +10 -4
package/README.md
CHANGED
|
@@ -27,12 +27,18 @@ Additional rules included are:
|
|
|
27
27
|
|
|
28
28
|
## Installation
|
|
29
29
|
|
|
30
|
-
To install
|
|
30
|
+
To install ESLint and this preset with Bun, run:
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
bun add --dev @acfatah/eslint-preset
|
|
33
|
+
bun add --dev eslint @acfatah/eslint-preset
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
+
This preset declares `eslint`, `@antfu/eslint-config`, `@eslint/markdown`,
|
|
37
|
+
`eslint-plugin-better-tailwindcss`, `eslint-plugin-format`, and
|
|
38
|
+
`eslint-plugin-vue` as peer dependencies. Modern package managers, including
|
|
39
|
+
Bun, will install these peers automatically when you add the preset, so you do
|
|
40
|
+
not need to list each plugin manually in your `package.json`.
|
|
41
|
+
|
|
36
42
|
Add `eslint.config.ts` file with the following content. `config` is just a wrapper
|
|
37
43
|
to the `antfu` factory function. See [antfu Customization][antfu-factory-fuction]
|
|
38
44
|
section for more details.
|
|
@@ -62,6 +68,11 @@ export default config(
|
|
|
62
68
|
},
|
|
63
69
|
|
|
64
70
|
{
|
|
71
|
+
// Optionally when using some plugins
|
|
72
|
+
plugins: {
|
|
73
|
+
// ...
|
|
74
|
+
},
|
|
75
|
+
|
|
65
76
|
rules: {
|
|
66
77
|
...preset,
|
|
67
78
|
|
|
@@ -77,13 +88,19 @@ export default config(
|
|
|
77
88
|
Add the following configurations respectively.
|
|
78
89
|
|
|
79
90
|
```typescript
|
|
80
|
-
import { tailwind } from '@acfatah/eslint-preset
|
|
91
|
+
import { betterTailwindcssPlugin, tailwind } from '@acfatah/eslint-preset'
|
|
81
92
|
import antfu from '@antfu/eslint-config'
|
|
82
93
|
|
|
83
94
|
export default antfu(
|
|
84
|
-
|
|
95
|
+
{
|
|
96
|
+
// other configs...
|
|
97
|
+
},
|
|
85
98
|
|
|
86
99
|
{
|
|
100
|
+
plugins: {
|
|
101
|
+
...betterTailwindcssPlugin,
|
|
102
|
+
},
|
|
103
|
+
|
|
87
104
|
rules: {
|
|
88
105
|
// other rules...
|
|
89
106
|
|
|
@@ -101,7 +118,7 @@ export default antfu(
|
|
|
101
118
|
}
|
|
102
119
|
},
|
|
103
120
|
|
|
104
|
-
// other configs...
|
|
121
|
+
// other flat configs...
|
|
105
122
|
)
|
|
106
123
|
```
|
|
107
124
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
import { default as config } from '@antfu/eslint-config';
|
|
4
4
|
|
|
5
|
+
export declare const betterTailwindcssPlugin: {
|
|
6
|
+
"better-tailwindcss": {
|
|
7
|
+
configs: {
|
|
8
|
+
[x: string]: {
|
|
9
|
+
plugins: string[];
|
|
10
|
+
rules: {
|
|
11
|
+
[x: string]: "error" | "warn";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
meta: {
|
|
16
|
+
name: string;
|
|
17
|
+
};
|
|
18
|
+
rules: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
5
21
|
/**
|
|
6
22
|
* Eslint preset for Markdown files.
|
|
7
23
|
*
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
// src/plugins/better-tailwindcss.ts
|
|
2
|
+
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
3
|
+
var betterTailwindcssPlugin = {
|
|
4
|
+
"better-tailwindcss": eslintPluginBetterTailwindcss
|
|
5
|
+
};
|
|
1
6
|
// src/rules/markdown.ts
|
|
2
7
|
var markdown = {};
|
|
3
8
|
// src/rules/preset.ts
|
|
@@ -28,10 +33,10 @@ var preset = {
|
|
|
28
33
|
]
|
|
29
34
|
};
|
|
30
35
|
// src/rules/tailwind.ts
|
|
31
|
-
import
|
|
36
|
+
import eslintPluginBetterTailwindcss2 from "eslint-plugin-better-tailwindcss";
|
|
32
37
|
var tailwind = {
|
|
33
|
-
...
|
|
34
|
-
...
|
|
38
|
+
...eslintPluginBetterTailwindcss2.configs["recommended-warn"]?.rules,
|
|
39
|
+
...eslintPluginBetterTailwindcss2.configs["recommended-error"]?.rules,
|
|
35
40
|
"better-tailwindcss/enforce-consistent-line-wrapping": ["warn", {
|
|
36
41
|
printWidth: 100
|
|
37
42
|
}],
|
|
@@ -51,5 +56,6 @@ export {
|
|
|
51
56
|
tailwind,
|
|
52
57
|
preset,
|
|
53
58
|
markdown,
|
|
54
|
-
default2 as config
|
|
59
|
+
default2 as config,
|
|
60
|
+
betterTailwindcssPlugin
|
|
55
61
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acfatah/eslint-preset",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"description": "Eslint config preset.",
|
|
6
6
|
"author": "Achmad F. Ibrahim <acfatah@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,28 +30,34 @@
|
|
|
30
30
|
"node": "^20.19.0 || >=22.12.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "bun run scripts/build.ts",
|
|
33
|
+
"build": "bun --version > .bun-version && bun install && bun run scripts/build.ts",
|
|
34
34
|
"lint": "bunx --bun eslint",
|
|
35
35
|
"lint:staged": "bunx --bun eslint --pass-on-no-patterns --no-warn-ignored $(git diff --relative --cached --name-only --diff-filter=d)",
|
|
36
36
|
"lint:commit-message": "bunx --bun commitlint --edit",
|
|
37
37
|
"format": "bunx --bun eslint --fix",
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
|
-
"release": "bunx --bun bumpp
|
|
39
|
+
"release": "bun run build && bunx --bun bumpp"
|
|
40
40
|
},
|
|
41
|
-
"
|
|
41
|
+
"peerDependencies": {
|
|
42
42
|
"@antfu/eslint-config": "^6.7.1",
|
|
43
43
|
"@eslint/markdown": "^7.5.1",
|
|
44
|
+
"eslint": "^9.39.2",
|
|
44
45
|
"eslint-plugin-better-tailwindcss": "^3.8.0",
|
|
45
46
|
"eslint-plugin-format": "^1.1.0",
|
|
46
47
|
"eslint-plugin-vue": "^10.6.2"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
50
|
+
"@antfu/eslint-config": "^6.7.1",
|
|
49
51
|
"@commitlint/cli": "^20.2.0",
|
|
50
52
|
"@commitlint/config-conventional": "^20.2.0",
|
|
53
|
+
"@eslint/markdown": "^7.5.1",
|
|
51
54
|
"@types/bun": "^1.3.5",
|
|
52
55
|
"bumpp": "^10.3.2",
|
|
53
56
|
"bun-plugin-dts": "^0.3.0",
|
|
54
57
|
"eslint": "^9.39.2",
|
|
58
|
+
"eslint-plugin-better-tailwindcss": "^3.8.0",
|
|
59
|
+
"eslint-plugin-format": "^1.1.0",
|
|
60
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
55
61
|
"simple-git-hooks": "^2.13.1"
|
|
56
62
|
},
|
|
57
63
|
"simple-git-hooks": {
|