@acfatah/eslint-preset 1.0.0 → 1.0.1
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 +44 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
|
|
14
14
|
An opinionated ESLint configuration preset for TypeScript projects, based on [`antfu/eslint-config`][1].
|
|
15
15
|
|
|
16
|
+
Additional rules included are:
|
|
17
|
+
|
|
18
|
+
- Markdown files support via `eslint-plugin-markdown`
|
|
19
|
+
- Vue files support via `eslint-plugin-vue`
|
|
20
|
+
- Tailwind CSS support via `eslint-plugin-better-tailwindcss`
|
|
21
|
+
|
|
16
22
|
## Installation
|
|
17
23
|
|
|
18
24
|
To install the config, run:
|
|
@@ -30,6 +36,8 @@ import antfu from '@antfu/eslint-config'
|
|
|
30
36
|
export default antfu(
|
|
31
37
|
{
|
|
32
38
|
formatters: true,
|
|
39
|
+
|
|
40
|
+
// Specifically for Vue projects
|
|
33
41
|
vue: true,
|
|
34
42
|
},
|
|
35
43
|
|
|
@@ -37,6 +45,8 @@ export default antfu(
|
|
|
37
45
|
rules: {
|
|
38
46
|
...preset,
|
|
39
47
|
...markdown,
|
|
48
|
+
|
|
49
|
+
// Specifically for Vue projects
|
|
40
50
|
...vue,
|
|
41
51
|
},
|
|
42
52
|
},
|
|
@@ -54,6 +64,39 @@ export default antfu(
|
|
|
54
64
|
)
|
|
55
65
|
```
|
|
56
66
|
|
|
67
|
+
### Tailwind CSS Support
|
|
68
|
+
|
|
69
|
+
Add the following configurations respectively.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { tailwind } from '@acfatah/eslint-preset/rules'
|
|
73
|
+
import antfu from '@antfu/eslint-config'
|
|
74
|
+
|
|
75
|
+
export default antfu(
|
|
76
|
+
// other configs...
|
|
77
|
+
|
|
78
|
+
{
|
|
79
|
+
rules: {
|
|
80
|
+
// other rules...
|
|
81
|
+
|
|
82
|
+
...tailwind,
|
|
83
|
+
},
|
|
84
|
+
|
|
85
|
+
settings: {
|
|
86
|
+
// See: https://github.com/schoero/eslint-plugin-better-tailwindcss/blob/main/docs/settings/settings.md
|
|
87
|
+
'better-tailwindcss': {
|
|
88
|
+
// Required to work properly. Adjust accordingly.
|
|
89
|
+
entryPoint: 'src/styles/global.css',
|
|
90
|
+
// Optional variable names used to store Tailwind class names
|
|
91
|
+
variables: ['size', 'variant'],
|
|
92
|
+
},
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
// other configs...
|
|
97
|
+
)
|
|
98
|
+
```
|
|
99
|
+
|
|
57
100
|
## VS Code Support
|
|
58
101
|
|
|
59
102
|
Install the [VS Code ESLint extension][2].
|
|
@@ -123,7 +166,7 @@ Add the following vscode configuration to `.vscode/settings.json`,
|
|
|
123
166
|
}
|
|
124
167
|
```
|
|
125
168
|
|
|
126
|
-
|
|
169
|
+
### Tailwind CSS Support
|
|
127
170
|
|
|
128
171
|
Install the [Tailwind CSS IntelliSense extension][3].
|
|
129
172
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acfatah/eslint-preset",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Eslint config preset.",
|
|
6
6
|
"author": "Achmad F. Ibrahim <acfatah@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"format": "bunx --bun eslint --fix",
|
|
38
38
|
"typecheck": "tsc --noEmit",
|
|
39
39
|
"release": "bunx --bun bumpp --execute=\"bun install\"",
|
|
40
|
-
"publish": "npm publish --access public"
|
|
40
|
+
"publish": "bun run build && npm publish --access public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@antfu/eslint-config": "^6.2.0",
|