ESLint Blog
フィード

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])
12日前

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
1ヶ月前

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
1ヶ月前

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
1ヶ月前

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
1ヶ月前

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
2ヶ月前

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
2ヶ月前

ESLint v10.5.0 released
ESLint Blog
HighlightsFive core rules now highlight smaller ranges of code to avoid shadowing other problems in editors.Rules max-lines-per-function, max-nested-callbacks, and max-statements now highlight only the function header instead of the entire function.Rules max-depth and no-with now highlight only the first keyword.Several errors in the calculations have been corrected in the max-depth and max-nested-callbacks rules. These bug fixes can result in reporting more linting errors in existing code.Features5ca8c52 feat: correct stack tracking in max-nested-callbacks (#20973) (Pixel998)b565783 feat: report no-with violations at the with keyword (#20971) (Pixel998)2ce032f feat: report max-lines-per-function violations at function head (#20966) (Pixel998)732cb3e feat: report max-nested-callbacks violations at function head (#20967) (Pixel998)f9c138a feat: report max-depth violations on keywords (#20943) (Pixel998)bdb496c feat: correct max-depth handling for else-if chains (#20944) (Pixel998)c29687
2ヶ月前

ESLint v10.4.1 released
ESLint Blog
Bug Fixese557467 fix: update @eslint/plugin-kit version to 0.7.2 (#20930) (Francesco Trotta)d4ce898 fix: propagate failures from delegated commands (#20917) (Minh Vu)f4f3507 fix: prefer-arrow-callback invalid autofix with newline after async (#20916) (kuldeep kumar)c5bc78b fix: false positive for reference in finally block (#20655) (Tanuj Kanti)27538c0 fix: add missing CodePath and CodePathSegment types (#20853) (Pixel998)Documentation61b0add docs: remove deprecated rule from related rules of max-params (#20921) (Tanuj Kanti)305d5b9 docs: remove deprecated rules from related rules section (#20911) (Tanuj Kanti)49b0202 docs: fix display: none of ad (#20901) (Tanuj Kanti)9067f94 docs: switch build to Node.js 24 (#20893) (Milos Djermanovic)c91b041 docs: Update README (GitHub Actions Bot)e349265 docs: clarify semver strings in rule deprecation objects (#20885) (Milos Djermanovic)Choresb0e466b test: add data property to invalid tests cases for rules (#20924) (Tanuj Kanti)f78838b test: add C
3ヶ月前

ESLint v10.4.0 released
ESLint Blog
HighlightsNew includeIgnoreFile() helperThis release introduces the includeIgnoreFile() helper for configuration files that allows for including patterns from .gitignore files or any other files with gitignore-style patterns.Previously available in the external package @eslint/compat, the new includeIgnoreFile helper function is exported from the eslint/config entrypoint and provides an extended API that allows multiple files to be included and patterns to be interpreted relative to the location of those files, which is a common use case for nested .gitignore files.// eslint.config.jsimport { defineConfig, includeIgnoreFile } from "eslint/config";import { fileURLToPath } from "node:url";const rootGitignorePath = fileURLToPath( new URL(".gitignore", import.meta.url));const nestedGitignorePath = fileURLToPath( new URL("some/other/folder/.gitignore", import.meta.url),);export default defineConfig([ includeIgnoreFile([rootGitignorePath, nestedGitignorePath], { // option to interpret patter
3ヶ月前