@sxzz/eslint-config 3.0.0-beta.8 → 3.0.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.
package/README.md CHANGED
@@ -13,7 +13,7 @@ Flat ESLint config for JavaScript, TypeScript, Vue 2, Vue 3, Prettier.
13
13
  ## Install
14
14
 
15
15
  ```bash
16
- npm i @sxzz/eslint-config
16
+ npm i -D @sxzz/eslint-config
17
17
  ```
18
18
 
19
19
  ## Usage
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sxzz/eslint-config",
3
- "version": "3.0.0-beta.8",
4
- "packageManager": "pnpm@8.2.0",
3
+ "version": "3.0.0",
4
+ "packageManager": "pnpm@8.6.0",
5
5
  "description": "ESLint config for @sxzz.",
6
6
  "type": "module",
7
7
  "license": "MIT",
@@ -26,42 +26,41 @@
26
26
  "import": "./index.js"
27
27
  },
28
28
  "publishConfig": {
29
- "access": "public",
30
- "tag": "beta"
29
+ "access": "public"
31
30
  },
32
31
  "peerDependencies": {
33
32
  "eslint": "^8.0.0"
34
33
  },
35
34
  "dependencies": {
36
- "@eslint/js": "^8.38.0",
37
- "@typescript-eslint/eslint-plugin": "^5.58.0",
38
- "@typescript-eslint/parser": "^5.58.0",
35
+ "@eslint/js": "^8.42.0",
36
+ "@typescript-eslint/eslint-plugin": "^5.59.8",
37
+ "@typescript-eslint/parser": "^5.59.8",
39
38
  "eslint-config-prettier": "^8.8.0",
40
- "eslint-define-config": "^1.18.0",
41
- "eslint-plugin-antfu": "^0.38.4",
39
+ "eslint-define-config": "^1.20.0",
40
+ "eslint-plugin-antfu": "^0.39.5",
42
41
  "eslint-plugin-eslint-comments": "^3.2.0",
43
42
  "eslint-plugin-import": "^2.27.5",
44
- "eslint-plugin-jsonc": "^2.7.0",
43
+ "eslint-plugin-jsonc": "^2.8.0",
45
44
  "eslint-plugin-markdown": "^3.0.0",
46
45
  "eslint-plugin-prettier": "^4.2.1",
47
- "eslint-plugin-unicorn": "^46.0.0",
48
- "eslint-plugin-vue": "^9.11.0",
49
- "eslint-plugin-yml": "^1.5.0",
46
+ "eslint-plugin-unicorn": "^47.0.0",
47
+ "eslint-plugin-vue": "^9.14.1",
48
+ "eslint-plugin-yml": "^1.7.0",
50
49
  "globals": "^13.20.0",
51
- "jsonc-eslint-parser": "^2.2.0",
50
+ "jsonc-eslint-parser": "^2.3.0",
52
51
  "local-pkg": "^0.4.3",
53
- "prettier": "^2.8.7",
54
- "vue-eslint-parser": "^9.1.1",
55
- "yaml-eslint-parser": "^1.2.0"
52
+ "prettier": "^2.8.8",
53
+ "vue-eslint-parser": "^9.3.0",
54
+ "yaml-eslint-parser": "^1.2.2"
56
55
  },
57
56
  "devDependencies": {
58
- "@types/node": "^18.15.11",
57
+ "@types/node": "^18.16.16",
59
58
  "bumpp": "^9.1.0",
60
- "eslint": "^8.38.0",
61
- "typescript": "^5.0.4"
59
+ "eslint": "^8.42.0",
60
+ "typescript": "^5.1.3"
62
61
  },
63
62
  "engines": {
64
- "node": ">=14.19.0"
63
+ "node": ">=16.14.0"
65
64
  },
66
65
  "scripts": {
67
66
  "lint": "eslint .",
package/src/js.js CHANGED
@@ -3,7 +3,7 @@ import jsConfig from '@eslint/js'
3
3
  import importPlugin from 'eslint-plugin-import'
4
4
  import unicornPlugin from 'eslint-plugin-unicorn'
5
5
  import antfuPlugin from 'eslint-plugin-antfu'
6
- import { GLOB_SRC, GLOB_SRC_EXT } from './shared.js'
6
+ import { GLOB_MARKDOWN, GLOB_SRC, GLOB_SRC_EXT } from './shared.js'
7
7
 
8
8
  export { importPlugin, unicornPlugin, antfuPlugin }
9
9
 
@@ -71,6 +71,7 @@ export const js = [
71
71
  'no-multi-str': 'error',
72
72
  'no-with': 'error',
73
73
  'no-void': 'error',
74
+ 'no-duplicate-imports': 'error',
74
75
 
75
76
  'no-unused-expressions': [
76
77
  'error',
@@ -158,6 +159,7 @@ export const imports = [
158
159
  `**/pages/${GLOB_SRC}`,
159
160
  `**/{index,vite,esbuild,rollup,webpack,rspack}.ts`,
160
161
  '**/*.d.ts',
162
+ `${GLOB_MARKDOWN}/**`,
161
163
  ],
162
164
  plugins: {
163
165
  import: importPlugin,
@@ -193,6 +195,7 @@ export const unicorn = [
193
195
  'unicorn/no-lonely-if': 'error',
194
196
  'unicorn/no-new-array': 'error',
195
197
  'unicorn/no-new-buffer': 'error',
198
+ 'unicorn/no-unnecessary-await': 'error',
196
199
  'unicorn/no-unsafe-regex': 'off',
197
200
  'unicorn/number-literal-case': 'error',
198
201
  'unicorn/prefer-add-event-listener': 'error',
@@ -200,6 +203,8 @@ export const unicorn = [
200
203
  'unicorn/prefer-array-flat-map': 'error',
201
204
  'unicorn/prefer-array-index-of': 'error',
202
205
  'unicorn/prefer-array-some': 'error',
206
+ 'unicorn/prefer-at': 'error',
207
+ 'unicorn/prefer-blob-reading-methods': 'error',
203
208
  'unicorn/prefer-date-now': 'error',
204
209
  'unicorn/prefer-dom-node-append': 'error',
205
210
  'unicorn/prefer-dom-node-dataset': 'error',
@@ -216,6 +221,7 @@ export const unicorn = [
216
221
  'unicorn/prefer-prototype-methods': 'error',
217
222
  'unicorn/prefer-query-selector': 'error',
218
223
  'unicorn/prefer-reflect-apply': 'error',
224
+ 'unicorn/prefer-string-replace-all': 'error',
219
225
  'unicorn/prefer-string-slice': 'error',
220
226
  'unicorn/prefer-string-starts-ends-with': 'error',
221
227
  'unicorn/prefer-string-trim-start-end': 'error',
package/src/markdown.js CHANGED
@@ -12,7 +12,7 @@ export const markdown = [
12
12
  processor: 'markdown/markdown',
13
13
  },
14
14
  {
15
- files: [`**/*.md/${GLOB_SRC}`, `**/*.md/${GLOB_VUE}`],
15
+ files: [`${GLOB_MARKDOWN}/${GLOB_SRC}`, `${GLOB_MARKDOWN}/${GLOB_VUE}`],
16
16
  languageOptions: {
17
17
  parserOptions: {
18
18
  ecmaFeatures: {
package/src/shared.js CHANGED
@@ -1,13 +1,13 @@
1
1
  // @ts-check
2
2
 
3
- export const GLOB_SRC_EXT = '?([mt])[jt]s?(x)'
4
- export const GLOB_SRC = '**/*.?([mt])[jt]s?(x)'
3
+ export const GLOB_SRC_EXT = '?([cm])[jt]s?(x)'
4
+ export const GLOB_SRC = '**/*.?([cm])[jt]s?(x)'
5
5
 
6
- export const GLOB_JS = '**/*.?([mt])js'
7
- export const GLOB_JSX = '**/*.?([mt])jsx'
6
+ export const GLOB_JS = '**/*.?([cm])js'
7
+ export const GLOB_JSX = '**/*.?([cm])jsx'
8
8
 
9
- export const GLOB_TS = '**/*.?([mt])ts'
10
- export const GLOB_TSX = '**/*.?([mt])tsx'
9
+ export const GLOB_TS = '**/*.?([cm])ts'
10
+ export const GLOB_TSX = '**/*.?([cm])tsx'
11
11
 
12
12
  export const GLOB_STYLE = '**/*.{c,le,sc}ss'
13
13
  export const GLOB_CSS = '**/*.css'
package/src/vue.js CHANGED
@@ -44,11 +44,12 @@ export const reactivityTransform = [
44
44
  ]
45
45
 
46
46
  /** @type {import('eslint-define-config').Rules} */
47
- const vueBaseRules = {
47
+ const vueCustomRules = {
48
48
  'vue/max-attributes-per-line': 'off',
49
49
  'vue/no-v-html': 'off',
50
50
  'vue/multi-word-component-names': 'off',
51
51
  'vue/require-prop-types': 'off',
52
+ 'vue/require-default-prop': 'off',
52
53
 
53
54
  'vue/html-self-closing': [
54
55
  'error',
@@ -92,7 +93,6 @@ const vue3Rules = {
92
93
  ...vuePlugin.configs['vue3-essential'].rules,
93
94
  ...vuePlugin.configs['vue3-strongly-recommended'].rules,
94
95
  ...vuePlugin.configs['vue3-recommended'].rules,
95
- ...vueBaseRules,
96
96
  }
97
97
 
98
98
  /** @type {import('eslint-define-config').Rules} */
@@ -101,7 +101,6 @@ const vue2Rules = {
101
101
  ...vuePlugin.configs['essential'].rules,
102
102
  ...vuePlugin.configs['strongly-recommended'].rules,
103
103
  ...vuePlugin.configs['recommended'].rules,
104
- ...vueBaseRules,
105
104
  }
106
105
 
107
106
  /** @type {import('eslint-define-config').FlatESLintConfigItem[]} */
@@ -134,6 +133,7 @@ export const vue = [
134
133
  },
135
134
  rules: {
136
135
  ...(isVue3 ? vue3Rules : vue2Rules),
136
+ ...vueCustomRules,
137
137
  },
138
138
  },
139
139
  ...reactivityTransform,