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 solution-style tsconfigs for more accurate type checking #40

Merged
merged 2 commits into from Jan 31, 2022

Conversation

sodatea
Copy link
Member

@sodatea sodatea commented Jan 28, 2022

No description provided.

if (needsCypress) {
render('tsconfig/cypress')
}
if (needsVitest) {
Copy link
Member Author

@sodatea sodatea Jan 28, 2022

Choose a reason for hiding this comment

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

Only the Vitest template needs an additional tsconfig, because it runs in Node.js with JSDOM, which is different than other files under src/.

Cypress Component Testing runs in an actual browser, and the Cypress type definitions will be brought in by import { mount } from '@cypress/vue', so there's no need for a standalone tsconfig.

"include": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"types": ["node", "jsdom"]
Copy link
Member Author

@sodatea sodatea Jan 28, 2022

Choose a reason for hiding this comment

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

I intentionally didn't include the Vitest types (which injects globals such as describe, it), because explicit is better than implicit.

@sodatea sodatea merged commit f1cdce3 into main Jan 31, 2022
8 of 10 checks passed
@sodatea sodatea deleted the feat-solution-style-tsconfig branch Jan 31, 2022
@DannyFeliz
Copy link

@DannyFeliz DannyFeliz commented Feb 3, 2022

Thank you for adding these comments explaining some decisions that were made

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

2 participants