Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implemented eslint problem matcher #2027

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
7 changes: 4 additions & 3 deletions libs/language-server/workspace/src/lib/get-project-by-path.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { directoryExists } from '@nx-console/shared/file-system';
import type { ProjectConfiguration } from 'nx/src/devkit-exports';
import { isAbsolute, join, normalize, relative, sep } from 'path';
import { nxWorkspace } from './workspace';

import type { ProjectConfiguration } from 'nx/src/devkit-exports';
import { directoryExists } from '@nx-console/shared/file-system';
import { lspLogger } from '@nx-console/language-server/utils';
import { nxWorkspace } from './workspace';
import { platform } from 'os';

let _rootProjectMap: Record<string, ProjectConfiguration> | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,18 @@ export class NxProjectTreeProvider extends AbstractTreeProvider<NxTreeItem> {
flags.push('--skip-nx-cache');
}

let problemMatchers: string | string[] | undefined;
switch (target.name) {
case 'lint':
problemMatchers = ['$eslint-stylish'];
break;
}

CliTaskProvider.instance.executeTask({
command: 'run',
positional: `${project}:${target.name}`,
flags,
problemMatchers,
});
}

Expand Down
1 change: 1 addition & 0 deletions libs/vscode/tasks/src/lib/cli-task-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export interface CliTaskDefinition {
command: string;
flags: Array<string>;
cwd?: string;
problemMatchers?: string | string[] | undefined;
}
3 changes: 2 additions & 1 deletion libs/vscode/tasks/src/lib/cli-task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export class CliTask extends Task {
encapsulatedNx: isEncapsulatedNx,
},
packageManagerCommands
)
),
definition.problemMatchers
);

return task;
Expand Down