fix(nextjs): add eslint plugin dependencies in application and library generators (#30592)

This commit is contained in:
Nicholas Cunningham 2025-04-02 12:04:40 -06:00 committed by GitHub
parent 27b78cd7ae
commit 6e50a011e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View File

@ -99,6 +99,7 @@ export async function addLinting(
addDependenciesToPackageJson(host, extraEslintDependencies.dependencies, {
...extraEslintDependencies.devDependencies,
'eslint-config-next': eslintConfigNextVersion,
'@next/eslint-plugin-next': eslintConfigNextVersion,
})
);
}

View File

@ -93,6 +93,7 @@ export async function normalizeOptions(
projectName: appProjectName,
projectSimpleName: projectNames.projectSimpleName,
style: options.style || 'css',
swc: options.swc ?? true,
styledModule,
unitTestRunner: options.unitTestRunner || 'jest',
importPath,

View File

@ -60,6 +60,7 @@ export async function libraryGeneratorInternal(host: Tree, rawOptions: Schema) {
const devDependencies: Record<string, string> = {};
if (options.linter === 'eslint') {
devDependencies['eslint-config-next'] = eslintConfigNextVersion;
devDependencies['@next/eslint-plugin-next'] = eslintConfigNextVersion;
}
if (options.unitTestRunner && options.unitTestRunner !== 'none') {