ESLint Blog
フィード

ESLint v10.10.0 released
ESLint Blog
HighlightsThe no-unexpected-multiline rule has been updated to check regular expression literals with d and v flags./* eslint no-unexpected-multiline: "error" */// Unexpected newline between numerator and division operatorfoo = bar/regex/v.exec(baz).forEach(qux);12345Copy code to clipboard The following rules have also been updated to avoid incorrect or unexpected behavior in some edge cases:new-capno-extra-bindno-unreachableprefer-object-has-ownFeatures264b434 feat: add d and v flags to no-unexpected-multiline (#21305) (Gihyeon Jeong / 정기현)c6cc6c5 feat: check Object.prototype property names in new-cap (#21269) (crimsonjay0)5661fa6 feat: no-extra-bind false negatives with class fields and static blocks (#21260) (synthex-byte)Bug Fixesbb47dc6 fix: update dependency file-entry-cache to v11 (#20801) (Milos Djermanovic)427ac0a fix: use format strings in debug calls (#21247) (Francesco Trotta)9d81532 fix: support __proto__ in /* exported */ comments (#21261) (sethamus)87e0a08 fix: prefer-ob
14日前

ESLint v10.9.1 released
ESLint Blog
HighlightsThis patch release fixes false positives in the no-loss-of-precision rule that were introduced in v10.9.0.Bug Fixes1e641c9 fix: no-loss-of-precision false positive with trailing decimal point (#21251) (Aleksandr Shoronov)Documentationad74a8d docs: add deprecation steps for EOL package versions (#21248) (Francesco Trotta)Chores3c3ae53 chore: update ecosystem plugins (#21249) (ESLint Bot)
25日前

ESLint v10.9.0 released
ESLint Blog
HighlightsNew option checkConditionalExpressions in no-unmodified-loop-conditionThe no-unmodified-loop-condition rule now supports a checkConditionalExpressions option.When enabled, each branch in a ternary expression is checked independently.For example, with { "checkConditionalExpressions": true }, the rule reports the done variable as not modified in the loop:let chunk = getInitialChunk();let done = false;while (chunk ? !done : false) { chunk = nextOrNull();}123456Copy code to clipboard Features08de88e feat: handle underflow in no-loss-of-precision (#21218) (Rithish S)55db479 feat: add checkConditionalExpressions to no-unmodified-loop-condition (#21175) (sethamus)Bug Fixes2ba3025 fix: prevent unsafe no-var autofix with hoisted functions (#21213) (sethamus)8e69622 fix: Prevent no-var autofix when var is shadowed by catch parameter (#21204) (Yang Hyeonjong)684b579 fix: prefer-template invalid autofix creates a tagged template call (#21207) (김채영)Documentation9ef407a docs: use eslint.co
1ヶ月前

ESLint v10.8.1 released
ESLint Blog
HighlightsThe following rules have been updated to ensure that they behave correctly in some edge cases:accessor-pairsgetter-returnid-denylistid-matchno-unused-labelsno-unused-varsBug Fixes18eb0a7 fix: prevent ASI hazard in no-unused-labels autofix (#21173) (dongkyu lee)151ba3f fix: false positives in getter-return and accessor-pairs (#21163) (Grit)6898df9 fix: ignore meta-property names in id-denylist (#21166) (Pixel)4d7db66 fix: ignore meta-property names in id-match (#21167) (Pixel)677214e fix: handle ASI hazards in no-unused-vars removeVar suggestion (#20935) (kuldeep kumar)Documentation7d0cbf8 docs: Update README (GitHub Actions Bot)0a05812 docs: add missing backticks to [no-duplicate-imports](/docs/rules/no-duplicate-imports).js (#21183) (Lee Daeun)678c90b docs: Update README (GitHub Actions Bot)8a10424 docs: Update README (GitHub Actions Bot)69bb948 docs: Update README (GitHub Actions Bot)Chores0a14800 chore: update github/codeql-action action to v4.37.4 (#21196) (renovate[bot])
1ヶ月前

ESLint v10.8.0 released
ESLint Blog
HighlightsIn ESLint v10.8.0, the following rules have been updated to avoid incorrect or unexpected behavior in some edge cases:class-methods-use-thisprefer-object-spreadprefer-templatepreserve-caught-errorno-unreachable-loopFeatures2fee9bb feat: export ConfigObject from eslint/config (#21082) (sethamus)Bug Fixes6b8d2f7 fix: escape reserved characters in rule id in html formatter (#21129) (Francesco Trotta)9091071 fix: prevent no-unreachable-loop crash when all loop types are ignored (#21116) (Pixel)e23fafe fix: prefer-object-spread add semicolon when adding parenthesis (#21081) (synthex-byte)20b5ad0 fix: quadratic-time regex in prefer-template (#21096) (Milos Djermanovic)8b6f6c0 fix: apply ignore configs to computed methods in class-methods-use-this (#21094) (Pixel)b2c608c fix: NewExpression with parenthesized callee in preserve-caught-error (#21083) (Francesco Trotta)Documentation6ddf858 docs: fix broken Specify Parser Options anchor link (#21106) (Minsu)784dfbe docs: Clarify no-eq-n
2ヶ月前

Automating ESLint migrations with Codemod
ESLint Blog
We are excited to announce a partnership between ESLint and Codemod to create a better migration experience for ESLint users, starting with the ESLint v8 to v9 and v9 to v10 migrations. All official ESLint codemods live in eslint/codemods and on the Codemod Registry. Community members are encouraged to open issues for missing codemods or contribute new ones through pull requests. Once reviewed and merged by maintainers, codemods are automatically published to the Codemod Registry through GitHub Actions.What is Codemod?Codemod is an open source platform for building, sharing, and running automated code migrations at scale. It is an OpenJS Foundation partner, and its tooling has been adopted by projects such as React, Node.js, Express, React Router, Nuxt.js, pnpm, Webpack, MSW, i18next, and more.Its platform includes JSSG (JS ast-grep), a codemod runtime and workflow engine that supports multi-step transformations and combines deterministic, compiler-aware transformations with AI-powered
2ヶ月前

ESLint v9.39.5 released
ESLint Blog
HighlightsThis release backports a fix originally released in v10.3.0 that prevents ESLint from crashing in host environments where require.cache is unavailable, such as Yarn Plug’n’Play.Bug Fixes253be16 fix: handle unavailable require cache (backport of #20812 to v9.x) (#21065) (Eric)Documentation74930ed docs: switch build to Node.js 24 (#20894) (Milos Djermanovic)eaec8bb docs: Add ESLint v9.x EOL notice (#20828) (Milos Djermanovic)Chores458205f chore: update @eslint/eslintrc and @eslint/js for v9.39.5 (#21077) (Francesco Trotta)202117b chore: package.json update for @eslint/js release (Jenkins)d9eb6ed test: disable warning for vm.constants.USE_MAIN_CONTEXT_DEFAULT_LOADER (#21074) (Francesco Trotta)7b431a7 chore: override re2 dependency for @metascraper/helpers (#21068) (Milos Djermanovic)daf7791 chore: pin [email protected] (#20895) (Milos Djermanovic)daee8ba ci: use pnpm in eslint-flat-config-utils type integration test (#20829) (Milos Djermanovic)116d4be ci: unpin Node.js 25.x in CI (#2
2ヶ月前

ESLint v10.7.0 released
ESLint Blog
HighlightsNew option checkConstructorCallCallbacks in max-nested-callbacksThe max-nested-callbacks rule now supports a checkConstructorCallCallbacks option.When enabled, the rule also counts callback functions passed to constructor calls with new, such as new Promise((resolve) => {}), when calculating nesting depth.For example, with { "max": 1, "checkConstructorCallCallbacks": true }, the rule reports the following code as exceeding the allowed callback nesting depth:run(() => { new Promise(resolve => resolve());});123Copy code to clipboard New option errorClassNames in preserve-caught-errorThe preserve-caught-error rule now supports an errorClassNames option.This option lets you specify additional custom error class names that must preserve the original caught error by passing it as a cause.For example, with { "errorClassNames": ["MyError"] }, the following code is reported because the thrown MyError does not include the original error as a cause, just like built-in error types must:t
2ヶ月前

CodeRabbit becomes ESLint gold sponsor
ESLint Blog
We are happy to share that CodeRabbit has become an ESLint gold sponsor, donating $1,000 each month for the ongoing maintenance and development of ESLint! CodeRabbit is an AI-powered code review platform that provides fast, context-aware feedback on pull requests. It helps development teams automate and accelerate the code review process, catch bugs and logic errors early, and improve code quality and velocity.Here’s what Santosh Yadav, Principal Developer Advocate at CodeRabbit, had to say about ESLint:“We love Open Source and ESLint is critical for the ecosystem. We want to make Open Source more sustainable for maintainers. ESLint is shipped as part of the CodeRabbit tools, and we love to support our dependencies.”– Santosh Yadav, Principal Developer Advocate, CodeRabbitESLint is extremely grateful for the support of the CodeRabbit team. Donations from sponsors like CodeRabbit allow ESLint to pay contributors for ongoing maintenance and development, helping to make the open-source ec
3ヶ月前

ESLint v10.6.0 released
ESLint Blog
HighlightsNew option checkRelationalComparisons in no-constant-binary-expressionESLint v10.6.0 introduces a new option checkRelationalComparisons for the no-constant-binary-expression rule.When enabled, the rule reports relational comparisons using <, <=, >, or >= whose result is always constant based on their literal operands.For example:const value = "a" > "b"; // always `false`1Copy code to clipboard while (0 <= 0) { // always `true` /* ... */}123Copy code to clipboard Rule refinementsThe following rules have been tweaked to improve correctness and ensure more consistent or intuitive behavior in edge cases:max-classes-per-filemax-nested-callbacksno-constant-binary-expressionno-extra-boolean-castno-promise-executor-returnno-throw-literalprefer-exponentiation-operatorprefer-promise-reject-errorsradixFeaturesb1f9106 feat: detect Symbol() and BigInt() in no-constant-binary-expression (#20981) (Taejin Kim)f291007 feat: add checkRelationalComparisons to no-constant-binary-expression (#209
3ヶ月前