@sxzz/eslint-config 3.0.0-beta.4 → 3.0.0-beta.5
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 +27 -0
- package/package.json +14 -14
- package/src/js.js +5 -4
- package/src/markdown.js +1 -1
- package/src/prettier.js +1 -1
- package/src/typescript.js +1 -1
- package/src/vue.js +3 -3
package/README.md
CHANGED
|
@@ -4,12 +4,39 @@ Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.
|
|
|
4
4
|
|
|
5
5
|
[Legacy Version](https://github.com/sxzz/eslint-config-legacy)
|
|
6
6
|
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Support Vue 2 and 3 out-of-box.
|
|
10
|
+
- Select the required file types as needed.
|
|
11
|
+
- Support JSON(5), YAML, Markdown...
|
|
12
|
+
|
|
7
13
|
## Install
|
|
8
14
|
|
|
9
15
|
```bash
|
|
10
16
|
npm i @sxzz/eslint-config
|
|
11
17
|
```
|
|
12
18
|
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
// eslint.config.js
|
|
23
|
+
import { all } from '@sxzz/eslint-config'
|
|
24
|
+
|
|
25
|
+
export default defineFlatConfig(all)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Custom Config
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
import { sxzz } from '@sxzz/eslint-config'
|
|
32
|
+
export default sxzz(
|
|
33
|
+
[
|
|
34
|
+
/* your custom config */
|
|
35
|
+
],
|
|
36
|
+
{ vue: true, prettier: true, markdown: true }
|
|
37
|
+
)
|
|
38
|
+
```
|
|
39
|
+
|
|
13
40
|
## Sponsors
|
|
14
41
|
|
|
15
42
|
<p align="center">
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sxzz/eslint-config",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
4
|
-
"packageManager": "pnpm@
|
|
3
|
+
"version": "3.0.0-beta.5",
|
|
4
|
+
"packageManager": "pnpm@8.2.0",
|
|
5
5
|
"description": "ESLint config for @sxzz.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,32 +33,32 @@
|
|
|
33
33
|
"eslint": "^8.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@eslint/js": "^8.
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
38
|
-
"@typescript-eslint/parser": "^5.
|
|
36
|
+
"@eslint/js": "^8.38.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^5.58.0",
|
|
38
|
+
"@typescript-eslint/parser": "^5.58.0",
|
|
39
39
|
"eslint-config-prettier": "^8.8.0",
|
|
40
|
-
"eslint-plugin-antfu": "^0.38.
|
|
40
|
+
"eslint-plugin-antfu": "^0.38.4",
|
|
41
41
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
42
42
|
"eslint-plugin-import": "^2.27.5",
|
|
43
43
|
"eslint-plugin-jsonc": "^2.7.0",
|
|
44
44
|
"eslint-plugin-markdown": "^3.0.0",
|
|
45
45
|
"eslint-plugin-prettier": "^4.2.1",
|
|
46
46
|
"eslint-plugin-unicorn": "^46.0.0",
|
|
47
|
-
"eslint-plugin-vue": "^9.
|
|
47
|
+
"eslint-plugin-vue": "^9.11.0",
|
|
48
48
|
"eslint-plugin-yml": "^1.5.0",
|
|
49
49
|
"globals": "^13.20.0",
|
|
50
50
|
"jsonc-eslint-parser": "^2.2.0",
|
|
51
51
|
"local-pkg": "^0.4.3",
|
|
52
|
-
"prettier": "^2.8.
|
|
53
|
-
"vue-eslint-parser": "^9.1.
|
|
52
|
+
"prettier": "^2.8.7",
|
|
53
|
+
"vue-eslint-parser": "^9.1.1",
|
|
54
54
|
"yaml-eslint-parser": "^1.2.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/node": "^18.15.
|
|
58
|
-
"bumpp": "^9.
|
|
59
|
-
"eslint": "^8.
|
|
60
|
-
"eslint-define-config": "^1.
|
|
61
|
-
"typescript": "^5.0.
|
|
57
|
+
"@types/node": "^18.15.11",
|
|
58
|
+
"bumpp": "^9.1.0",
|
|
59
|
+
"eslint": "^8.38.0",
|
|
60
|
+
"eslint-define-config": "^1.18.0",
|
|
61
|
+
"typescript": "^5.0.4"
|
|
62
62
|
},
|
|
63
63
|
"engines": {
|
|
64
64
|
"node": ">=14.19.0"
|
package/src/js.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import globals from 'globals'
|
|
2
1
|
import jsConfig from '@eslint/js'
|
|
2
|
+
import antfuPlugin from 'eslint-plugin-antfu'
|
|
3
3
|
import importPlugin from 'eslint-plugin-import'
|
|
4
4
|
import unicornPlugin from 'eslint-plugin-unicorn'
|
|
5
|
-
import
|
|
5
|
+
import globals from 'globals'
|
|
6
6
|
|
|
7
7
|
export { importPlugin, unicornPlugin, antfuPlugin }
|
|
8
8
|
|
|
@@ -138,10 +138,11 @@ export const imports = [
|
|
|
138
138
|
'sibling',
|
|
139
139
|
'index',
|
|
140
140
|
'object',
|
|
141
|
-
'type',
|
|
142
141
|
],
|
|
143
142
|
pathGroups: [{ pattern: '@/**', group: 'internal' }],
|
|
144
|
-
|
|
143
|
+
alphabetize: {
|
|
144
|
+
order: 'asc',
|
|
145
|
+
},
|
|
145
146
|
},
|
|
146
147
|
],
|
|
147
148
|
|
package/src/markdown.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import markdownPlugin from 'eslint-plugin-markdown'
|
|
2
1
|
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
2
|
+
import markdownPlugin from 'eslint-plugin-markdown'
|
|
3
3
|
import { GLOB_MARKDOWN, GLOB_SRC, GLOB_VUE } from './shared.js'
|
|
4
4
|
|
|
5
5
|
/** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
|
package/src/prettier.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import prettierPlugin from 'eslint-plugin-prettier'
|
|
2
1
|
import prettierConfig from 'eslint-config-prettier'
|
|
2
|
+
import prettierPlugin from 'eslint-plugin-prettier'
|
|
3
3
|
|
|
4
4
|
const prettierConflictRules = { ...prettierConfig.rules }
|
|
5
5
|
delete prettierConflictRules['vue/html-self-closing']
|
package/src/typescript.js
CHANGED
package/src/vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
2
|
+
import vuePlugin from 'eslint-plugin-vue'
|
|
1
3
|
import { getPackageInfoSync } from 'local-pkg'
|
|
2
4
|
import vueParser from 'vue-eslint-parser'
|
|
3
|
-
import vuePlugin from 'eslint-plugin-vue'
|
|
4
|
-
import tsPlugin from '@typescript-eslint/eslint-plugin'
|
|
5
|
-
import { typescript } from './typescript.js'
|
|
6
5
|
import { GLOB_VUE } from './shared.js'
|
|
6
|
+
import { typescript } from './typescript.js'
|
|
7
7
|
|
|
8
8
|
export { vueParser, vuePlugin }
|
|
9
9
|
|