Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit 001f502

Browse files
authored
Merge pull request #6 from sj-distributor/5-add-new-rule
Add new rule
2 parents caeaa4b + e8aa162 commit 001f502

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

configs/.eslintrc.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ module.exports = {
4141
"error",
4242
{
4343
cases: {
44-
kebabCase: true, // 是否支持横杠 (-) 命名
45-
camelCase: false, // 是否支持小驼峰命名
46-
snakeCase: false, // 是否支持 (_) 下划线命名
47-
pascalCase: false, // 是否支持大坨峰命名
44+
kebabCase: true, // 支持横杠 (-) 命名
45+
camelCase: false, // 支持小驼峰命名
46+
snakeCase: false, // 支持 (_) 下划线命名
47+
pascalCase: false, // 支持大坨峰命名
4848
},
4949
},
5050
],
@@ -61,9 +61,10 @@ module.exports = {
6161
next: "*",
6262
},
6363
],
64-
"@typescript-eslint/no-var-requires": 0, // 关闭禁止使用 require 语句
64+
"@typescript-eslint/no-var-requires": 0, // (关闭) 禁止使用 require 语句
6565
"@sj-distributor/react/interface-name-prefix": ["error", "I"], // 默认强制 interface 大写 I 前缀
66-
"react/display-name": 0, // 关闭(不允许在 React 组件定义中缺少 displayName)
66+
"react/display-name": 0, // (关闭) 不允许在 React 组件定义中缺少 displayName
67+
"react/self-closing-comp": 2, // 检测 JSX 中的所有组件和 HTML 元素,如果元素没有子元素,就会自动转换为自闭合形式
6768
},
6869
// 共享配置,提供给每一个将被执行的规则
6970
settings: {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sj-distributor/eslint-plugin-react",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"description": "ESLint presets for react",
55
"keywords": [
66
"eslint",

0 commit comments

Comments
 (0)