@frabbit/eslint-config 1.5.15 → 7.4.6
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 +1 -1
- package/README.md +40 -36
- package/dist/index.d.mts +14606 -0
- package/dist/index.mjs +1094 -0
- package/package.json +82 -60
- package/dist/index.cjs +0 -1409
- package/dist/index.d.cts +0 -107
- package/dist/index.d.ts +0 -107
- package/dist/index.js +0 -1303
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright © 2021-PRESENT
|
|
3
|
+
Copyright © 2021-PRESENT Kevin Deng (https://github.com/sxzz)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.
|
|
4
4
|
based on https://github.com/sxzz/eslint-config
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
A opinionated ESLint config preset for JavaScript, TypeScript, Vue,
|
|
7
|
+
and Prettier.
|
|
7
8
|
|
|
8
9
|
## Features
|
|
9
10
|
|
|
10
11
|
- Format with Prettier.
|
|
11
|
-
- Designed to work with TypeScript, Vue
|
|
12
|
+
- Designed to work with TypeScript, Vue out-of-box.
|
|
12
13
|
- Support JSON(5), YAML, Markdown...
|
|
13
14
|
- Sort imports, `package.json`, `tsconfig.json`...
|
|
14
15
|
- [ESLint Flat config](https://eslint.org/docs/latest/use/configure/configuration-files-new), compose easily!
|
|
16
|
+
- Ignores common files like `dist`, `node_modules`, `coverage`, and files in `.gitignore`.
|
|
15
17
|
- Reasonable defaults, best practices, only one-line of config
|
|
18
|
+
- Reasonable strict, but with better code quality.
|
|
16
19
|
|
|
17
20
|
## Install
|
|
18
21
|
|
|
@@ -20,54 +23,55 @@ based on https://github.com/sxzz/eslint-config
|
|
|
20
23
|
npm i -D @frabbit/eslint-config
|
|
21
24
|
```
|
|
22
25
|
|
|
23
|
-
Require Node.js >=
|
|
26
|
+
Require Node.js >= 20.0.0, and ESLint >= 9.5.0.
|
|
24
27
|
|
|
25
28
|
## Usage
|
|
26
29
|
|
|
27
|
-
```js
|
|
28
|
-
// eslint.config.js
|
|
29
|
-
import { all } from '@frabbit/eslint-config'
|
|
30
|
-
|
|
31
|
-
export default all
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Custom Config
|
|
35
|
-
|
|
36
30
|
```js
|
|
37
31
|
import { frabbit } from '@frabbit/eslint-config'
|
|
32
|
+
|
|
38
33
|
export default frabbit(
|
|
34
|
+
// Features: it'll detect installed dependency and enable necessary features automatically
|
|
35
|
+
{
|
|
36
|
+
prettier: true,
|
|
37
|
+
markdown: true,
|
|
38
|
+
vue: true, // auto detection
|
|
39
|
+
unocss: false, // auto detection
|
|
40
|
+
},
|
|
39
41
|
[
|
|
40
42
|
/* your custom config */
|
|
41
|
-
]
|
|
42
|
-
|
|
43
|
-
)
|
|
43
|
+
]
|
|
44
|
+
).removeRules('foo/bar') // see more in https://github.com/antfu/eslint-flat-config-utils
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
###
|
|
47
|
+
### Presets
|
|
47
48
|
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
```js
|
|
50
|
+
// eslint.config.js
|
|
51
|
+
import {
|
|
52
|
+
presetJavaScript, // Ignore common files and include javascript support
|
|
53
|
+
presetJsonc, // Includes basic json(c) file support and sorting json keys
|
|
54
|
+
presetLangsExtensions, // Includes markdown, yaml + `presetJsonc` support
|
|
55
|
+
presetBasic, // Includes `presetJavaScript` and typescript support
|
|
56
|
+
|
|
57
|
+
// Includes
|
|
58
|
+
// - `presetBasic` (JS+TS) support
|
|
59
|
+
// - `presetLangsExtensions` (markdown, yaml, jsonc) support
|
|
60
|
+
// - Vue support
|
|
61
|
+
// - UnoCSS support (`uno.config.ts` is required)
|
|
62
|
+
// - Prettier support
|
|
63
|
+
presetAll,
|
|
64
|
+
} from '@frabbit/eslint-config'
|
|
65
|
+
|
|
66
|
+
export default presetAll
|
|
52
67
|
```
|
|
53
68
|
|
|
69
|
+
See [preset.ts](./src/presets.ts) for more details.
|
|
70
|
+
|
|
54
71
|
## Comparing to [`@antfu/eslint-config`](https://github.com/antfu/eslint-config)
|
|
55
72
|
|
|
56
73
|
Most of the rules are the same, but there are some differences:
|
|
57
74
|
|
|
58
|
-
- Use Prettier instead of [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic).
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- More stricter rules.
|
|
62
|
-
|
|
63
|
-
## Sponsors
|
|
64
|
-
|
|
65
|
-
<p align="center">
|
|
66
|
-
<a href="https://cdn.jsdelivr.net/gh/frabbit/sponsors/sponsors.svg">
|
|
67
|
-
<img src='https://cdn.jsdelivr.net/gh/frabbit/sponsors/sponsors.svg'/>
|
|
68
|
-
</a>
|
|
69
|
-
</p>
|
|
70
|
-
|
|
71
|
-
## License
|
|
72
|
-
|
|
73
|
-
[MIT](./LICENSE) License © 2021-PRESENT [三咲智子](https://github.com/frenchrabbit)
|
|
75
|
+
- Use [Prettier](https://prettier.io/) instead of [ESLint Stylistic](https://github.com/eslint-stylistic/eslint-stylistic).
|
|
76
|
+
- React and Svelte are not supported.
|
|
77
|
+
- Maybe stricter and simpler.
|