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: use typescript project only for type-aware files, closes #380 #384

Merged
merged 1 commit into from Jan 17, 2024

Conversation

Dimava
Copy link
Contributor

@Dimava Dimava commented Jan 4, 2024

Description

This splits parser into two FlatConfigItems, one with project for type-aware files and one without for type-unaware files

Linked Issues

#375
#380

Additional context

Tests:
https://github.com/Dimava/antfu-eslint-config/tree/repro/380-works-fine - uses filesTypeAware: ['src/index.ts'], no errors
https://github.com/Dimava/antfu-eslint-config/tree/repro/380-errors-as-expected - doesn't use filesTypeAware, errors with "not in TS project" on many files

@Dimava
Copy link
Contributor Author

Dimava commented Jan 4, 2024

Seem to be working
Lint crashes because type-aware rules were not used before, as expected - after experimental commit
Lint does not warn of files missing in tsconfig, as expected
If the "typeAwareFiles" is commented out, lint does error that files are missing in tsconfig, as expected

@Dimava Dimava marked this pull request as ready for review January 4, 2024 15:31
eslint.config.ts Outdated
@@ -6,7 +6,10 @@ export default antfu(
{
vue: true,
// react: true,
typescript: true,
typescript: {
tsconfigPath: 'tsconfig.json',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI was failed because of this change

@Dimava
Copy link
Contributor Author

Dimava commented Jan 8, 2024

Force-pushed back to the working commit

Tests:
https://github.com/Dimava/antfu-eslint-config/tree/repro/380-works-fine - uses filesTypeAware: ['src/index.ts'], no errors
https://github.com/Dimava/antfu-eslint-config/tree/repro/380-errors-as-expected - doesn't use filesTypeAware, errors with "not in TS project" on many files

@antfu antfu merged commit 9e2bf16 into antfu:main Jan 17, 2024
10 checks passed
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.

None yet

3 participants