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

--fix flag doesn't work with custom Program #3834

Open
Labels
blocked by external APIBlocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship APIpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree
@rdsedmundo

Description

@rdsedmundo
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I haveread the FAQ and my problem is not listed.

Repro

import{logger}from'@charityvest/lambda';consta={};// ["test"] is better written in dot notation. (eslint@typescript-eslint/dot-notation)logger.info(a['test']);functionb(){returntrue;}logger.info(b());
constparsedTsConfig=ts.getParsedCommandLineOfConfigFile('./tsconfig.json',/*compilerOptionsToExtend*/undefined,{ ...ts.sys},);constcompilerHost=ts.createCompilerHost(parsedTsConfig.options,true);constprogram=ts.createProgram(parsedTsConfig.fileNames,parsedTsConfig.options,compilerHost);// the code you're using to do the parse of the aforementioned codemodule.exports={parserOptions:{programs:[program],},}

Expected Result

import { logger } from '@charityvest/lambda';const a = {};logger.info(a.test);function b() {  return true;}logger.info(b());

Actual Result

import { logger } from '@charityvest/lambda';const a = {};logger.info(a.test true;}logger.info(b());

Additional Info

I saw that theallowAutomaticSingleRunInference added a workaround for this by checking if a file has been called inside theparserAndGenerateServices more than once, but unfortunately, there's no way for me to access that from the ESLint config file just. This really limits the usage of the custom Programs functionality if someone relies on the--fix flag.

Versions

packageversion
@typescript-eslint/typescript-estree4.29.3
TypeScript4.3.2
node4.17.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    blocked by external APIBlocked by a tool we depend on exposing an API, such as TypeScript's Type Relationship APIpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    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