@cgzair/eslint-config-cgz 1.2.3 → 2.0.4

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 (53) hide show
  1. package/README.md +301 -2
  2. package/lib/common.js +1 -0
  3. package/lib/es5.js +1 -0
  4. package/lib/index.js +1 -0
  5. package/lib/jsx-a11y.js +1 -0
  6. package/lib/node.js +1 -0
  7. package/lib/react.js +1 -0
  8. package/lib/rules/base/es6.js +1 -0
  9. package/lib/rules/base/possible-errors.js +1 -0
  10. package/lib/rules/base/recommended.js +1 -0
  11. package/lib/rules/base/strict.js +1 -0
  12. package/lib/rules/base/style.js +1 -0
  13. package/lib/rules/base/variables.js +1 -0
  14. package/lib/rules/imports.js +1 -0
  15. package/lib/rules/jsx-a11y.js +1 -0
  16. package/lib/rules/node.js +1 -0
  17. package/lib/rules/react.js +1 -0
  18. package/lib/rules/typescript.js +1 -0
  19. package/lib/rules/uni-app.js +1 -0
  20. package/lib/rules/vue.js +1 -0
  21. package/lib/typescript/index.js +1 -0
  22. package/lib/typescript/node.js +1 -0
  23. package/lib/typescript/react.js +1 -0
  24. package/lib/typescript/uni-app.js +1 -0
  25. package/lib/typescript/vue.js +1 -0
  26. package/lib/uni-app.js +1 -0
  27. package/lib/vue.js +1 -0
  28. package/package.json +47 -50
  29. package/es5.js +0 -9
  30. package/index.js +0 -23
  31. package/jsx-a11y.js +0 -3
  32. package/node.js +0 -3
  33. package/react.js +0 -8
  34. package/rules/base/es6.js +0 -76
  35. package/rules/base/possible-errors.js +0 -41
  36. package/rules/base/recommended.js +0 -112
  37. package/rules/base/strict.js +0 -5
  38. package/rules/base/style.js +0 -226
  39. package/rules/base/variables.js +0 -24
  40. package/rules/imports.js +0 -63
  41. package/rules/jsx-a11y.js +0 -18
  42. package/rules/node.js +0 -6
  43. package/rules/react.js +0 -177
  44. package/rules/typescript.js +0 -303
  45. package/rules/uni-app.js +0 -38
  46. package/rules/vue.js +0 -46
  47. package/typescript/index.js +0 -3
  48. package/typescript/node.js +0 -3
  49. package/typescript/react.js +0 -3
  50. package/typescript/uni-app.js +0 -3
  51. package/typescript/vue.js +0 -6
  52. package/uni-app.js +0 -3
  53. package/vue.js +0 -6
package/README.md CHANGED
@@ -1,13 +1,312 @@
1
- # eslint-config-cgz
1
+ # @cgzair/eslint-config-cgz
2
2
 
3
3
  ## 简介
4
4
 
5
5
  本包提供了《信息技术部前端编码手册》配套的 ESLint 可共享配置,提供了多套配置文件以支持 JavaScript、TypeScript、React、Vue、Node.js 等多种项目类型。
6
6
 
7
- ### 使用
7
+ ### JavaScript 项目
8
+
9
+ [coreUrl]: https://www.npmjs.com/package/@babel/core/v/7.16.7
10
+ [eslintParserUrl]: https://www.npmjs.com/package/@babel/eslint-parser/v/7.16.5
11
+ [importUrl]: https://www.npmjs.com/package/eslint-plugin-import/v/2.25.4
12
+ [presetReactUrl]: https://www.npmjs.com/package/@babel/preset-react/v/7.16.7
13
+ [reactUrl]: https://www.npmjs.com/package/@babel/preset-react/v/7.16.7
14
+ [reactHooksUrl]: https://www.npmjs.com/package/eslint-plugin-react-hooks/v/4.3.0
15
+ [a11yUrl]: https://www.npmjs.com/package/eslint-plugin-jsx-a11y/v/6.5.1
16
+ [vueEslintParserUrl]: https://www.npmjs.com/package/vue-eslint-parser/v/8.3.0
17
+ [eslintPluginVueUrl]: https://www.npmjs.com/package/eslint-plugin-vue/v/8.5.0
18
+ [eslintConfigEggUrl]: https://www.npmjs.com/package/eslint-config-egg/v/11.0.1
19
+ [tslintParserUrl]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser
20
+ [tslintPluginUrl]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
21
+
22
+ | 项目类型 | 配置文件 | 依赖 |
23
+ | --- | --- | --- |
24
+ | 一般项目 | @cgzair/eslint-config-cgz | [`@babel/core`][coreUrl]@^7.16.7 <br/> [`@babel/eslint-parser`][eslintParserUrl]@^7.16.5 <br/> [`eslint-plugin-import`][importUrl]@^2.25.4 |
25
+ | React 项目 | @cgzair/eslint-config-cgz/react <br /> @cgzair/eslint-config-cgz/jsx-a11y(可选) | [`@babel/core`][coreUrl]@^7.16.7 <br/>[`@babel/eslint-parser`][eslintParserUrl]@^7.16.5 <br/> [`@babel/preset-react`][presetReactUrl]@^7.16.7 <br/> [`eslint-plugin-import`][importUrl]@^2.25.4 <br /> [`eslint-plugin-react`][reactUrl]@^7.16.7 <br /> [`eslint-plugin-react-hooks`][reactHooksUrl]@^4.3.0 <br /> [`eslint-plugin-jsx-a11y`][a11yUrl]@^6.5.1(可选) |
26
+ | Vue 项目 | @cgzair/eslint-config-cgz/vue | [`@babel/core`][coreUrl]@^7.16.7 <br/> [`@babel/eslint-parser`][eslintParserUrl]@^7.16.5 <br/> [`@babel/preset-react`][presetReactUrl]@^7.16.7 <br/> [`eslint-plugin-import`][importUrl]@^2.25.4 <br /> [`vue-eslint-parser`][vueEslintParserUrl]@^8.3.0 <br/> [`eslint-plugin-vue`][eslintPluginVueUrl]@^8.5.0 |
27
+ | Uni-App 项目 | @cgzair/eslint-config-cgz/uni-app | [`@babel/core`][coreUrl]@^7.16.7 <br/> [`@babel/eslint-parser`][eslintParserUrl]@^7.16.5 <br/> [`@babel/preset-react`][presetReactUrl]@^7.16.7 <br/> [`eslint-plugin-import`][importUrl]@^2.25.4 <br /> [`vue-eslint-parser`][vueEslintParserUrl]@^8.3.0 <br/> [`eslint-plugin-vue`][eslintPluginVueUrl]@^8.5.0 |
28
+ | Node.js 项目 | @cgzair/eslint-config-cgz/node | [`@babel/core`][coreUrl]@^7.16.7 <br/> [`@babel/eslint-parser`][eslintParserUrl]@^7.16.5 <br/> [`eslint-plugin-import`][importUrl]@^2.25.4 <br /> [`eslint-config-egg`][eslintConfigEggUrl]@^11.0.1 |
29
+ | ES5 项目 | @cgzair/eslint-config-cgz/es5 | 无 |
30
+
31
+ ### TypeScript 项目
32
+
33
+ | 项目类型 | 配置文件 | 依赖 |
34
+ | --- | --- | --- |
35
+ | 一般项目 | @cgzair/eslint-config-cgz/typescript | [`@typescript-eslint/parser`][tslintParserUrl]@^5.13.0 <br/> [`@typescript-eslint/eslint-plugin`][tslintPluginUrl]@^5.13.0 <br /> [`eslint-plugin-import`][importUrl]@^2.25.4 |
36
+ | React 项目 | @cgzair/eslint-config-cgz/typescript/react <br /> @cgzair/eslint-config-cgz/jsx-a11y(可选) | [`@typescript-eslint/parser`][tslintParserUrl]@^5.13.0 <br/> [`@typescript-eslint/eslint-plugin`][tslintPluginUrl]@^5.13.0 <br /> [`eslint-plugin-import`][importUrl]@^2.25.4 <br /> [`eslint-plugin-react`][reactUrl]@^7.16.7 <br /> [`eslint-plugin-react-hooks`][reactHooksUrl]@^4.3.0 <br /> [`eslint-plugin-jsx-a11y`][a11yUrl]@^6.5.1(可选) |
37
+ | Vue 项目 | @cgzair/eslint-config-cgz/typescript/vue | [`@typescript-eslint/parser`][tslintParserUrl]@^5.13.0 <br/> [`@typescript-eslint/eslint-plugin`][tslintPluginUrl]@^5.13.0 <br /> [`eslint-plugin-import`][importUrl]@^2.25.4 <br /> [`vue-eslint-parser`][vueEslintParserUrl]@^8.3.0 <br /> [`eslint-plugin-vue`][eslintPluginVueUrl]@^8.5.0 |
38
+ | Uni-App 项目 | @cgzair/eslint-config-cgz/typescript/uni-app | [`@typescript-eslint/parser`][tslintParserUrl]@^5.13.0 <br/> [`@typescript-eslint/eslint-plugin`][tslintPluginUrl]@^5.13.0 <br /> [`eslint-plugin-import`][importUrl]@^2.25.4 <br /> [`vue-eslint-parser`][vueEslintParserUrl]@^8.3.0 <br /> [`eslint-plugin-vue`][eslintPluginVueUrl]@^8.5.0 |
39
+ | Node.js 项目 | @cgzair/eslint-config-cgz/typescript/node | [`@typescript-eslint/parser`][tslintParserUrl]@^5.13.0 <br/> [`@typescript-eslint/eslint-plugin`][tslintPluginUrl]@^5.13.0 <br /> [`eslint-plugin-import`][importUrl]@^2.25.4 <br/> [`eslint-config-egg`][eslintConfigEggUrl]@^11.0.1 |
40
+
41
+ ## 安装与使用
42
+
43
+ 推荐使用《信息技术部前端编码手册》配套的 CLI & 工具包fabric接入本包。如果想自己手动接入,可以在上面表格中找到自己项目类型对应的配置文件,在 [ESLint 配置](https://eslint.org/docs/user-guide/configuring) 中 [extends](https://eslint.org/docs/user-guide/configuring#extending-configuration-files),并安装所需依赖。下面对各项目类型的安装和使用进行详细介绍:
44
+
45
+ ### JavaScript
46
+
47
+ 鉴于历史项目居多,可以优先考虑接入 `JavaScript` 类型的项目。
48
+
49
+ #### 一般项目
50
+
51
+ 针对未使用 React 或 Vue 的一般 JavaScript 项目,使用 ESLint 原生规则和 [`eslint-plugin-import`][importUrl] 规则,使用 [`@babel/eslint-parser`][eslintParserUrl] 作为 [parser](https://eslint.org/docs/user-guide/configuring#specifying-parser),是本包的默认配置。
52
+
53
+ ##### 安装
54
+
55
+ ```sh
56
+ pnpm add -D @cgzair/eslint-config-cgz @babel/eslint-parser@^7.16.5 @babel/core@^7.16.7 eslint-plugin-import@^2.25.4
57
+ ```
58
+
59
+ ##### 使用
8
60
 
9
61
  ```json
10
62
  {
11
63
  "extends": "@cgzair/eslint-config-cgz"
12
64
  }
13
65
  ```
66
+
67
+ #### React 项目
68
+
69
+ 针对 JS React 项目,继承了默认配置,并启用了 [`eslint-plugin-react`][reactUrl] 和 [`eslint-plugin-react-hooks`][reactHooksUrl] 的规则。
70
+
71
+ ##### 安装
72
+
73
+ ```sh
74
+ pnpm add -D @cgzair/eslint-config-cgz @babel/core@^7.16.7 @babel/eslint-parser@^7.16.5 eslint-plugin-import@^2.25.4 eslint-plugin-react@^7.16.7 eslint-plugin-react@^4.3.0
75
+ ```
76
+
77
+ ##### 使用
78
+
79
+ ```json
80
+ {
81
+ "extends": "@cgzair/eslint-config-cgz/react"
82
+ }
83
+ ```
84
+
85
+ ##### a11y 支持
86
+
87
+ 本包也提供了 JSX a11y 的检查规则,但没有在 React 规则包中默认引入,你可以按如下步骤手动启用:
88
+
89
+ 安装 `eslint-plugin-jsx-a11y` 插件:
90
+
91
+ ```bash
92
+ pnpm add -D eslint-plugin-jsx-a11y@^6.5.1
93
+ ```
94
+
95
+ 在配置中引入 `@cgzair/eslint-config-cgz/jsx-a11y`:
96
+
97
+ ```json
98
+ {
99
+ "extends": ["@cgzair/eslint-config-cgz/react", "@cgzair/eslint-config-cgz/jsx-a11y"]
100
+ }
101
+ ```
102
+
103
+ #### Vue 项目
104
+
105
+ 针对 JS Vue 的项目,继承了默认配置,并启用了 [eslint-plugin-vue][eslintPluginVueUrl] 插件的规则,使用 [vue-eslint-parser][vueEslintParserUrl] 作为 parser。
106
+
107
+ ##### 安装
108
+
109
+ ```sh
110
+ pnpm add -D @cgzair/eslint-config-cgz vue-eslint-parser@^8.3.0 @babel/core@^7.16.7 @babel/eslint-parser@^7.16.5 eslint-plugin-import@^2.25.4 eslint-plugin-vue@^8.5.0
111
+ ```
112
+
113
+ ##### 使用
114
+
115
+ ```json
116
+ {
117
+ "extends": "@cgzair/eslint-config-cgz/vue"
118
+ }
119
+ ```
120
+
121
+ #### Uni-App 项目
122
+
123
+ 针对 JS Uni-App 的项目,继承了 @cgzair/eslint-config-cgz/vue 全部配置,并增加了小程序环境特有的全局变量。
124
+
125
+ ##### 安装
126
+
127
+ ```sh
128
+ pnpm add -D @cgzair/eslint-config-cgz vue-eslint-parser@^8.3.0 @babel/core@^7.16.7 @babel/eslint-parser@^7.16.5 eslint-plugin-import@^2.25.4 eslint-plugin-vue@^8.5.0
129
+ ```
130
+
131
+ ##### 使用
132
+
133
+ ```json
134
+ {
135
+ "extends": "@cgzair/eslint-config-cgz/uni-app"
136
+ }
137
+ ```
138
+
139
+ #### Node.js 项目
140
+
141
+ 针对 Node.js 项目,继承了默认配置和 [egg-config-egg] 的 node 规则(`https://github.com/eggjs/eslint-config-egg/blob/master/lib/rules/node.js`),规则由 ESLint 原生规则和 [eslint-plugin-node][eslintConfigEggUrl] 提供。
142
+
143
+ ##### 安装
144
+
145
+ ```sh
146
+ pnpm add -D @cgzair/eslint-config-cgz @babel/core@^7.16.7 @babel/eslint-parser@^7.16.5 eslint-plugin-import@^2.25.4 eslint-config-egg@^11.0.1
147
+ ```
148
+
149
+ ##### 使用
150
+
151
+ ```json
152
+ {
153
+ "extends": "@cgzair/eslint-config-cgz/node"
154
+ }
155
+ ```
156
+
157
+ #### ES5 项目
158
+
159
+ 针对仍在使用 ES5 及之前版本 JS 的老项目,使用 ESLint 原生规则。
160
+
161
+ ##### 安装
162
+
163
+ ```sh
164
+ pnpm add -D @cgzair/eslint-config-cgz
165
+ ```
166
+
167
+ ##### 使用
168
+
169
+ ```json
170
+ {
171
+ "extends": "@cgzair/eslint-config-cgz/es5"
172
+ }
173
+ ```
174
+
175
+ ### TypeScript
176
+
177
+ 所有的 TypeScript 项目启用 [`@typescript-eslint/eslint-plugin`][tslintPluginUrl] 插件的规则,并使用 [`@typescript-eslint/parser`][tslintParserUrl] 作为 parser。
178
+
179
+ #### 一般项目
180
+
181
+ 针对未使用 React 或 Vue 的一般 TypeScript 项目,继承本配置。
182
+
183
+ ##### 安装
184
+
185
+ ```sh
186
+ pnpm add -D @cgzair/eslint-config-cgz eslint-plugin-import@^2.25.4 @typescript-eslint/eslint-plugin@^5.13.0 @typescript-eslint/parser@^5.13.0
187
+ ```
188
+
189
+ ##### 使用
190
+
191
+ ```json
192
+ {
193
+ "extends": "@cgzair/eslint-config-cgz/typescript"
194
+ }
195
+ ```
196
+
197
+ 需保证项目已安装 `typescript` 依赖,另外如果项目的 TS 配置文件不是 `./tsconfig.json`,则需要设置 `.eslintrc` 中的 [parserOptions.project](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject) 字段 ,例如:
198
+
199
+ ```json
200
+ {
201
+ "extends": "@cgzair/eslint-config-cgz/typescript",
202
+ "parserOptions": {
203
+ "project": "./tsconfig.eslint.json"
204
+ }
205
+ }
206
+ ```
207
+
208
+ #### React 项目
209
+
210
+ 针对 TS React 项目,继承了 JS React 的配置。
211
+
212
+ ##### 安装
213
+
214
+ ```sh
215
+ pnpm add -D @cgzair/eslint-config-cgz eslint-plugin-import@^2.25.4 eslint-plugin-react@^7.16.7 eslint-plugin-react-hooks@^4.3.0 @typescript-eslint/eslint-plugin@^5.13.0 @typescript-eslint/parser@^5.13.0
216
+ ```
217
+
218
+ ##### 使用
219
+
220
+ ```json
221
+ {
222
+ "extends": "@cgzair/eslint-config-cgz/typescript/react"
223
+ }
224
+ ```
225
+
226
+ ##### a11y 支持
227
+
228
+ 本包也提供了 JSX a11y 的检查规则,但没有在 TS React 规则包中默认引入,你可以按如下步骤手动启用:
229
+
230
+ 安装 `eslint-plugin-jsx-a11y` 插件:
231
+
232
+ ```bash
233
+ pnpm add -D eslint-plugin-jsx-a11y@^6.5.1
234
+ ```
235
+
236
+ 在配置中引入 `@cgzair/eslint-config-cgz/jsx-a11y`:
237
+
238
+ ```json
239
+ {
240
+ "extends": ["@cgzair/eslint-config-cgz/typescript/react", "@cgzair/eslint-config-cgz/jsx-a11y"]
241
+ }
242
+ ```
243
+
244
+ #### Vue 项目
245
+
246
+ 针对 TS Vue 项目,继承了 JS Vue 的配置。
247
+
248
+ ##### 安装
249
+
250
+ ```sh
251
+ pnpm add -D @cgzair/eslint-config-cgz eslint-plugin-import@^2.25.4 eslint-plugin-vue@^8.5.0 vue-eslint-parser@^8.3.0 @typescript-eslint/eslint-plugin@^5.13.0 @typescript-eslint/parser@^5.13.0
252
+ ```
253
+
254
+ ##### 使用
255
+
256
+ ```json
257
+ {
258
+ "extends": "@cgzair/eslint-config-cgz/typescript/vue"
259
+ }
260
+ ```
261
+
262
+ #### Uni-App 项目
263
+
264
+ 针对 TS Uni-App 项目,继承了 JS Uni-App 的配置。
265
+
266
+ ##### 安装
267
+
268
+ ```sh
269
+ pnpm add -D @cgzair/eslint-config-cgz eslint-plugin-import@^2.25.4 eslint-plugin-vue@^8.5.0 vue-eslint-parser@^8.3.0 @typescript-eslint/eslint-plugin@^5.13.0 @typescript-eslint/parser@^5.13.0
270
+ ```
271
+
272
+ ##### 使用
273
+
274
+ ```json
275
+ {
276
+ "extends": "@cgzair/eslint-config-cgz/typescript/uni-app"
277
+ }
278
+ ```
279
+
280
+ #### Node.js 项目
281
+
282
+ 针对未使用 React 和 Vue 的 TypeScript(Node) 项目,继承了 JS Node.js 配置。
283
+
284
+ ##### 安装
285
+
286
+ ```sh
287
+ pnpm add -D @cgzair/eslint-config-cgz eslint-plugin-import@^2.25.4 @typescript-eslint/eslint-plugin@^5.13.0 @typescript-eslint/parser@^5.13.0 eslint-config-egg@^11.0.1
288
+ ```
289
+
290
+ ##### 使用
291
+
292
+ ```json
293
+ {
294
+ "extends": "@cgzair/eslint-config-cgz/typescript/node"
295
+ }
296
+ ```
297
+
298
+ ### 配合 Prettier 使用
299
+
300
+ 手动安装 [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier)@8.5.0,注意,请确保安装版本一致,否则可能出现不兼容的错误。
301
+
302
+ ```sh
303
+ pnpm add -D eslint-config-prettier@8.5.0
304
+ ```
305
+
306
+ 并修改 eslintrc 的 `extends` 如下:
307
+
308
+ ```json
309
+ {
310
+ "extends": ["@cgzair/eslint-config-cgz/typescript/react", "prettier"]
311
+ }
312
+ ```
package/lib/common.js ADDED
@@ -0,0 +1 @@
1
+ import babelParser from"@babel/eslint-parser";import{defineConfig}from"eslint/config";import globals from"globals";import es6 from"./rules/base/es6.js";import possibleErrors from"./rules/base/possible-errors.js";import recommended from"./rules/base/recommended.js";import strict from"./rules/base/strict.js";import style from"./rules/base/style.js";import variables from"./rules/base/variables.js";import imports from"./rules/imports.js";const mergeRules=(...s)=>s.reduce((s,e)=>({...s,...Array.isArray(e)?e[0]?.rules||{}:e.rules||{}}),{});export default defineConfig([{files:["**/*"],rules:mergeRules(recommended,possibleErrors,style,variables,es6,strict,imports),settings:{...imports[0].settings},plugins:{...imports[0].plugins},languageOptions:{parser:babelParser,globals:variables?.[0]?.languageOptions?.globals||{},ecmaVersion:"latest",sourceType:"module"}},{files:["**/*.cjs"],languageOptions:{sourceType:"commonjs",globals:{...globals.node}}}]);
package/lib/es5.js ADDED
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import possible from"./rules/base/possible-errors.js";import recommended from"./rules/base/recommended.js";import style from"./rules/base/style.js";import variables from"./rules/base/variables.js";export default defineConfig([{files:["**/*.js","**/*.ts"],rules:{...recommended[0].rules,...possible[0].rules,...style[0].rules,...variables[0].rules},languageOptions:{globals:variables?.[0]?.languageOptions?.globals||{}}}]);
package/lib/index.js ADDED
@@ -0,0 +1 @@
1
+ import prettier from"eslint-config-prettier/flat";import common from"./common.js";import es5 from"./es5.js";import jsxA11y from"./jsx-a11y.js";import node from"./node.js";import react from"./react.js";import typescript from"./typescript/index.js";import tsNode from"./typescript/node.js";import tsReact from"./typescript/react.js";import tsUniApp from"./typescript/uni-app.js";import tsVue from"./typescript/vue.js";import uniApp from"./uni-app.js";import vue from"./vue.js";export{defineConfig}from"eslint/config";const ts={node:tsNode,react:tsReact,uniApp:tsUniApp,vue:tsVue};export default{common:common,node:node,prettier:prettier,react:react,jsxA11y:jsxA11y,uniApp:uniApp,vue:vue,es5:es5,typescript:typescript,ts:ts};
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import jsxA11y from"./rules/jsx-a11y.js";export default defineConfig([...jsxA11y]);
package/lib/node.js ADDED
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import common from"./common.js";import node from"./rules/node.js";export default defineConfig([...common,...node]);
package/lib/react.js ADDED
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import common from"./common.js";import react from"./rules/react.js";export default defineConfig([...common,...react]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";export default defineConfig([{rules:{"arrow-body-style":"off","arrow-parens":["warn","always"],"arrow-spacing":["error",{before:!0,after:!0}],"constructor-super":"error","generator-star-spacing":["error",{before:!1,after:!0}],"no-class-assign":"error","no-confusing-arrow":"error","no-const-assign":"error","no-dupe-class-members":"error","no-duplicate-imports":"off","no-new-symbol":"error","no-restricted-imports":"off","no-this-before-super":"error","no-useless-computed-key":"error","no-useless-constructor":"error","no-useless-rename":["error",{ignoreDestructuring:!1,ignoreImport:!1,ignoreExport:!1}],"no-var":"error","object-shorthand":["error","always",{ignoreConstructors:!1,avoidQuotes:!0}],"prefer-arrow-callback":["error",{allowNamedFunctions:!1,allowUnboundThis:!0}],"prefer-const":["error",{destructuring:"any",ignoreReadBeforeAssign:!0}],"prefer-destructuring":["warn",{VariableDeclarator:{array:!1,object:!0},AssignmentExpression:{array:!1,object:!1}},{enforceForRenamedProperties:!1}],"prefer-numeric-literals":"off","prefer-rest-params":"warn","prefer-spread":"warn","prefer-template":"warn","require-yield":"error","rest-spread-spacing":["error","never"],"sort-imports":"off","symbol-description":"warn","template-curly-spacing":"warn","yield-star-spacing":["error","after"]}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";export default defineConfig([{rules:{"for-direction":"error","getter-return":["error",{allowImplicit:!0}],"no-async-promise-executor":"error","no-await-in-loop":"warn","no-compare-neg-zero":"error","no-cond-assign":["error","always"],"no-console":"warn","no-constant-condition":"warn","no-control-regex":"off","no-debugger":"error","no-dupe-args":"error","no-dupe-keys":"error","no-duplicate-case":"error","no-empty":"error","no-empty-character-class":"error","no-ex-assign":"error","no-extra-boolean-cast":"error","no-extra-parens":"off","no-extra-semi":"error","no-func-assign":"error","no-inner-declarations":"error","no-invalid-regexp":"error","no-irregular-whitespace":"error","no-misleading-character-class":"error","no-obj-calls":"error","no-prototype-builtins":"error","no-regex-spaces":"error","no-sparse-arrays":"error","no-template-curly-in-string":"warn","no-unexpected-multiline":"error","no-unreachable":"error","no-unsafe-finally":"error","no-unsafe-negation":"error","require-atomic-updates":"warn","use-isnan":"error","valid-typeof":["error",{requireStringLiterals:!0}]}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";export default defineConfig([{rules:{"accessor-pairs":"off","array-callback-return":["error",{allowImplicit:!0}],"block-scoped-var":"error","class-methods-use-this":"off",complexity:"off","consistent-return":"off",curly:["error","multi-line"],"default-case":["warn",{commentPattern:"^no default$"}],"dot-location":["error","property"],"dot-notation":["error",{allowKeywords:!0}],eqeqeq:["warn","always",{null:"ignore"}],"guard-for-in":"warn","max-classes-per-file":"off","no-alert":"warn","no-caller":"error","no-case-declarations":"error","no-div-regex":"off","no-else-return":"off","no-empty-function":["error",{allow:["arrowFunctions","functions","methods"]}],"no-empty-pattern":"error","no-eq-null":"off","no-eval":"error","no-extend-native":"error","no-extra-bind":"error","no-extra-label":"error","no-fallthrough":"error","no-floating-decimal":"error","no-global-assign":["error",{exceptions:[]}],"no-implicit-coercion":"off","no-implicit-globals":"off","no-implied-eval":"error","no-invalid-this":"off","no-iterator":"error","no-labels":["warn",{allowLoop:!1,allowSwitch:!1}],"no-lone-blocks":"error","no-loop-func":"error","no-magic-numbers":"off","no-multi-spaces":["error",{ignoreEOLComments:!1}],"no-multi-str":"error","no-new":"error","no-new-func":"error","no-new-wrappers":"error","no-octal":"error","no-octal-escape":"error","no-param-reassign":["warn",{props:!0,ignorePropertyModificationsFor:["acc","e","ctx","draft","req","request","res","response","item","jtem","ktem"]}],"no-proto":"error","no-redeclare":"error","no-restricted-properties":"off","no-return-assign":["error","always"],"no-return-await":"off","no-script-url":"error","no-self-assign":"error","no-self-compare":"error","no-sequences":"error","no-throw-literal":"warn","no-unmodified-loop-condition":"off","no-unused-expressions":["error",{allowShortCircuit:!0,allowTernary:!0,allowTaggedTemplates:!0}],"no-unused-labels":"error","no-useless-call":"off","no-useless-catch":"error","no-useless-concat":"error","no-useless-escape":"error","no-useless-return":"error","no-void":"error","no-warning-comments":"off","no-with":"error","prefer-promise-reject-errors":["warn",{allowEmptyReject:!0}],radix:"warn","require-await":"off","require-unicode-regexp":"off","vars-on-top":"off","wrap-iife":["error","any",{functionPrototypeMethods:!1}],yoda:"warn"}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";export default defineConfig([{rules:{strict:"off"}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";export default defineConfig([{rules:{"array-bracket-newline":"off","array-bracket-spacing":["error","never"],"array-element-newline":"off","block-spacing":["error","always"],"brace-style":["error","1tbs",{allowSingleLine:!0}],camelcase:"off","capitalized-comments":"off","comma-dangle":["error","always-multiline"],"comma-spacing":["error",{before:!1,after:!0}],"comma-style":["error","last"],"computed-property-spacing":["error","never"],"consistent-this":"off","eol-last":["warn","always"],"func-call-spacing":["error","never"],"func-name-matching":"off","func-names":"off","func-style":"off","function-paren-newline":["error","consistent"],"id-blacklist":"off","id-length":"off","id-match":"off","implicit-arrow-linebreak":"off",indent:["error",2,{SwitchCase:1,VariableDeclarator:1,outerIIFEBody:1,FunctionDeclaration:{parameters:1,body:1},FunctionExpression:{parameters:1,body:1},CallExpression:{arguments:1},ArrayExpression:1,ObjectExpression:1,ImportDeclaration:1,flatTernaryExpressions:!1,ignoredNodes:["JSXElement","JSXElement > *","JSXAttribute","JSXIdentifier","JSXNamespacedName","JSXMemberExpression","JSXSpreadAttribute","JSXExpressionContainer","JSXOpeningElement","JSXClosingElement","JSXText","JSXEmptyExpression","JSXSpreadChild"],ignoreComments:!1}],"jsx-quotes":["error","prefer-double"],"key-spacing":["error",{beforeColon:!1,afterColon:!0}],"keyword-spacing":["error",{before:!0,after:!0,overrides:{return:{after:!0},throw:{after:!0},case:{after:!0}}}],"line-comment-position":"off","linebreak-style":"off","lines-between-class-members":"off","lines-around-comment":"off","max-depth":"off","max-len":["warn",120,2,{ignoreUrls:!0,ignoreComments:!1,ignoreRegExpLiterals:!0,ignoreStrings:!0,ignoreTemplateLiterals:!0}],"max-lines":"off","max-lines-per-function":"off","max-nested-callbacks":"off","max-params":"off","max-statements":"off","max-statements-per-line":"off","multiline-comment-style":"off","multiline-ternary":"off","new-cap":["error",{newIsCap:!0,newIsCapExceptions:[],capIsNew:!1,capIsNewExceptions:["Immutable.Map","Immutable.Set","Immutable.List"]}],"new-parens":"error","newline-per-chained-call":["warn",{ignoreChainWithDepth:4}],"no-array-constructor":"error","no-bitwise":"warn","no-continue":"off","no-inline-comments":"off","no-lonely-if":"error","no-mixed-operators":["error",{groups:[["%","**"],["%","+"],["%","-"],["%","*"],["%","/"],["**","+"],["**","-"],["**","*"],["**","/"],["&","|","^","~","<<",">>",">>>"],["==","!=","===","!==",">",">=","<","<="],["&&","||"],["in","instanceof"]],allowSamePrecedence:!1}],"no-mixed-spaces-and-tabs":"error","no-multi-assign":["error"],"no-multiple-empty-lines":["error",{max:2,maxEOF:1}],"no-negated-condition":"off","no-nested-ternary":"off","no-new-object":"error","no-plusplus":"off","no-restricted-syntax":"off","no-tabs":["error",{allowIndentationTabs:!0}],"no-ternary":"off","no-trailing-spaces":["error",{skipBlankLines:!1,ignoreComments:!1}],"no-underscore-dangle":"off","no-unneeded-ternary":["error",{defaultAssignment:!1}],"no-whitespace-before-property":"error","nonblock-statement-body-position":["error","beside",{overrides:{}}],"object-curly-newline":"off","object-curly-spacing":["error","always"],"object-property-newline":["error",{allowAllPropertiesOnSameLine:!0}],"one-var":["error","never"],"one-var-declaration-per-line":["error","always"],"operator-assignment":["warn","always"],"operator-linebreak":"off","padded-blocks":["warn",{blocks:"never",classes:"never",switches:"never"}],"padding-line-between-statements":"off","prefer-object-spread":"off","quote-props":["error","as-needed",{keywords:!1,unnecessary:!0,numbers:!1}],quotes:["error","double",{avoidEscape:!0}],semi:["error","always"],"semi-spacing":["error",{before:!1,after:!0}],"semi-style":["error","last"],"sort-keys":"off","sort-vars":"off","space-before-blocks":"error","space-before-function-paren":["error",{anonymous:"always",named:"never",asyncArrow:"always"}],"space-in-parens":["error","never"],"space-infix-ops":"error","space-unary-ops":["error",{words:!0,nonwords:!1,overrides:{}}],"spaced-comment":["error","always",{line:{exceptions:["-","+"],markers:["=","!","/"]},block:{exceptions:["-","+"],markers:["=","!"],balanced:!0}}],"switch-colon-spacing":["error",{after:!0,before:!1}],"template-tag-spacing":["error","never"],"unicode-bom":"off","wrap-regex":"off","no-loss-of-precision":"error"}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import globals from"globals";export default defineConfig([{languageOptions:{globals:{...globals.browser,...globals.jasmine,...globals.jest,...globals.mocha}},rules:{"init-declarations":"off","no-delete-var":"off","no-label-var":"error","no-restricted-globals":"off","no-shadow":"error","no-shadow-restricted-names":"error","no-undef":"error","no-undef-init":"off","no-undefined":"off","no-unused-vars":["error",{vars:"all",args:"after-used",ignoreRestSiblings:!0}],"no-use-before-define":["error",{functions:!1,classes:!1,variables:!1}]}}]);
@@ -0,0 +1 @@
1
+ import eslintImport from"eslint-plugin-import";import{defineConfig}from"eslint/config";export default defineConfig([{plugins:{import:eslintImport},settings:{"import/ignore":["node_modules","\\.(coffee|scss|css|less|hbs|svg|json)$"]},rules:{"import/no-unresolved":"off","import/named":"off","import/default":"off","import/namespace":"off","import/export":"off","import/no-named-as-default":"error","import/no-named-as-default-member":"warn","import/no-deprecated":"off","import/no-extraneous-dependencies":"off","import/no-mutable-exports":"off","import/unambiguous":"off","import/no-commonjs":"off","import/no-amd":"warn","import/no-nodejs-modules":"off","import/first":"error","import/no-duplicates":"error","import/no-namespace":"off","import/extensions":"off","import/order":"off","import/newline-after-import":"warn","import/prefer-default-export":"off","import/no-restricted-paths":"off","import/max-dependencies":"off","import/no-absolute-path":"off","import/no-dynamic-require":"off","import/no-internal-modules":"off","import/no-webpack-loader-syntax":"off","import/no-unassigned-import":"off","import/no-named-default":"off","import/no-anonymous-default-export":"off","import/exports-last":"off","import/group-exports":"off","import/no-default-export":"off","import/no-self-import":"error","import/no-cycle":["error",{maxDepth:1/0}],"import/no-useless-path-segments":"off","import/dynamic-import-chunkname":"off","import/no-relative-parent-imports":"off"}}]);
@@ -0,0 +1 @@
1
+ import jsxA11y from"eslint-plugin-jsx-a11y";import{defineConfig}from"eslint/config";export default defineConfig([{files:["**/*.jsx","**/*.tsx"],plugins:{"jsx-a11y":jsxA11y},rules:{"jsx-a11y/alt-text":"warn","jsx-a11y/img-redundant-alt":"warn","jsx-a11y/anchor-has-content":"warn","jsx-a11y/aria-props":"warn","jsx-a11y/aria-proptypes":"warn","jsx-a11y/aria-unsupported-elements":"warn","jsx-a11y/aria-role":["warn",{ignoreNonDOM:!0}],"jsx-a11y/role-has-required-aria-props":"warn","jsx-a11y/role-supports-aria-props":"warn","jsx-a11y/iframe-has-title":"warn","jsx-a11y/no-access-key":"warn","jsx-a11y/no-distracting-elements":"warn","jsx-a11y/scope":"warn"}}]);
@@ -0,0 +1 @@
1
+ import nodePlugin from"eslint-plugin-n";import{defineConfig}from"eslint/config";import globals from"globals";export default defineConfig([nodePlugin.configs["flat/recommended-script"],{languageOptions:{globals:globals.node},rules:{"n/no-deprecated-api":"error","n/no-unpublished-import":"off"}}]);
@@ -0,0 +1 @@
1
+ import babelParser from"@babel/eslint-parser";import react from"eslint-plugin-react";import reactHooks from"eslint-plugin-react-hooks";import{defineConfig}from"eslint/config";export default defineConfig([{files:["**/*.jsx","**/*.tsx"],plugins:{react:react,"react-hooks":reactHooks},rules:{"react/display-name":"off","react/forbid-prop-types":["warn",{forbid:["any"]}],"react/jsx-boolean-value":["error","never",{always:[]}],"react/jsx-closing-bracket-location":["error","line-aligned"],"react/jsx-closing-tag-location":"error","react/jsx-props-no-multi-spaces":"error","react/jsx-curly-spacing":["error","never",{allowMultiline:!0}],"react/jsx-handler-names":["warn",{eventHandlerPrefix:"handle",eventHandlerPropPrefix:"on"}],"react/jsx-indent-props":["error",2],"react/jsx-key":"error","react/jsx-max-props-per-line":["error",{maximum:1,when:"multiline"}],"react/jsx-no-bind":["warn",{ignoreRefs:!1,allowArrowFunctions:!0,allowBind:!1}],"react/jsx-no-duplicate-props":["error",{ignoreCase:!0}],"react/jsx-no-literals":"off","react/jsx-no-undef":"error","react/jsx-pascal-case":["error",{allowAllCaps:!0,ignore:[]}],"react/sort-prop-types":"off","react/jsx-sort-prop-types":"off","react/jsx-sort-props":"off","react/jsx-uses-react":["error"],"react/jsx-uses-vars":"error","react/no-danger":"warn","react/no-deprecated":"error","react/no-will-update-set-state":"error","react/no-direct-mutation-state":"off","react/no-is-mounted":"error","react/no-multi-comp":["error",{ignoreStateless:!0}],"react/no-set-state":"off","react/no-string-refs":"error","react/no-this-in-sfc":"error","react/no-unknown-property":"error","react/prefer-es6-class":["error","always"],"react/prefer-stateless-function":"off","react/prop-types":["warn",{ignore:[],customValidators:[],skipUndeclared:!1}],"react/react-in-jsx-scope":"off","react/require-render-return":"error","react/self-closing-comp":"error","react/sort-comp":["off",{order:["static-methods","instance-variables","lifecycle","/^on.+$/","getters","setters","/^(get|set)(?!(InitialState$|DefaultProps$|ChildContext$)).+$/","instance-methods","everything-else","rendering"],groups:{lifecycle:["displayName","propTypes","contextTypes","childContextTypes","mixins","statics","defaultProps","constructor","getDefaultProps","getInitialState","state","getChildContext","componentWillMount","UNSAFE_componentWillMount","componentDidMount","componentWillReceiveProps","UNSAFE_componentWillReceiveProps","shouldComponentUpdate","componentWillUpdate","UNSAFE_componentWillUpdate","componentDidUpdate","componentWillUnmount"],rendering:["/^render.+$/","render"]}}],"react/jsx-wrap-multilines":["error",{declaration:"parens",assignment:"parens",return:"parens",arrow:"parens"}],"react/jsx-first-prop-new-line":["error","multiline-multiprop"],"react/jsx-equals-spacing":["error","never"],"react/jsx-indent":["error",2],"react/jsx-no-target-blank":"warn","react/no-access-state-in-setstate":"error","react/jsx-filename-extension":["error",{extensions:[".jsx",".js",".tsx",".ts",".vue"]}],"react/jsx-no-comment-textnodes":"error","react/no-render-return-value":"error","react/require-optimization":"off","react/no-find-dom-node":"error","react/forbid-component-props":"off","react/forbid-elements":"off","react/no-danger-with-children":"error","react/no-unused-prop-types":["error",{customValidators:[],skipShapeProps:!0}],"react/style-prop-object":"error","react/no-unescaped-entities":"error","react/no-children-prop":"error","react/jsx-tag-spacing":["error",{closingSlash:"never",beforeSelfClosing:"always",afterOpening:"never"}],"react/jsx-space-before-closing":"off","react/no-array-index-key":"warn","react/require-default-props":"off","react/forbid-foreign-prop-types":"off","react/void-dom-elements-no-children":"error","react/default-props-match-prop-types":["warn",{allowRequiredDefaults:!1}],"react/no-redundant-should-component-update":"error","react/no-unused-state":"error","react/boolean-prop-naming":"off","react/no-typos":"error","react/jsx-curly-brace-presence":"off","react-hooks/rules-of-hooks":"error","react-hooks/exhaustive-deps":"warn"},languageOptions:{parser:babelParser,parserOptions:{requireConfigFile:!1,babelOptions:{presets:["@babel/preset-react"]},ecmaVersion:"latest",sourceType:"module",ecmaFeatures:{jsx:!0}}},settings:{"import/resolver":{node:{extensions:[".js",".jsx",".json"]}},react:{pragma:"React",version:"detect"}}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import tseslint from"typescript-eslint";import globals from"globals";export default defineConfig([tseslint.configs.recommended,{files:["**/*.ts","**/*.tsx"],languageOptions:{parserOptions:{projectService:!0,extraFileExtensions:[".vue"]}},rules:{"@typescript-eslint/no-explicit-any":"off","@typescript-eslint/no-floating-promises":"off","@typescript-eslint/no-misused-promises":"off","@typescript-eslint/no-unnecessary-condition":"off","@typescript-eslint/no-unsafe-assignment":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-member-access":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/consistent-type-definitions":["warn","interface"],"@typescript-eslint/method-signature-style":["warn","property"],"@typescript-eslint/prefer-as-const":"warn","@typescript-eslint/prefer-optional-chain":"warn","@typescript-eslint/naming-convention":"off","@typescript-eslint/no-parameter-properties":"off","@typescript-eslint/no-type-alias":"off","@typescript-eslint/no-namespace":["error",{allowDeclarations:!0,allowDefinitionFiles:!0}],"@typescript-eslint/no-var-requires":"off","@typescript-eslint/no-require-imports":"off","@typescript-eslint/unbound-method":"off","@typescript-eslint/prefer-for-of":"off","@typescript-eslint/prefer-includes":"off"}},{files:["**/*.cjs"],languageOptions:{sourceType:"commonjs",globals:{...globals.node}}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";export default defineConfig([{files:["**/*.vue","**/*.js","**/*.ts"],languageOptions:{globals:{App:!0,Page:!0,Component:!0,Behavior:!0,getApp:!0,getCurrentPages:!0,plus:!0,uni:!0,Vue:!0,wx:!0,my:!0,swan:!0,tt:!0,qh:!0,qa:!0,xhs:!0,HWH5:!0,weex:!0,__id__:!0,__uniConfig:!0,__uniRoutes:!0,__registerPage:!0,UniViewJSBridge:!0,UniServiceJSBridge:!0,__DEV__:!0,__VIEW__:!0,__PLATFORM__:!0,__VERSION__:!0,__GLOBAL__:!0,__PLATFORM_TITLE__:!0,__PLATFORM_PREFIX__:!0,it:!0,describe:!0,expect:!0}}}]);
@@ -0,0 +1 @@
1
+ import tsparser from"@typescript-eslint/parser";import vuePlugin from"eslint-plugin-vue";import{defineConfig}from"eslint/config";import vueParser from"vue-eslint-parser";export default defineConfig([{files:["**/*.vue"],languageOptions:{parser:vueParser,parserOptions:{extraFileExtensions:[".vue"],parser:tsparser,sourceType:"module"}},plugins:{vue:vuePlugin},processor:vuePlugin.processors[".vue"],rules:{"vue/comment-directive":"error","vue/jsx-uses-vars":"error","vue/no-shared-component-data":"error","vue/require-prop-type-constructor":"error","vue/require-valid-default-prop":"error","vue/require-v-for-key":"error","vue/no-use-v-if-with-v-for":"warn","vue/no-async-in-computed-properties":"error","vue/no-dupe-keys":"error","vue/no-duplicate-attributes":"error","vue/no-parsing-error":["error",{"x-invalid-end-tag":!1,"invalid-first-character-of-tag-name":!1}],"vue/no-reserved-keys":"error","vue/no-side-effects-in-computed-properties":"error","vue/no-template-key":"warn","vue/no-textarea-mustache":"error","vue/no-unused-components":"warn","vue/no-unused-vars":"warn","vue/require-component-is":"warn","vue/require-render-return":"error","vue/return-in-computed-property":"error","vue/use-v-on-exact":"error","vue/valid-template-root":"error","vue/valid-v-bind":"error","vue/valid-v-cloak":"error","vue/valid-v-else-if":"error","vue/valid-v-else":"error","vue/valid-v-for":"error","vue/valid-v-html":"error","vue/valid-v-if":"error","vue/valid-v-model":"error","vue/valid-v-on":"error","vue/valid-v-once":"error","vue/valid-v-pre":"error","vue/valid-v-show":"error"}}]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import common from"../common.js";import typescript from"../rules/typescript.js";export default defineConfig([...common,...typescript]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import index from"./index.js";import node from"../rules/node.js";export default defineConfig([...index,...node]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import react from"../react.js";import typescript from"../rules/typescript.js";export default defineConfig([...react,...typescript]);
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import vue from"./vue.js";import uniApp from"../rules/uni-app.js";export default defineConfig(vue.concat(uniApp));
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import index from"./index.js";import vue from"../rules/vue.js";export default defineConfig(index.concat(vue));
package/lib/uni-app.js ADDED
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import uniApp from"./rules/uni-app.js";import vue from"./vue.js";export default defineConfig([...vue,...uniApp]);
package/lib/vue.js ADDED
@@ -0,0 +1 @@
1
+ import{defineConfig}from"eslint/config";import common from"./common.js";import vue from"./rules/vue.js";export default defineConfig([...common,...vue]);
package/package.json CHANGED
@@ -1,75 +1,72 @@
1
1
  {
2
2
  "name": "@cgzair/eslint-config-cgz",
3
- "version": "1.2.3",
3
+ "version": "2.0.4",
4
4
  "description": "ESLint shareable config for cgz frontend Guidelines",
5
- "main": "index.js",
5
+ "main": "main.js",
6
6
  "keywords": [
7
7
  "eslint-config-cgz"
8
8
  ],
9
+ "type": "module",
10
+ "types": "lib/index.d.ts",
11
+ "exports": {
12
+ ".": "./lib/index.js",
13
+ "./react": "./lib/react.js",
14
+ "./jsx-a11y": "./lib/jsx-a11y.js",
15
+ "./vue": "./lib/vue.js",
16
+ "./node": "./lib/node.js",
17
+ "./es5": "./lib/es5.js",
18
+ "./uni-app": "./lib/uni-app.js",
19
+ "./typescript": "./lib/typescript/index.js",
20
+ "./typescript/vue": "./lib/typescript/vue.js",
21
+ "./typescript/uni-app": "./lib/typescript/uni-app.js",
22
+ "./typescript/node": "./lib/typescript/node.js",
23
+ "./typescript/react": "./lib/typescript/react.js",
24
+ "./typescript/jsx-a11y": "./lib/typescript/jsx-a11y.js"
25
+ },
9
26
  "author": "cgz",
10
27
  "scripts": {
11
- "test": "jest",
28
+ "build": "tsc",
29
+ "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest",
12
30
  "test:coverage": "jest --coverage"
13
31
  },
14
32
  "files": [
15
- "rules",
16
- "typescript",
17
- "es5.js",
18
- "index.js",
19
- "jsx-a11y.js",
20
- "node.js",
33
+ "lib",
21
34
  "package.json",
22
- "react.js",
23
- "uni-app.js",
24
- "vue.js",
25
35
  "README.md"
26
36
  ],
37
+ "peerDependencies": {
38
+ "eslint": "^9.39.2"
39
+ },
27
40
  "dependencies": {
28
- "eslint": "^8.7.0"
41
+ "@babel/core": "^7.28.5",
42
+ "@babel/eslint-parser": "^7.28.6",
43
+ "@babel/preset-react": "^7.28.5",
44
+ "@typescript-eslint/parser": "^8.50.0",
45
+ "eslint-config-prettier": "^10.1.8",
46
+ "eslint-plugin-import": "^2.32.0",
47
+ "eslint-plugin-jsx-a11y": "^6.10.2",
48
+ "eslint-plugin-n": "^17.23.1",
49
+ "eslint-plugin-react": "^7.37.5",
50
+ "eslint-plugin-react-hooks": "^7.0.1",
51
+ "eslint-plugin-vue": "^10.6.2",
52
+ "globals": "^15.15.0",
53
+ "typescript-eslint": "^8.50.0",
54
+ "vue-eslint-parser": "^10.2.0"
29
55
  },
30
56
  "devDependencies": {
31
- "@babel/core": "^7.16.7",
32
- "@babel/eslint-parser": "^7.16.5",
33
- "@babel/preset-react": "^7.16.7",
34
- "@typescript-eslint/eslint-plugin": "^5.13.0",
35
- "@typescript-eslint/parser": "^5.13.0",
36
- "eslint-config-egg": "^12.3.1",
37
- "eslint-config-prettier": "^8.5.0",
38
- "eslint-plugin-import": "^2.25.4",
39
- "eslint-plugin-jsx-a11y": "^6.5.1",
40
- "eslint-plugin-react": "^7.28.0",
41
- "eslint-plugin-react-hooks": "^4.3.0",
42
- "eslint-plugin-vue": "^8.5.0",
43
- "jest": "^27.3.1",
44
- "mocha": "^8.2.1",
45
- "prettier": "^2.5.1",
46
- "typescript": "^4.1.2",
47
- "vue-eslint-parser": "^8.3.0"
57
+ "@types/eslint-plugin-jsx-a11y": "^6.10.1",
58
+ "jest": "^30.2.0",
59
+ "mocha": "^11.7.5",
60
+ "prettier": "^3.7.4",
61
+ "typescript": "^5.9.3"
48
62
  },
49
63
  "publishConfig": {
50
64
  "access": "public"
51
65
  },
52
66
  "engines": {
53
- "node": ">=12.0.0"
67
+ "node": ">=24.14.1",
68
+ "pnpm": ">=9.0.0"
54
69
  },
55
70
  "license": "MIT",
56
- "jest": {
57
- "testMatch": [
58
- "**/__tests__/**/*.test.js"
59
- ],
60
- "coveragePathIgnorePatterns": [
61
- "node_modules",
62
- "coverage",
63
- "__tests__"
64
- ],
65
- "collectCoverageFrom": [
66
- "**/*.{j,t}s?(x)"
67
- ],
68
- "resolver": "<rootDir>/../../tests/jest-resolver.js",
69
- "coverageReporters": [
70
- "lcov",
71
- "cobertura"
72
- ]
73
- },
74
- "gitHead": "3a4574921944b4fe24845b24ae0bfbfac622fbc7"
71
+ "gitHead": "516c41f893f18edaf5b49db8eab6e7541ba70c31"
75
72
  }
package/es5.js DELETED
@@ -1,9 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "./rules/base/recommended",
4
- "./rules/base/possible-errors",
5
- "./rules/base/style",
6
- "./rules/base/variables",
7
- ].map(require.resolve),
8
- root: true,
9
- };
package/index.js DELETED
@@ -1,23 +0,0 @@
1
- module.exports = {
2
- extends: [
3
- "./rules/base/recommended",
4
- "./rules/base/possible-errors",
5
- "./rules/base/style",
6
- "./rules/base/variables",
7
- "./rules/base/es6",
8
- "./rules/base/strict",
9
- "./rules/imports",
10
- ].map(require.resolve),
11
- parser: "@babel/eslint-parser",
12
- parserOptions: {
13
- requireConfigFile: false,
14
- ecmaVersion: 2020,
15
- sourceType: "module",
16
- ecmaFeatures: {
17
- globalReturn: false,
18
- impliedStrict: true,
19
- jsx: true,
20
- },
21
- },
22
- root: true,
23
- };
package/jsx-a11y.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ["./rules/jsx-a11y"].map(require.resolve),
3
- };
package/node.js DELETED
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- extends: ["./index", "./rules/node"].map(require.resolve),
3
- };