-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(js): ignore bundler config files correctly in eslint config when using vitest in js library generator #29649
Conversation
…using vitest in js library generator
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
View your CI Pipeline Execution ↗ for commit 40d9f53.
☁️ Nx Cloud last updated this comment at |
'{projectRoot}/vite.config.{js,ts,mjs,mts}' | ||
); | ||
o.rules['@nx/dependency-checks'] = [ruleSeverity, ruleOptions]; | ||
const ignoredFiles = new Set(ruleOptions.ignoredFiles ?? []); |
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.
Technically you could remove the else if
from 477 and achieve the same result.
if (options.bundler === "vite" || options.unitTestRunner === 'vitest') {
ignoredFiles.add("{projectRoot}/vite.config.{js,ts,mjs,mts}");
}
if (options.bundler === "rollup") {
ignoredFiles.add("{projectRoot}/rollup.config.{js,ts,mjs,mts,cjs,cts}");
} else if (options.bundler === "esbuild") {
ignoredFiles.add("{projectRoot}/esbuild.config.{js,ts,mjs,mts}");
}
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.
It works, but I don't think it reads as well because you already check for bundler === vite
first, so, there's no way it can be bundler === rollup
if that was the case. Checking for bundlers and unit test runners separately feels better to me.
…using vitest in js library generator (#29649) ## Current Behavior Generating a js library with esbuild or rollup as bundlers and vitest as the unit test runner, results in an eslint configuration where the bundler config file is not ignored from the `@nx/dependency-checks` rule. ## Expected Behavior Generating a js library with esbuild or rollup as bundlers and vitest as the unit test runner, should result in an eslint configuration where the bundler config file is ignored from the `@nx/dependency-checks` rule. ## Related Issue(s) Fixes # (cherry picked from commit 8a6e44b)
Current Behavior
Generating a js library with esbuild or rollup as bundlers and vitest as the unit test runner, results in an eslint configuration where the bundler config file is not ignored from the
@nx/dependency-checks
rule.Expected Behavior
Generating a js library with esbuild or rollup as bundlers and vitest as the unit test runner, should result in an eslint configuration where the bundler config file is ignored from the
@nx/dependency-checks
rule.Related Issue(s)
Fixes #