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

feat(ts): add rules that required parserOptions #131

Merged
merged 1 commit into from Nov 29, 2022

Conversation

zanminkian
Copy link
Contributor

Description

Closes #112

Linked Issues

Additional context

@antfu
Copy link
Owner

antfu commented Nov 24, 2022

It's it possible to have a setting for users to toggle?

@zanminkian
Copy link
Contributor Author

If we stick to one line of config, maybe this is the most convenient way to use, if we ignore the linting speed reduction. What about detecting tsconfig.eslint.json before tsconfig.json? Do you have any other suggestions or directions?

@antfu
Copy link
Owner

antfu commented Nov 25, 2022

I think having this default is a reasonable choice. But I think users should have the ability to opt-out of this to improve the perf in case they want (same as they can always override rules).

I am looking for something like: https://eslint.org/docs/latest/user-guide/configuring/configuration-files#adding-shared-settings

{
  extends: '@antfu',
  settings: {
    useTSC: false
  }
}

But I am not sure if it's designed for a config preset to read.

@zanminkian
Copy link
Contributor Author

settings field is designed for eslint plugins. See here. Shareable eslint config like this repo maybe should not use settings. And we have no way to get the settings field content, except using cosmiconfig.

We have to well document it that tell user should add overrides: require('@antfu/eslint-config-ts').overrides.filter(o=>o. parser !== '@typescript-eslint/parser') to improve lint speed.

@antfu antfu merged commit 7c769fe into antfu:main Nov 29, 2022
@antfu
Copy link
Owner

antfu commented Nov 29, 2022

Let's have it and see

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable @typescript-eslint/no-floating-promises and @typescript-eslint/no-misused-promises
2 participants