@vida0905/eslint-config 0.1.4 → 0.1.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 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,57 +1,64 @@
1
- # @vida0905/eslint-config
2
-
3
- [![npm](https://img.shields.io/npm/v/@vida0905/eslint-config.svg)](https://npmjs.com/package/@vida0905/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
- ### Setup
13
-
14
- ```shell
15
- npm i -D @vida/eslint-config
16
- ```
17
-
18
- in `eslint.config.js`
19
-
20
- ```js
21
- import { vida } from '@vida0905/eslint-config';
22
-
23
- export default vida();
24
- ```
25
-
26
- 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)
27
-
28
- ```json
29
- {
30
- // Enable the ESlint flat config support
31
- "eslint.experimental.useFlatConfig": true,
32
-
33
- // Disable the default formatter, use eslint instead
34
- "prettier.enable": false,
35
- "editor.formatOnSave": false,
36
-
37
- // Auto fix
38
- "editor.codeActionsOnSave": {
39
- "source.fixAll.eslint": "explicit",
40
- "source.organizeImports": "never"
41
- },
42
-
43
- // Enable eslint for all supported languages
44
- "eslint.validate": [
45
- "javascript",
46
- "javascriptreact",
47
- "typescript",
48
- "typescriptreact",
49
- "vue",
50
- "html",
51
- "markdown",
52
- "json",
53
- "jsonc",
54
- "yaml"
55
- ]
56
- }
57
- ```
1
+ # @vida0905/eslint-config
2
+
3
+ [![npm](https://img.shields.io/npm/v/@vida0905/eslint-config.svg?color=444&label=)](https://npmjs.com/package/@vida0905/eslint-config) [![code style](https://antfu.me/badge-code-style.svg)](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
@@ -61,6 +61,13 @@ var pinia = [
61
61
  }
62
62
  ];
63
63
 
64
+ // src/overrides/javascript.ts
65
+ var javascript = {
66
+ "arrow-body-style": ["error", "as-needed"],
67
+ "no-unused-private-class-members": "error",
68
+ "require-atomic-updates": ["error", { allowProperties: true }]
69
+ };
70
+
64
71
  // src/overrides/vue.ts
65
72
  var vue = {
66
73
  "vue/max-attributes-per-line": ["error", {
@@ -81,11 +88,13 @@ function vida(options = {}, ...userConfigs) {
81
88
  stylistic: {
82
89
  indent: 2,
83
90
  quotes: "single",
84
- semi: true
91
+ semi: true,
92
+ overrides: {
93
+ "style/arrow-parens": ["error", "always"]
94
+ }
85
95
  },
86
- formatters: {
87
- css: true,
88
- html: true
96
+ javascript: {
97
+ overrides: javascript
89
98
  },
90
99
  vue: {
91
100
  overrides: vue
package/dist/index.js CHANGED
@@ -26,6 +26,13 @@ var pinia = [
26
26
  }
27
27
  ];
28
28
 
29
+ // src/overrides/javascript.ts
30
+ var javascript = {
31
+ "arrow-body-style": ["error", "as-needed"],
32
+ "no-unused-private-class-members": "error",
33
+ "require-atomic-updates": ["error", { allowProperties: true }]
34
+ };
35
+
29
36
  // src/overrides/vue.ts
30
37
  var vue = {
31
38
  "vue/max-attributes-per-line": ["error", {
@@ -46,11 +53,13 @@ function vida(options = {}, ...userConfigs) {
46
53
  stylistic: {
47
54
  indent: 2,
48
55
  quotes: "single",
49
- semi: true
56
+ semi: true,
57
+ overrides: {
58
+ "style/arrow-parens": ["error", "always"]
59
+ }
50
60
  },
51
- formatters: {
52
- css: true,
53
- html: true
61
+ javascript: {
62
+ overrides: javascript
54
63
  },
55
64
  vue: {
56
65
  overrides: vue
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",
4
+ "version": "0.1.6",
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,30 +28,26 @@
27
28
  "files": [
28
29
  "dist"
29
30
  ],
30
- "peerDependencies": {
31
- "eslint": ">=8.40.0"
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"
32
40
  },
33
41
  "dependencies": {
34
- "@antfu/eslint-config": "^2.15.0",
42
+ "@antfu/eslint-config": "^2.18.1",
35
43
  "eslint-plugin-pinia": "^0.1.13",
36
44
  "local-pkg": "^0.5.0"
37
45
  },
38
46
  "devDependencies": {
39
- "@eslint/config-inspector": "^0.4.6",
40
- "@unocss/eslint-plugin": "0.59.4",
41
- "bumpp": "^9.4.0",
42
- "eslint": "^9.0.0",
43
- "eslint-plugin-format": "^0.1.1",
47
+ "@eslint/config-inspector": "^0.4.8",
48
+ "bumpp": "^9.4.1",
49
+ "eslint": "^9.3.0",
44
50
  "tsup": "^8.0.2",
45
51
  "typescript": "^5.4.5"
46
- },
47
- "scripts": {
48
- "lint": "eslint .",
49
- "lint:fix": "eslint . --fix",
50
- "dev": "npx @eslint/config-inspector",
51
- "build": "tsup",
52
- "release": "bumpp && pnpm publish",
53
- "typecheck": "tsc --noEmit",
54
- "prepublish": "npm run build"
55
52
  }
56
- }
53
+ }