Skip to content

Commit

Permalink
fix(misc): add back rootProject to e2e project for root project
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Sep 6, 2024
1 parent 20cf46e commit f38db75
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/cypress/src/utils/add-linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export async function addLinterToCyProject(
tsConfigPaths: [joinPathFragments(projectConfig.root, 'tsconfig.json')],
setParserOptionsProject: options.setParserOptionsProject,
skipPackageJson: options.skipPackageJson,
rootProject: options.rootProject,
addPlugin: options.addPlugin,
})
);
Expand Down Expand Up @@ -98,8 +99,10 @@ export async function addLinterToCyProject(
'recommended',
'cypress',
'eslint-plugin-cypress/flat',
false,
false
);
addOverrideToLintConfig(tree, projectConfig.root, { rules: {} });
} else {
if (options.rootProject) {
addPluginsToLintConfig(tree, projectConfig.root, '@nx');
Expand Down
6 changes: 4 additions & 2 deletions packages/eslint/src/generators/utils/eslint-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,8 @@ export function addPredefinedConfigToFlatLintConfig(
predefinedConfigName: string,
moduleName = 'nx',
moduleImportPath = '@nx/eslint-plugin',
spread = true
spread = true,
insertAtTheEnd = true
): void {
if (!useFlatConfig(tree))
throw new Error('Predefined configs can only be used with flat configs');
Expand All @@ -435,7 +436,8 @@ export function addPredefinedConfigToFlatLintConfig(
content = addImportToFlatConfig(content, moduleName, moduleImportPath);
content = addBlockToFlatConfigExport(
content,
generateFlatPredefinedConfig(predefinedConfigName, moduleName, spread)
generateFlatPredefinedConfig(predefinedConfigName, moduleName, spread),
{ insertAtTheEnd }
);

tree.write(fileName, content);
Expand Down
3 changes: 3 additions & 0 deletions packages/playwright/src/utils/add-linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export async function addLinterToPlaywrightProject(
tsConfigPaths: [joinPathFragments(projectConfig.root, 'tsconfig.json')],
setParserOptionsProject: options.setParserOptionsProject,
skipPackageJson: options.skipPackageJson,
rootProject: options.rootProject,
addPlugin: options.addPlugin,
})
);
Expand Down Expand Up @@ -84,8 +85,10 @@ export async function addLinterToPlaywrightProject(
'flat/recommended',
'playwright',
'eslint-plugin-playwright',
false,
false
);
addOverrideToLintConfig(tree, projectConfig.root, { rules: {} });
} else {
const addExtendsTask = addExtendsToLintConfig(
tree,
Expand Down

0 comments on commit f38db75

Please sign in to comment.