eslint-config-gorgon 1.2.1 → 1.2.2
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/package.json +1 -1
- package/src/rules/base.js +1 -1
- package/src/rules/react.js +11 -1
package/package.json
CHANGED
package/src/rules/base.js
CHANGED
package/src/rules/react.js
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
/** @type {import('eslint').Linter.Config} */
|
|
2
2
|
const config = {
|
|
3
|
-
extends: [
|
|
3
|
+
extends: [
|
|
4
|
+
"plugin:react-hooks/recommended",
|
|
5
|
+
"plugin:jsx-a11y/recommended",
|
|
6
|
+
"plugin:react/recommended",
|
|
7
|
+
],
|
|
8
|
+
rules: {
|
|
9
|
+
"react/jsx-no-undef": "warn", // 检测未定义的 JSX 组件
|
|
10
|
+
"react/jsx-uses-react": "warn", // 检测 JSX 使用前是否导入 React
|
|
11
|
+
"react/jsx-uses-vars": "warn", // 检测未使用的 JSX 变量
|
|
12
|
+
"react/self-closing-comp": "warn", // 要求没有子元素的组件使用自闭合标签
|
|
13
|
+
},
|
|
4
14
|
};
|
|
5
15
|
|
|
6
16
|
module.exports = config;
|