File tree 3 files changed +6
-7
lines changed
packages/plugin-eslint/src/lib/nx
3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
- import { createProjectGraphAsync } from '@nx/devkit' ;
2
1
import type { ESLintPluginConfig } from '../config' ;
3
2
import { nxProjectsToConfig } from './projects-to-config' ;
4
3
@@ -24,6 +23,7 @@ import { nxProjectsToConfig } from './projects-to-config';
24
23
* @returns ESLint config and patterns, intended to be passed to {@link eslintPlugin}
25
24
*/
26
25
export async function eslintConfigFromNxProjects ( ) : Promise < ESLintPluginConfig > {
26
+ const { createProjectGraphAsync } = await import ( '@nx/devkit' ) ;
27
27
const projectGraph = await createProjectGraphAsync ( { exitOnError : false } ) ;
28
28
return nxProjectsToConfig ( projectGraph ) ;
29
29
}
Original file line number Diff line number Diff line change 1
- import { createProjectGraphAsync } from '@nx/devkit' ;
2
1
import type { ESLintPluginConfig } from '../config' ;
3
2
import { nxProjectsToConfig } from './projects-to-config' ;
4
3
import { findAllDependencies } from './traverse-graph' ;
@@ -30,6 +29,7 @@ import { findAllDependencies } from './traverse-graph';
30
29
export async function eslintConfigFromNxProject (
31
30
projectName : string ,
32
31
) : Promise < ESLintPluginConfig > {
32
+ const { createProjectGraphAsync } = await import ( '@nx/devkit' ) ;
33
33
const projectGraph = await createProjectGraphAsync ( { exitOnError : false } ) ;
34
34
35
35
const dependencies = findAllDependencies ( projectName , projectGraph ) ;
Original file line number Diff line number Diff line change 1
- import {
2
- ProjectConfiguration ,
3
- ProjectGraph ,
4
- readProjectsConfigurationFromProjectGraph ,
5
- } from '@nx/devkit' ;
1
+ import type { ProjectConfiguration , ProjectGraph } from '@nx/devkit' ;
6
2
import type { ESLint } from 'eslint' ;
7
3
import type { ESLintPluginConfig } from '../config' ;
8
4
import {
@@ -16,6 +12,9 @@ export async function nxProjectsToConfig(
16
12
predicate : ( project : ProjectConfiguration ) => boolean = ( ) => true ,
17
13
) : Promise < ESLintPluginConfig > {
18
14
// find Nx projects with lint target
15
+ const { readProjectsConfigurationFromProjectGraph } = await import (
16
+ '@nx/devkit'
17
+ ) ;
19
18
const projectsConfiguration =
20
19
readProjectsConfigurationFromProjectGraph ( projectGraph ) ;
21
20
const projects = Object . values ( projectsConfiguration . projects )
You can’t perform that action at this time.
0 commit comments