ESLint Blog

フィード

記事のアイキャッチ画像
ESLint v10.13.0 released
はてなブックマークアイコン 2
ESLint Blog
HighlightsSeveral core rules have been updated to report more linting problems.no-use-before-defineThe no-use-before-define rule has been updated to account for the fact that IIFEs execute immediately by treating them as part of the execution context where they are defined and called.This change can produce more linting errors in cases such as the following:/* eslint no-use-before-define: ["error", { variables: false }] */(() => { console.log(foo); // 'foo' was used before it was defined.})();const foo = "bar";1234567Copy code to clipboard no-obj-callsThe no-obj-calls rule has been updated to report calls to globalThis./* eslint no-obj-calls: "error" */const foo = globalThis(); // 'globalThis' is not a function.const bar = new globalThis(); // 'globalThis' is not a function.12345Copy code to clipboard no-unsafe-optional-chainingThe no-unsafe-optional-chaining rule has been updated to report unsafe usage of optional chaining in arguments of yield*./* eslint no-unsafe-optional-chaining:
2日前
記事のアイキャッチ画像
ESLint v10.12.0 released
ESLint Blog
HighlightsSupport for tokens and comments in SourceCodeRule authors often work with ESLint’s SourceCode object, which represents the JavaScript source code being linted. Its getText(), getLoc(), and getRange() methods have always accepted a node, token, or comment, but the documentation didn’t describe every argument type, and the type definitions rejected some valid calls, such as passing a comment.This release updates the documentation and type definitions to match the actual behavior. This also aligns these methods with implementations of the core SourceCodeBase interface used in language plugins. Code that calls these methods is unaffected, but TypeScript code that implements or mocks SourceCode may need its getText(), getLoc(), and getRange() signatures updated to accept tokens and comments.Rule fixesThe following rules have been updated to work correctly in certain edge cases, including autofix behavior and the handling of supplementary Unicode characters in code:consistent-retur
16日前
記事のアイキャッチ画像
ESLint v10.11.0 released
ESLint Blog
HighlightsFaster startup and lintingThis release includes a set of performance improvements across ESLint’s core linting pipeline and the stylish formatter. Linting results and the public API are unchanged: the same files produce the same messages as before, just faster.The main improvements are:Startup. Loading the eslint package no longer eagerly initializes the JSON Schema validator used for rule options. It’s now created the first time a rule’s options actually need to be validated, which removes about 45 modules from the initial dependency graph and reduces package load time by 20–25%.Rule execution. When ESLint traverses a file’s structure, it has to decide, for every piece of code, which rules are interested in it and then call those rules. This is the most frequently executed part of the linting process, and it now takes a shorter route in the most common cases. Common node selector types are handled by fast paths, and rule visitors are invoked directly whenever possible instea
1ヶ月前
記事のアイキャッチ画像
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
1ヶ月前
記事のアイキャッチ画像
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)
2ヶ月前
記事のアイキャッチ画像
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
2ヶ月前
記事のアイキャッチ画像
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])
2ヶ月前
記事のアイキャッチ画像
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
3ヶ月前
記事のアイキャッチ画像
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
3ヶ月前
記事のアイキャッチ画像
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
3ヶ月前