Skip to content

Commit

Permalink
feat: deprecate omit-arrow-curly
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed Sep 22, 2023
1 parent e23b6fe commit e279608
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ According to this [issue](https://github.com/eslint/eslint/pull/15933), i highly

## [My custom rules](./packages/eslint-plugin/README.md)

- [~~@lvjiaxuan/no-spaces-on-empty-line~~](./packages/eslint-plugin/src/rules/no-spaces-on-empty-line.ts) is deprecated.
- [@lvjiaxuan/prefer-constraint-tuple-type](./packages/eslint-plugin/src/rules/prefer-constraint-tuple-type.ts) is warning by default.
- [@lvjiaxuan/no-multi-empty-lines-in-pattern](./packages/eslint-plugin/src/rules/no-multi-empty-lines-in-pattern.ts) is warning by default.
- [@lvjiaxuan/omit-arrow-curly](./packages/eslint-plugin/src/rules/omit-arrow-curly.ts) is warning by default.
- [~~@lvjiaxuan/no-spaces-on-empty-line~~](./packages/eslint-plugin/src/rules/no-spaces-on-empty-line.ts) is deprecated as it can be replaced by [no-trailing-spaces](https://eslint.org/docs/latest/rules/no-trailing-spaces).
- [~~@lvjiaxuan/omit-arrow-curly~~](./packages/eslint-plugin/src/rules/omit-arrow-curly.ts) is deprecated as it can be replaced by [arrow-body-style](https://eslint.org/docs/latest/rules/arrow-body-style)

# Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,6 @@ const [
### [@lvjiaxuan/omit-arrow-curly](./src/rules/omit-arrow-curly.ts)

[Check Test-Cases.](./src/rules/omit-arrow-curly.test.ts)
## Refer
## Reference

- https://typescript-eslint.io/play/#showAST=es
1 change: 0 additions & 1 deletion packages/eslint-plugin/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ export default {
rules: {
'@lvjiaxuan/prefer-constraint-tuple-type': 'warn',
'@lvjiaxuan/no-multi-empty-lines-in-pattern': 'warn',
'@lvjiaxuan/omit-arrow-curly': 'warn',
},
}
2 changes: 2 additions & 0 deletions packages/eslint-plugin/src/rules/omit-arrow-curly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export default createRule<['always' | 'never'], 'omitCurly'>({
fixable: 'whitespace',
hasSuggestions: true,
messages: { omitCurly: 'This arrow function can omit block body.' },
deprecated: true,
replacedBy: [ 'arrow-body-style' ],
},

defaultOptions: [ 'always' ],
Expand Down

0 comments on commit e279608

Please sign in to comment.