@acfatah/eslint-preset 1.3.1 → 1.3.3
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/LICENSE +21 -0
- package/README.md +37 -9
- package/package.json +11 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Achmad F. Ibrahim
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
<img
|
|
6
6
|
alt="Code Style"
|
|
7
7
|
src="https://antfu.me/badge-code-style.svg"></a>
|
|
8
|
+
<a href="./LICENSE">
|
|
9
|
+
<img alt="GitHub" src="https://img.shields.io/github/license/acfatah/eslint-preset?style=flat-square"></a>
|
|
8
10
|
<a href="https://www.npmjs.com/package/@acfatah/eslint-preset">
|
|
9
11
|
<img
|
|
10
12
|
alt="NPM Version"
|
|
11
13
|
src="https://img.shields.io/npm/v/%40acfatah%2Feslint-preset"></a>
|
|
12
|
-
<a href="https://github.com/
|
|
14
|
+
<a href="https://github.com/acfatah/eslint-preset/commits/main">
|
|
13
15
|
<img
|
|
14
16
|
alt="GitHub last commit (by committer)"
|
|
15
17
|
src="https://img.shields.io/github/last-commit/acfatah/eslint-preset?display_timestamp=committer&style=flat-square"></a>
|
|
@@ -27,19 +29,24 @@ Additional rules included are:
|
|
|
27
29
|
|
|
28
30
|
## Installation
|
|
29
31
|
|
|
30
|
-
To install
|
|
32
|
+
To install ESLint and this preset with Bun, run:
|
|
31
33
|
|
|
32
34
|
```bash
|
|
33
|
-
bun add --dev @acfatah/eslint-preset
|
|
35
|
+
bun add --dev eslint @acfatah/eslint-preset
|
|
34
36
|
```
|
|
35
37
|
|
|
38
|
+
This preset declares `eslint`, `@antfu/eslint-config`, `@eslint/markdown`,
|
|
39
|
+
`eslint-plugin-better-tailwindcss`, `eslint-plugin-format`, and
|
|
40
|
+
`eslint-plugin-vue` as peer dependencies. Modern package managers, including
|
|
41
|
+
Bun, will install these peers automatically when you add the preset, so you do
|
|
42
|
+
not need to list each plugin manually in your `package.json`.
|
|
43
|
+
|
|
36
44
|
Add `eslint.config.ts` file with the following content. `config` is just a wrapper
|
|
37
45
|
to the `antfu` factory function. See [antfu Customization][antfu-factory-fuction]
|
|
38
46
|
section for more details.
|
|
39
47
|
|
|
40
48
|
```typescript
|
|
41
|
-
import { config } from '@acfatah/eslint-preset'
|
|
42
|
-
import { markdown, preset, vue } from '@acfatah/eslint-preset/rules'
|
|
49
|
+
import { config, markdown, preset, vue } from '@acfatah/eslint-preset'
|
|
43
50
|
|
|
44
51
|
export default config(
|
|
45
52
|
{
|
|
@@ -56,8 +63,8 @@ export default config(
|
|
|
56
63
|
'**/coverage/**',
|
|
57
64
|
'**/dist/**',
|
|
58
65
|
'**/logs/**',
|
|
66
|
+
'**/tsconfig.*',
|
|
59
67
|
'bun.lock',
|
|
60
|
-
'tsconfig.*',
|
|
61
68
|
],
|
|
62
69
|
},
|
|
63
70
|
|
|
@@ -70,6 +77,9 @@ export default config(
|
|
|
70
77
|
rules: {
|
|
71
78
|
...preset,
|
|
72
79
|
|
|
80
|
+
// Optional markdown rules
|
|
81
|
+
...markdown,
|
|
82
|
+
|
|
73
83
|
// Specifically for Vue projects
|
|
74
84
|
...vue,
|
|
75
85
|
},
|
|
@@ -82,10 +92,9 @@ export default config(
|
|
|
82
92
|
Add the following configurations respectively.
|
|
83
93
|
|
|
84
94
|
```typescript
|
|
85
|
-
import { betterTailwindcssPlugin, tailwind } from '@acfatah/eslint-preset'
|
|
86
|
-
import antfu from '@antfu/eslint-config'
|
|
95
|
+
import { betterTailwindcssPlugin, config, tailwind } from '@acfatah/eslint-preset'
|
|
87
96
|
|
|
88
|
-
export default
|
|
97
|
+
export default config(
|
|
89
98
|
{
|
|
90
99
|
// other configs...
|
|
91
100
|
},
|
|
@@ -116,6 +125,24 @@ export default antfu(
|
|
|
116
125
|
)
|
|
117
126
|
```
|
|
118
127
|
|
|
128
|
+
## Inspect Example Configs
|
|
129
|
+
|
|
130
|
+
You can inspect the fully resolved configs shipped in this repo. These commands
|
|
131
|
+
run from the project root and run the [ESLint config inspector][4] against the
|
|
132
|
+
templates used.
|
|
133
|
+
|
|
134
|
+
### Default TypeScript preset
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
bun inspect:default
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Vue + Tailwind preset
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
bun inspect:vue-tailwind
|
|
144
|
+
```
|
|
145
|
+
|
|
119
146
|
## VS Code Support
|
|
120
147
|
|
|
121
148
|
Install the [VS Code ESLint extension][2].
|
|
@@ -222,4 +249,5 @@ curl -s https://raw.githubusercontent.com/acfatah/eslint-preset/refs/heads/main/
|
|
|
222
249
|
[1]: https://github.com/antfu/eslint-config
|
|
223
250
|
[2]: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
|
|
224
251
|
[3]: https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss
|
|
252
|
+
[4]: https://github.com/eslint/config-inspector
|
|
225
253
|
[antfu-factory-fuction]: https://github.com/antfu/eslint-config?tab=readme-ov-file#customization
|
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.3",
|
|
5
5
|
"description": "Eslint config preset.",
|
|
6
6
|
"author": "Achmad F. Ibrahim <acfatah@gmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -30,28 +30,36 @@
|
|
|
30
30
|
"node": "^20.19.0 || >=22.12.0"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "bun --version > .bun-version && bun install && bun run
|
|
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
|
+
"inspect:default": "cd templates/default && bunx --bun eslint --inspect-config",
|
|
38
|
+
"inspect:vue-tailwind": "cd templates/vue-tailwind && bunx --bun eslint --inspect-config",
|
|
37
39
|
"format": "bunx --bun eslint --fix",
|
|
38
40
|
"typecheck": "tsc --noEmit",
|
|
39
41
|
"release": "bun run build && bunx --bun bumpp"
|
|
40
42
|
},
|
|
41
|
-
"
|
|
43
|
+
"peerDependencies": {
|
|
42
44
|
"@antfu/eslint-config": "^6.7.1",
|
|
43
45
|
"@eslint/markdown": "^7.5.1",
|
|
46
|
+
"eslint": "^9.39.2",
|
|
44
47
|
"eslint-plugin-better-tailwindcss": "^3.8.0",
|
|
45
48
|
"eslint-plugin-format": "^1.1.0",
|
|
46
49
|
"eslint-plugin-vue": "^10.6.2"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
52
|
+
"@antfu/eslint-config": "^6.7.3",
|
|
49
53
|
"@commitlint/cli": "^20.2.0",
|
|
50
54
|
"@commitlint/config-conventional": "^20.2.0",
|
|
55
|
+
"@eslint/markdown": "^7.5.1",
|
|
51
56
|
"@types/bun": "^1.3.5",
|
|
52
57
|
"bumpp": "^10.3.2",
|
|
53
58
|
"bun-plugin-dts": "^0.3.0",
|
|
54
59
|
"eslint": "^9.39.2",
|
|
60
|
+
"eslint-plugin-better-tailwindcss": "^3.8.0",
|
|
61
|
+
"eslint-plugin-format": "^1.1.0",
|
|
62
|
+
"eslint-plugin-vue": "^10.6.2",
|
|
55
63
|
"simple-git-hooks": "^2.13.1"
|
|
56
64
|
},
|
|
57
65
|
"simple-git-hooks": {
|