Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enhancement: support ESLint's newdefineConfig string config references #10934

Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
@niklaswimmer

Description

@niklaswimmer

Before You File a Proposal Please Confirm You Have Done The Following...

Relevant Package

typescript-eslint

My proposal is suitable for this project

  • I believe my proposal would be useful to the broader TypeScript community (meaning it is not a niche proposal).

Description

With ESLint v9.22 they added their owndefineConfig config helper (similar toconfig), which does again supportextends. I of course immediately tried to rewrite my ESLint config to use the new helper:

import{defineConfig,globalIgnores}from"eslint/config";importtsfrom"typescript-eslint";exportdefaultdefineConfig({plugins:{ts:ts.plugin},extends:["ts/strict","ts/stylistic",],rules:{"ts/no-inferrable-types":["error",{ignoreParameters:true,ignoreProperties:true},],},},);

Runningnpx eslint fails with the following error:

Oops! Something went wrong! :(ESLint: 9.22.0TypeError: Plugin config "ts/strict" is an eslintrc config and cannot be used in this context.    at deepNormalizePluginConfig (C:\Users\niklaswimmer\Dev\test\node_modules\@eslint\config-helpers\dist\cjs\index.cjs:231:9)    at findPluginConfig (C:\Users\niklaswimmer\Dev\test\node_modules\@eslint\config-helpers\dist\cjs\index.cjs:262:9)    at C:\Users\niklaswimmer\Dev\test\node_modules\@eslint\config-helpers\dist\cjs\index.cjs:394:25    at Array.map (<anonymous>)    at processExtends (C:\Users\niklaswimmer\Dev\test\node_modules\@eslint\config-helpers\dist\cjs\index.cjs:392:36)    at C:\Users\niklaswimmer\Dev\test\node_modules\@eslint\config-helpers\dist\cjs\index.cjs:464:38    at Array.flatMap (<anonymous>)    at processConfigList (C:\Users\niklaswimmer\Dev\test\node_modules\@eslint\config-helpers\dist\cjs\index.cjs:464:20)    at defineConfig (C:\Users\niklaswimmer\Dev\test\node_modules\@eslint\config-helpers\dist\cjs\index.cjs:499:9)    at file:///C:/Users/niklaswimmer/Dev/test/eslint.config.mjs?mtime=1741610408364:37:16

My understandig is that when givents/strict ESLint tries to accessts.plugin.configs.strict, which is not the same asts.configs.strict and not compatible with flat configs.

Additional Info

I marked this as enhancement and not as bug because the "fix" is to simply usets.configs.strict instead of"ts/strict" (and use the full rule namespace instead of just"ts"), but I expect the current behavior to be confusing for new users (ESLint shows both options in theirdocs, but if one of them does not work, it will be confusing).

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancementNew feature or requestlocked due to agePlease open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp