-
-
Notifications
You must be signed in to change notification settings - Fork 478
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: typescript.tsconfigPath array support #306
Conversation
src/configs/typescript.ts
Outdated
@@ -36,6 +36,12 @@ export function typescript( | |||
'ts/unbound-method': 'error', | |||
} | |||
|
|||
const tsconfigPath = typeof tsc === 'string' && tsc.trim() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why trim
is needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty string check (or if spaces only)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const tsconfigPath = typeof tsc === 'string' && tsc.trim() | |
const tsconfigPath = typeof tsc === 'string' ? ( | |
tsc.trim() !== '' ? [tsc] : null | |
) : ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a change. I think that setting tsconfigPath: " "
should be a user error, and we shouldn't tolerant that implicitly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, thanks
just a habit to deal with user input - but here we have 'advanced' users
README.md
Outdated
@@ -328,6 +328,8 @@ import antfu from '@antfu/eslint-config' | |||
export default antfu({ | |||
typescript: { | |||
tsconfigPath: 'tsconfig.json', | |||
// or if you have multiple tsconfigs | |||
tsconfigPath: ['tsconfig.json', 'tsconfig.node.json'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copypasted code should "just work", so this line should be commented
It supports globs so I'd recommend adding "packages/*/tsconfig.json"
here to imply that
And possibly "tsconfig.eslint.json"
to imply you can make one especially for linting
Description
Multiple tsconfigs support
Linked Issues
close #305
Additional context