Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*.ts override makes ESLint lint .ts files #1552

Closed
privatenumber opened this issue Oct 19, 2021 · 0 comments · Fixed by #1581
Closed

*.ts override makes ESLint lint .ts files #1552

privatenumber opened this issue Oct 19, 2021 · 0 comments · Fixed by #1581
Labels

Comments

@privatenumber
Copy link
Sponsor Contributor

By default, ESLint only looks at files with the .js extension. However, after installing this plugin, this override causes it to lint .ts files too.

Since I am in a JS codebase with a manually written .d.ts file, I get parsing errors like this:

  12:9  error  Parsing error: Unexpected token const

on

index.d.ts

declare const myFunction: (name: string) => Promise<boolean>;

I would prefer it doesn't try to lint my .d.ts or ts files if I don't have the Typescript plugin installed.

Although there are workarounds for this, I think this is unexpected default behavior that shouldn't require patching on user-land.


Workarounds:

  • manually adding the rules from recommended
  • adding "ignorePatterns": ["*.ts"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant