Skip to content

Commit

Permalink
Remove no-confusing-arrow because of the deprecation of formatting …
Browse files Browse the repository at this point in the history
…rules (#276)

First, this rule was deprecated in ESLint v8.53.0.
The alternative is the third-party plugin `@stylistic/eslint-plugin-js`.

Second, I sometimes feel annoying on this rule. For example, see:

```js
const result = () => (type === 'foo' ? foo() : bar());
/*             ^^ Arrow function used ambiguously with a conditional expression [no-confusing-arrow] */
```

In this case, I think it's enough readable, thanks to `()` around the function body.
So, I think this rule is no longer necessary in this shared config.

Ref:
- https://eslint.org/docs/latest/rules/no-confusing-arrow
- https://eslint.org/blog/2023/10/deprecating-formatting-rules
- https://eslint.style/packages/js
  • Loading branch information
ybiquitous authored Jul 17, 2024
1 parent 2fa30c1 commit 5c631c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Head

- Removed: `no-confusing-arrow` because of the deprecation of formatting rules.
- Changed: replace deprecated `padding-line-between-statements` with `@stylistic/js/padding-line-between-statements`.
- Changed: bump `eslint-plugin-jest` from v27 to v28.
- Changed: bump `eslint-plugin-n` from v16 to v17.
Expand Down
6 changes: 0 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ module.exports = {
'func-name-matching': 'error',
'func-names': ['error', 'as-needed'],
'guard-for-in': 'error',
'no-confusing-arrow': [
'error',
{
allowParens: false,
},
],
'no-console': [
'error',
{
Expand Down

0 comments on commit 5c631c6

Please sign in to comment.