Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: Migrate ESLint 8 to 9#128

Merged
kou merged 1 commit intoapache:mainfrom
kou:eslint-config
May 28, 2025
Merged

chore: Migrate ESLint 8 to 9#128
kou merged 1 commit intoapache:mainfrom
kou:eslint-config

Conversation

@kou
Copy link
Member

@kou kou commented May 28, 2025

What's Changed

ESLint 8 reached EOL on 2024-10-05.

.eslintrc.cjs was deprecated. So this also migrated to flat config format (eslint.config.js). See also how to migrate: https://eslint.org/docs/latest/use/configure/migration-guide

But this eslint.config.js uses recommended style by typescript-eslint (tseslint.config()) not ESLint's one (defineConfig()).

See also:

This also cleans up existing rules. Some unused rules are removed and some lint errors are fixed.

Closes #36.

@kou kou requested review from domoritz and trxcllnt May 28, 2025 05:41
@kou kou force-pushed the eslint-config branch 2 times, most recently from 19cfbda to 4a1a02f Compare May 28, 2025 06:20
ESLint 8 reached EOL on 2024-10-05.

`.eslintrc.cjs` was deprecated. So this also migrated to flat config
format (`eslint.config.js`). See also how to migrate:
https://eslint.org/docs/latest/use/configure/migration-guide

But this `eslint.config.js` uses recommended style by
typescript-eslint (`tseslint.config()`) not ESLint's
one (`defineConfig()`).

See also:
* https://typescript-eslint.io/packages/typescript-eslint/
* https://eslint.org/docs/latest/use/configure/configuration-files

This also cleans up existing rules. Some unused rules are removed and
some lint errors are fixed.
@kou kou force-pushed the eslint-config branch from 4a1a02f to b1606d4 Compare May 28, 2025 06:23
Comment on lines +99 to +100
threw = true;
(typeof it.throw === 'function') && (it.throw(e));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes 99:10 error Unexpected constant truthiness on the left-hand side of a `&&` expression no-constant-binary-expression.

start(controller) { next(controller, it || (it = source[Symbol.iterator]() as SourceIterator<T>)); },
pull(controller) { it ? (next(controller, it)) : controller.close(); },
cancel() { (it?.return && it.return() || true) && (it = null); }
cancel() { (it?.return && it.return()); it = null; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes 46:21 error Unexpected constant truthiness on the left-hand side of a `&&` expression no-constant-binary-expression.

@kou kou merged commit b0e0c44 into apache:main May 28, 2025
5 checks passed
@kou kou deleted the eslint-config branch May 28, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use eslint.config.js instead of .eslintrc.cjs

2 participants