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

Strict Mode #183

Closed
3 tasks done
zanminkian opened this issue May 19, 2023 · 5 comments
Closed
3 tasks done

Strict Mode #183

zanminkian opened this issue May 19, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@zanminkian
Copy link
Contributor

Clear and concise description of the problem

Detecting tsconfig.eslint.json file (in the project root) or configuring ESLINT_TSCONFIG env is not clear way to use TypeScript Aware Rules.

Suggested solution

Step 1. Do not detect tsconfig.eslint.json file and remove supporting ESLINT_TSCONFIG env.
Step 2. Support ESLINT_STRICT env. If user run ESLINT_STRICT=true eslint ., enable the buit-in typescript aware rules (and other rules if they built in).
Step 3. Update README. Tell user how to enable strict mode.

Alternative

No response

Additional context

No response

Validations

@zanminkian zanminkian added the enhancement New feature or request label May 19, 2023
@zanminkian
Copy link
Contributor Author

If it makes sense, I'm glad to create a PR to implement it.

@antfu
Copy link
Owner

antfu commented May 19, 2023

I am not very sure. The reason we were doing that it trying to find a middle ground, where you can do that without much configuration, while the majority of users won't be affected by this. If have a env in your command it's acceptable to you, isn't ESLINT_TSCONFIG=tsconfig.json eslint . also working as you expected?

@zanminkian
Copy link
Contributor Author

Both are ok. But ESLINT_STRICT is much more ergonomic and easy-understanding, in my humble opinion. Moreover, we can add more rules which do not belongs to typescript aware rules to enhance the Strict Mode.

@zanminkian
Copy link
Contributor Author

zanminkian commented Jun 2, 2023

For example, setting consistent-type-assertions to never and enabling no-explicit-any to block assertions and any declaration to make project type safer. They should work under STRICT mode, but they are not Typescript aware rules.
So that what I mean that strict mode is more well-understood than typescript aware rules.

@antfu
Copy link
Owner

antfu commented Oct 9, 2023

With the flat config it should be much easier to support this. As I don't have much need on this myself, I'll close is for now. If you still want to push it, feel free to bring it back. Thanks.

@antfu antfu closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants