Skip to content

Commit 0e4f110

Browse files
committed
refactor(plugin-eslint): projects to config single project
Signed-off-by: Vojtech Masek <vojtech@flowup.cz>
1 parent 7181bda commit 0e4f110

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

packages/plugin-eslint/src/lib/nx.integration.test.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,10 @@ describe('Nx helpers', () => {
147147
async project => {
148148
const targets = await eslintConfigFromNxProject(project);
149149

150-
expect(targets).toEqual([
151-
{
152-
eslintrc: `./packages/${project}/.eslintrc.json`,
153-
patterns: expect.arrayContaining([`packages/${project}/**/*.ts`]),
154-
},
155-
]);
150+
expect(targets).toEqual({
151+
eslintrc: `./packages/${project}/.eslintrc.json`,
152+
patterns: expect.arrayContaining([`packages/${project}/**/*.ts`]),
153+
});
156154
},
157155
);
158156
});

packages/plugin-eslint/src/lib/nx/find-project-without-deps.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ export async function eslintConfigFromNxProject(
3232
const { createProjectGraphAsync } = await import('@nx/devkit');
3333
const projectGraph = await createProjectGraphAsync({ exitOnError: false });
3434

35-
const [project] = nxProjectsToConfig(
35+
const [project] = await nxProjectsToConfig(
3636
projectGraph,
37-
project => !!project.name && project.name === projectName,
37+
({ name }) => !!name && name === projectName,
3838
);
39-
39+
4040
if (!project) {
4141
throw new Error(`Couldn't find Nx project named "${projectName}"`);
4242
}
43+
4344
return project;
4445
}

0 commit comments

Comments
 (0)