@vida0905/eslint-config 0.1.5 → 0.1.7
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 -21
- package/README.md +64 -62
- package/dist/index.cjs +8 -3
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -2
- package/package.json +13 -11
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Vida Xie
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Vida Xie
|
|
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
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
# @vida0905/eslint-config
|
|
2
|
-
|
|
3
|
-
[](https://npmjs.com/package/@vida0905/eslint-config) [](https://github.com/antfu/eslint-config)
|
|
4
|
-
|
|
5
|
-
Self use eslint config, extends [antfu's config](https://github.com/antfu/eslint-config)
|
|
6
|
-
|
|
7
|
-
### Difference
|
|
8
|
-
|
|
9
|
-
- More stricter rules.
|
|
10
|
-
- Support `pinia`.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
1
|
+
# @vida0905/eslint-config
|
|
2
|
+
|
|
3
|
+
[](https://npmjs.com/package/@vida0905/eslint-config) [](https://github.com/antfu/eslint-config)
|
|
4
|
+
|
|
5
|
+
Self use eslint config, extends [antfu's config](https://github.com/antfu/eslint-config)
|
|
6
|
+
|
|
7
|
+
### Difference
|
|
8
|
+
|
|
9
|
+
- More stricter rules.
|
|
10
|
+
- Support `pinia`.
|
|
11
|
+
- Set `semi` to `true`
|
|
12
|
+
- Disable `formatter` and `jsx`
|
|
13
|
+
|
|
14
|
+
### Setup
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
npm i -D @vida/eslint-config
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
in `eslint.config.js`
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { vida } from '@vida0905/eslint-config';
|
|
24
|
+
|
|
25
|
+
export default vida();
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
in `.vscode/settings.json`, more info to [@antfu/eslint-config](https://github.com/antfu/eslint-config?tab=readme-ov-file#vs-code-support-auto-fix-on-save)
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
// Enable the ESlint flat config support
|
|
33
|
+
"eslint.experimental.useFlatConfig": true,
|
|
34
|
+
|
|
35
|
+
// Disable the default formatter, use eslint instead
|
|
36
|
+
"prettier.enable": false,
|
|
37
|
+
"editor.formatOnSave": false,
|
|
38
|
+
|
|
39
|
+
// Auto fix
|
|
40
|
+
"editor.codeActionsOnSave": {
|
|
41
|
+
"source.fixAll.eslint": "explicit",
|
|
42
|
+
"source.organizeImports": "never"
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
// Enable eslint for all supported languages
|
|
46
|
+
"eslint.validate": [
|
|
47
|
+
"javascript",
|
|
48
|
+
"javascriptreact",
|
|
49
|
+
"typescript",
|
|
50
|
+
"typescriptreact",
|
|
51
|
+
"vue",
|
|
52
|
+
"html",
|
|
53
|
+
"markdown",
|
|
54
|
+
"json",
|
|
55
|
+
"jsonc",
|
|
56
|
+
"yaml",
|
|
57
|
+
"toml",
|
|
58
|
+
"xml",
|
|
59
|
+
"gql",
|
|
60
|
+
"graphql",
|
|
61
|
+
"astro"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
```
|
package/dist/index.cjs
CHANGED
|
@@ -17,6 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
17
|
}
|
|
18
18
|
return to;
|
|
19
19
|
};
|
|
20
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
21
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
22
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
23
|
// file that has been converted to a CommonJS file using a Babel-
|
|
@@ -77,6 +78,7 @@ var vue = {
|
|
|
77
78
|
};
|
|
78
79
|
|
|
79
80
|
// src/index.ts
|
|
81
|
+
__reExport(src_exports, require("@antfu/eslint-config"), module.exports);
|
|
80
82
|
function vida(options = {}, ...userConfigs) {
|
|
81
83
|
const {
|
|
82
84
|
pinia: enablePinia = (0, import_local_pkg.isPackageExists)("pinia")
|
|
@@ -88,9 +90,11 @@ function vida(options = {}, ...userConfigs) {
|
|
|
88
90
|
stylistic: {
|
|
89
91
|
indent: 2,
|
|
90
92
|
quotes: "single",
|
|
91
|
-
semi: true
|
|
93
|
+
semi: true,
|
|
94
|
+
overrides: {
|
|
95
|
+
"style/arrow-parens": ["error", "always"]
|
|
96
|
+
}
|
|
92
97
|
},
|
|
93
|
-
formatters: false,
|
|
94
98
|
javascript: {
|
|
95
99
|
overrides: javascript
|
|
96
100
|
},
|
|
@@ -111,5 +115,6 @@ function vida(options = {}, ...userConfigs) {
|
|
|
111
115
|
var src_default = vida;
|
|
112
116
|
// Annotate the CommonJS export names for ESM import in node:
|
|
113
117
|
0 && (module.exports = {
|
|
114
|
-
vida
|
|
118
|
+
vida,
|
|
119
|
+
...require("@antfu/eslint-config")
|
|
115
120
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
|
|
2
2
|
import * as _antfu_eslint_config from '@antfu/eslint-config';
|
|
3
3
|
import { antfu, TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
4
|
+
export * from '@antfu/eslint-config';
|
|
4
5
|
|
|
5
6
|
type AntfuOptions = Parameters<typeof antfu>[0];
|
|
6
7
|
type OptionsConfig = AntfuOptions & {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as eslint_flat_config_utils from 'eslint-flat-config-utils';
|
|
2
2
|
import * as _antfu_eslint_config from '@antfu/eslint-config';
|
|
3
3
|
import { antfu, TypedFlatConfigItem } from '@antfu/eslint-config';
|
|
4
|
+
export * from '@antfu/eslint-config';
|
|
4
5
|
|
|
5
6
|
type AntfuOptions = Parameters<typeof antfu>[0];
|
|
6
7
|
type OptionsConfig = AntfuOptions & {
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ var vue = {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
// src/index.ts
|
|
45
|
+
export * from "@antfu/eslint-config";
|
|
45
46
|
function vida(options = {}, ...userConfigs) {
|
|
46
47
|
const {
|
|
47
48
|
pinia: enablePinia = isPackageExists("pinia")
|
|
@@ -53,9 +54,11 @@ function vida(options = {}, ...userConfigs) {
|
|
|
53
54
|
stylistic: {
|
|
54
55
|
indent: 2,
|
|
55
56
|
quotes: "single",
|
|
56
|
-
semi: true
|
|
57
|
+
semi: true,
|
|
58
|
+
overrides: {
|
|
59
|
+
"style/arrow-parens": ["error", "always"]
|
|
60
|
+
}
|
|
57
61
|
},
|
|
58
|
-
formatters: false,
|
|
59
62
|
javascript: {
|
|
60
63
|
overrides: javascript
|
|
61
64
|
},
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vida0905/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7",
|
|
5
|
+
"packageManager": "pnpm@9.1.2",
|
|
5
6
|
"description": "Vida Xie's ESLint Config",
|
|
6
7
|
"author": "Vida Xie <vida_2020@163.com> (https://github.com/9romise/)",
|
|
7
8
|
"license": "MIT",
|
|
@@ -27,6 +28,16 @@
|
|
|
27
28
|
"files": [
|
|
28
29
|
"dist"
|
|
29
30
|
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"lint": "eslint .",
|
|
33
|
+
"lint:fix": "eslint . --fix",
|
|
34
|
+
"dev": "tsup --watch",
|
|
35
|
+
"inspect": "npx @eslint/config-inspector",
|
|
36
|
+
"build": "tsup",
|
|
37
|
+
"release": "npm run lint && npm run typecheck && bumpp",
|
|
38
|
+
"typecheck": "tsc --noEmit",
|
|
39
|
+
"prepublish": "npm run build"
|
|
40
|
+
},
|
|
30
41
|
"dependencies": {
|
|
31
42
|
"@antfu/eslint-config": "^2.18.1",
|
|
32
43
|
"eslint-plugin-pinia": "^0.1.13",
|
|
@@ -38,14 +49,5 @@
|
|
|
38
49
|
"eslint": "^9.3.0",
|
|
39
50
|
"tsup": "^8.0.2",
|
|
40
51
|
"typescript": "^5.4.5"
|
|
41
|
-
},
|
|
42
|
-
"scripts": {
|
|
43
|
-
"lint": "eslint .",
|
|
44
|
-
"lint:fix": "eslint . --fix",
|
|
45
|
-
"dev": "npx @eslint/config-inspector",
|
|
46
|
-
"build": "tsup",
|
|
47
|
-
"release": "bumpp && pnpm publish",
|
|
48
|
-
"typecheck": "tsc --noEmit",
|
|
49
|
-
"prepublish": "npm run build"
|
|
50
52
|
}
|
|
51
|
-
}
|
|
53
|
+
}
|