Skip to content

Commit

Permalink
chore(core): try and fix failing e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry authored and AgentEnder committed Feb 29, 2024
1 parent 98125cf commit 2f3127c
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/eslint/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,24 @@ function getProjectsUsingRootESLintConfig(
context: CreateNodesContext
): CreateNodesResult['projects'] {
const projects: CreateNodesResult['projects'] = {};
const workspaceFiles = context.workspaceFiles ?? [];

// If there's no src folder, it's not a standalone project, so a project.json would be explicitly required to add the root to the mapping
const isStandaloneWorkspace =
context.workspaceFiles.some((f) => f.startsWith('src')) &&
context.workspaceFiles.includes('package.json');
workspaceFiles.some((f) => f.startsWith('src')) &&
workspaceFiles.includes('package.json');
if (isStandaloneWorkspace) {
projects['.'] = {
targets: buildEslintTargets([configFilePath], '.', options, true),
};
} else if (context.workspaceFiles.includes('project.json')) {
} else if (workspaceFiles.includes('project.json')) {
projects['.'] = {
targets: buildEslintTargets([configFilePath], '.', options),
};
}

// Some nested projects may require a lint target based on this root level config as well (in the case they don't have their own)
const childProjectRoots = context.workspaceFiles
const childProjectRoots = workspaceFiles
.filter(
(f) =>
f.includes('/') &&
Expand All @@ -81,9 +82,7 @@ function getProjectsUsingRootESLintConfig(
const childProjectsWithoutEslintConfig = childProjectRoots.filter(
(childProjectRoot) =>
!ESLINT_CONFIG_FILENAMES.some((eslintConfigFile) =>
context.workspaceFiles.includes(
join(childProjectRoot, eslintConfigFile)
)
workspaceFiles.includes(join(childProjectRoot, eslintConfigFile))
)
);

Expand Down

0 comments on commit 2f3127c

Please sign in to comment.