Skip to content

Commit

Permalink
禁用 style/jsx-one-expression-per-line 规则
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang-Wei-666 committed Aug 22, 2024
1 parent ced2652 commit 453666f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## [Unreleased]
- 💄 禁用 `style/jsx-one-expression-per-line` 规则

## [v3.2.0]
- 📅 2024-08-02
Expand Down
6 changes: 6 additions & 0 deletions src/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ export default (options, ...userConfigs) => {
'vue/singleline-html-element-content-newline': 'off',
},
},
{
name: 'moomfe/jsx/rules',
rules: {
'style/jsx-one-expression-per-line': 'off',
},
},
...userConfigs,
);
};
10 changes: 10 additions & 0 deletions test/jsx.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* eslint-disable unused-imports/no-unused-vars */

// 允许同一行有多个 jsx 元素
const b = (
<div>
<div>Hello</div>
当前{ true ? '已' : '未' }登录
开发工具 { 'Mixte' + ' ' }
</div>
);
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"compilerOptions": {
"target": "ESNext",
"jsx": "preserve",
"jsxImportSource": "vue",
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "Bundler",
Expand Down

0 comments on commit 453666f

Please sign in to comment.