@jiakun-zhao/eslint-config 1.3.1 → 2.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 +1 -67
- package/dist/index.mjs +22 -0
- package/package.json +10 -11
- package/dist/index.cjs +0 -47
package/README.md
CHANGED
|
@@ -1,71 +1,5 @@
|
|
|
1
1
|
## @jiakun-zhao/eslint-config
|
|
2
|
-
|
|
3
|
-
> Extends [@antfu/eslint-config](https://github.com/antfu/eslint-config).
|
|
4
|
-
|
|
5
|
-
<br />
|
|
6
2
|
|
|
7
3
|

|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
1. Install the package
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
ni -D @jiakun-zhao/eslint-config
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
2. Add the following to your `package.json` file
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
"eslintConfig": {
|
|
22
|
-
"extends": "@jiakun-zhao"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
3. Add the following to your `.vscode/settings.json` file
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
{
|
|
31
|
-
"editor.codeActionsOnSave": {
|
|
32
|
-
"source.fixAll.eslint": true
|
|
33
|
-
},
|
|
34
|
-
"editor.formatOnSave": false,
|
|
35
|
-
// "prettier.enable": false,
|
|
36
|
-
"eslint.validate": [
|
|
37
|
-
"javascript",
|
|
38
|
-
"javascriptreact",
|
|
39
|
-
"typescript",
|
|
40
|
-
"typescriptreact",
|
|
41
|
-
"vue",
|
|
42
|
-
"html",
|
|
43
|
-
"markdown",
|
|
44
|
-
"json",
|
|
45
|
-
"jsonc",
|
|
46
|
-
"yaml"
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
#### Other
|
|
52
|
-
|
|
53
|
-
UnoCSS
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
pnpm i @unocss/eslint-config
|
|
57
|
-
pnpm i eslint-plugin-solid
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
```diff
|
|
61
|
-
"eslintConfig": {
|
|
62
|
-
+ "plugins": [
|
|
63
|
-
+ "solid"
|
|
64
|
-
+ ],
|
|
65
|
-
"extends": [
|
|
66
|
-
"@jiakun-zhao",
|
|
67
|
-
+ "@unocss",
|
|
68
|
-
+ "plugin:solid/recommended"
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
```
|
|
5
|
+
Extends [@antfu/eslint-config](https://github.com/antfu/eslint-config).
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import antfu from '@antfu/eslint-config';
|
|
2
|
+
|
|
3
|
+
const index = antfu({
|
|
4
|
+
stylistic: {
|
|
5
|
+
overrides: {
|
|
6
|
+
"style/jsx-one-expression-per-line": "off"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
typescript: {
|
|
10
|
+
overrides: {
|
|
11
|
+
"ts/ban-ts-comment": "off"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
vue: {
|
|
15
|
+
overrides: {
|
|
16
|
+
"vue/html-self-closing": "off",
|
|
17
|
+
"vue/singleline-html-element-content-newline": "off"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export { index as default };
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jiakun-zhao/eslint-config",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.0.1",
|
|
5
|
+
"packageManager": "pnpm@8.15.4",
|
|
5
6
|
"description": "Jiakun's ESLint config.",
|
|
6
7
|
"author": "Jiakun Zhao <hi@zhaojiakun.com>",
|
|
7
8
|
"license": "MIT",
|
|
@@ -9,24 +10,22 @@
|
|
|
9
10
|
"keywords": [
|
|
10
11
|
"eslint-config"
|
|
11
12
|
],
|
|
12
|
-
"main": "dist/index.
|
|
13
|
+
"main": "dist/index.mjs",
|
|
13
14
|
"files": [
|
|
14
|
-
"dist/index.
|
|
15
|
+
"dist/index.mjs",
|
|
15
16
|
"package.json"
|
|
16
17
|
],
|
|
17
18
|
"peerDependencies": {
|
|
18
19
|
"eslint": ">=7.4.0"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
|
-
"@antfu/eslint-config": "^
|
|
22
|
-
"eslint-plugin-react": "^7.33.2"
|
|
22
|
+
"@antfu/eslint-config": "^2.8.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@types/
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"typescript": "^5.2.2",
|
|
25
|
+
"@types/node": "^20.11.25",
|
|
26
|
+
"bumpp": "^9.4.0",
|
|
27
|
+
"eslint": "^8.57.0",
|
|
28
|
+
"typescript": "^5.4.2",
|
|
30
29
|
"unbuild": "^2.0.0"
|
|
31
30
|
},
|
|
32
31
|
"eslintConfig": {
|
package/dist/index.cjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = {
|
|
4
|
-
extends: [
|
|
5
|
-
"@antfu",
|
|
6
|
-
"plugin:react/recommended"
|
|
7
|
-
],
|
|
8
|
-
rules: {
|
|
9
|
-
"no-console": "warn",
|
|
10
|
-
"brace-style": ["warn", "1tbs"],
|
|
11
|
-
"@typescript-eslint/brace-style": ["warn", "1tbs"],
|
|
12
|
-
"@typescript-eslint/ban-ts-comment": ["off"],
|
|
13
|
-
"@stylistic/ts/brace-style": "off",
|
|
14
|
-
// imports
|
|
15
|
-
"unused-imports/no-unused-imports": "warn",
|
|
16
|
-
// vue
|
|
17
|
-
"vue/singleline-html-element-content-newline": "off",
|
|
18
|
-
"vue/html-self-closing": "off",
|
|
19
|
-
"vue/static-class-names-order": "warn",
|
|
20
|
-
// react & jsx
|
|
21
|
-
"jsx-quotes": ["error", "prefer-single"],
|
|
22
|
-
"react/react-in-jsx-scope": "off",
|
|
23
|
-
"react/no-unknown-property": "off",
|
|
24
|
-
"react/self-closing-comp": "off",
|
|
25
|
-
"react/destructuring-assignment": "off",
|
|
26
|
-
"react/no-multi-comp": "off",
|
|
27
|
-
"react/function-component-definition": "off",
|
|
28
|
-
"react/display-name": "off",
|
|
29
|
-
"react/button-has-type": "off",
|
|
30
|
-
"react/no-children-prop": "off",
|
|
31
|
-
"react/jsx-key": "off",
|
|
32
|
-
"react/jsx-indent": ["error", 2],
|
|
33
|
-
"react/jsx-indent-props": ["error", 2],
|
|
34
|
-
"react/jsx-max-depth": "off",
|
|
35
|
-
"react/jsx-filename-extension": "off",
|
|
36
|
-
"react/jsx-no-literals": "off",
|
|
37
|
-
"react/jsx-max-props-per-line": "off",
|
|
38
|
-
"react/jsx-tag-spacing": ["error", { closingSlash: "never", beforeSelfClosing: "always", afterOpening: "never", beforeClosing: "never" }],
|
|
39
|
-
"react/jsx-newline": "off",
|
|
40
|
-
"react/jsx-one-expression-per-line": "off",
|
|
41
|
-
"react/jsx-no-bind": "off",
|
|
42
|
-
"react/jsx-curly-spacing": ["error", { when: "never", children: { when: "never" } }],
|
|
43
|
-
"react/jsx-closing-bracket-location": "warn"
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
module.exports = index;
|