@jiakun-zhao/eslint-config 1.1.11 → 1.2.0

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.
Files changed (3) hide show
  1. package/README.md +8 -1
  2. package/dist/index.cjs +30 -136
  3. package/package.json +6 -13
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  ## @jiakun-zhao/eslint-config
2
2
 
3
+ > Extends [@antfu/eslint-config](https://github.com/antfu/eslint-config).
4
+
3
5
  <br />
4
6
 
5
7
  ![npm](https://img.shields.io/npm/v/@jiakun-zhao/eslint-config?color=%236054ba)
@@ -36,7 +38,12 @@ ni -D @jiakun-zhao/eslint-config
36
38
  "javascriptreact",
37
39
  "typescript",
38
40
  "typescriptreact",
39
- "vue"
41
+ "vue",
42
+ "html",
43
+ "markdown",
44
+ "json",
45
+ "jsonc",
46
+ "yaml"
40
47
  ]
41
48
  }
42
49
  ```
package/dist/index.cjs CHANGED
@@ -1,145 +1,39 @@
1
1
  'use strict';
2
2
 
3
- const ignorePatterns = [
4
- "dist",
5
- "output",
6
- "out",
7
- "public",
8
- "temp",
9
- "coverage",
10
- "LICENSE*",
11
- "Dockerfile",
12
- "CHANGELOG.md",
13
- "package-lock.json",
14
- "pnpm-lock.yaml",
15
- "yarn.lock",
16
- "*.min.*",
17
- "*.d.ts",
18
- "*.css",
19
- "*.png",
20
- "*.ico",
21
- "*.toml",
22
- "*.patch",
23
- "*.txt",
24
- "*.crt",
25
- "*.key",
26
- "!.github",
27
- "!.vitepress",
28
- "!.vscode"
29
- ];
30
-
31
3
  const index = {
32
- plugins: [
33
- "unicorn",
34
- "unused-imports"
35
- ],
36
4
  extends: [
37
- "standard",
38
- "plugin:import/recommended",
39
- "plugin:import/typescript",
40
- "plugin:@typescript-eslint/recommended"
41
- ],
42
- settings: {
43
- "import/resolver": {
44
- node: {
45
- extensions: [".js", ".jsx", ".mjs", ".ts", ".tsx", ".d.ts"]
46
- }
47
- }
48
- },
49
- ignorePatterns,
50
- overrides: [
51
- {
52
- files: ["*.vue"],
53
- extends: ["plugin:vue/vue3-recommended"],
54
- parser: "vue-eslint-parser",
55
- parserOptions: {
56
- parser: "@typescript-eslint/parser"
57
- },
58
- rules: {
59
- "vue/component-tags-order": ["error", { order: ["script", "template", "style"] }],
60
- "vue/padding-line-between-blocks": ["error", "always"],
61
- "vue/singleline-html-element-content-newline": "off",
62
- "vue/max-attributes-per-line": "off",
63
- "vue/html-self-closing": "off",
64
- "vue/multi-word-component-names": "off",
65
- "vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
66
- "vue/object-curly-spacing": ["error", "always"]
67
- }
68
- },
69
- {
70
- files: ["*.jsx", "*.tsx"],
71
- extends: [
72
- "plugin:react/all"
73
- ],
74
- parserOptions: {
75
- ecmaFeatures: {
76
- jsx: true
77
- }
78
- },
79
- rules: {
80
- "react/react-in-jsx-scope": "off",
81
- "react/no-unknown-property": "off",
82
- "react/self-closing-comp": "off",
83
- "react/destructuring-assignment": "off",
84
- "react/no-multi-comp": "off",
85
- "react/function-component-definition": "off",
86
- "react/display-name": "off",
87
- "react/button-has-type": "off",
88
- "react/no-children-prop": "off",
89
- "react/jsx-indent": ["error", 2],
90
- "react/jsx-indent-props": ["error", 2],
91
- "react/jsx-max-depth": "off",
92
- "react/jsx-filename-extension": "off",
93
- "react/jsx-no-literals": "off",
94
- "react/jsx-max-props-per-line": "off",
95
- // 'react/jsx-space-before-closing': ['error', 'always'],
96
- "react/jsx-tag-spacing": ["error", {
97
- closingSlash: "never",
98
- beforeSelfClosing: "always",
99
- afterOpening: "never",
100
- beforeClosing: "never"
101
- }],
102
- "react/jsx-newline": "off",
103
- "react/jsx-one-expression-per-line": "off",
104
- "react/jsx-curly-spacing": ["error", { when: "never", children: { when: "never" } }]
105
- }
106
- }
5
+ "@antfu",
6
+ "plugin:react/recommended"
107
7
  ],
108
8
  rules: {
109
- "@typescript-eslint/no-explicit-any": "off",
110
- "@typescript-eslint/no-unused-vars": "warn",
111
- // newline
112
- "array-bracket-newline": ["error", "consistent"],
113
- "array-element-newline": ["error", "consistent"],
114
- // import
115
- "import/no-unresolved": "off",
116
- "unused-imports/no-unused-imports": "error",
117
- "import/order": "error",
118
- "sort-imports": ["error", {
119
- ignoreCase: false,
120
- ignoreDeclarationSort: true,
121
- ignoreMemberSort: false,
122
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
123
- allowSeparatedGroups: false
124
- }],
125
- // spacing
126
- "key-spacing": ["error", { beforeColon: false, afterColon: true }],
127
- "switch-colon-spacing": ["error", { before: false, after: true }],
128
- "space-before-function-paren": ["error", "never"],
129
- "arrow-spacing": ["error", { before: true, after: true }],
130
- "@typescript-eslint/type-annotation-spacing": ["error", {
131
- before: false,
132
- after: true,
133
- overrides: { arrow: { before: true, after: true } }
134
- }],
135
- "@typescript-eslint/space-before-blocks": ["error", "always"],
136
- // quote
137
- "quote-props": ["error", "consistent-as-needed"],
138
- // comma
139
- "comma-dangle": ["error", "always-multiline"],
140
- "@typescript-eslint/comma-dangle": ["error", "always-multiline"],
141
- // unicorn
142
- "unicorn/prefer-node-protocol": "error"
9
+ "no-console": "warn",
10
+ "brace-style": ["warn", "1tbs"],
11
+ "@typescript-eslint/brace-style": ["warn", "1tbs"],
12
+ // vue
13
+ "vue/singleline-html-element-content-newline": "off",
14
+ "vue/html-self-closing": "off",
15
+ "vue/static-class-names-order": "warn",
16
+ // react & jsx
17
+ "react/react-in-jsx-scope": "off",
18
+ "react/no-unknown-property": "off",
19
+ "react/self-closing-comp": "off",
20
+ "react/destructuring-assignment": "off",
21
+ "react/no-multi-comp": "off",
22
+ "react/function-component-definition": "off",
23
+ "react/display-name": "off",
24
+ "react/button-has-type": "off",
25
+ "react/no-children-prop": "off",
26
+ "react/jsx-indent": ["error", 2],
27
+ "react/jsx-indent-props": ["error", 2],
28
+ "react/jsx-max-depth": "off",
29
+ "react/jsx-filename-extension": "off",
30
+ "react/jsx-no-literals": "off",
31
+ "react/jsx-max-props-per-line": "off",
32
+ "react/jsx-tag-spacing": ["error", { closingSlash: "never", beforeSelfClosing: "always", afterOpening: "never", beforeClosing: "never" }],
33
+ "react/jsx-newline": "off",
34
+ "react/jsx-one-expression-per-line": "off",
35
+ "react/jsx-no-bind": "off",
36
+ "react/jsx-curly-spacing": ["error", { when: "never", children: { when: "never" } }]
143
37
  }
144
38
  };
145
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiakun-zhao/eslint-config",
3
- "version": "1.1.11",
3
+ "version": "1.2.0",
4
4
  "description": "Jiakun's ESLint config.",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -17,19 +17,12 @@
17
17
  "extends": "./dist/index.cjs"
18
18
  },
19
19
  "dependencies": {
20
- "@typescript-eslint/eslint-plugin": "^6.1.0",
21
- "eslint-config-standard": "^17.1.0",
22
- "eslint-plugin-import": "^2.27.5",
23
- "eslint-plugin-n": "^16.0.1",
24
- "eslint-plugin-promise": "^6.1.1",
25
- "eslint-plugin-react": "^7.32.2",
26
- "eslint-plugin-unicorn": "^48.0.0",
27
- "eslint-plugin-unused-imports": "^3.0.0",
28
- "eslint-plugin-vue": "^9.15.1"
20
+ "@antfu/eslint-config": "^0.39.8",
21
+ "eslint-plugin-react": "^7.33.0"
29
22
  },
30
23
  "devDependencies": {
31
- "@types/eslint": "^8.44.0",
32
- "@types/node": "^20.4.2",
24
+ "@types/eslint": "^8.44.1",
25
+ "@types/node": "^20.4.5",
33
26
  "bumpp": "^9.1.1",
34
27
  "eslint": "^8.45.0",
35
28
  "typescript": "^5.1.6",
@@ -38,7 +31,7 @@
38
31
  "peerDependencies": {
39
32
  "eslint": ">=7.4.0"
40
33
  },
41
- "packageManager": "pnpm@8.6.9",
34
+ "packageManager": "pnpm@8.6.10",
42
35
  "scripts": {
43
36
  "build": "unbuild",
44
37
  "release": "bumpp && pnpm publish && npx cnpm sync @jiakun-zhao/eslint-config",