Skip to content

Commit

Permalink
chore(misc): revert changes to error messaging
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Jun 3, 2024
1 parent 64dfce0 commit 9ae3b9a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 27 deletions.
40 changes: 20 additions & 20 deletions packages/eslint/src/plugins/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe('@nx/eslint/plugin', () => {
'package.json': `{}`,
'project.json': `{}`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -61,7 +61,7 @@ describe('@nx/eslint/plugin', () => {
'.eslintrc.json': `{}`,
'package.json': `{}`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -78,7 +78,7 @@ describe('@nx/eslint/plugin', () => {
'project.json': `{}`,
});
// NOTE: It should set ESLINT_USE_FLAT_CONFIG to true because of the use of eslint.config.js
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -94,7 +94,7 @@ describe('@nx/eslint/plugin', () => {
'src/index.ts': `console.log('hello world')`,
});
// NOTE: The command is specifically targeting the src directory in the case of a standalone Nx workspace
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('@nx/eslint/plugin', () => {
'lib/index.ts': `console.log('hello world')`,
});
// NOTE: The command is specifically targeting the src directory in the case of a standalone Nx workspace
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -177,7 +177,7 @@ describe('@nx/eslint/plugin', () => {
'src/index.ts': `console.log('hello world')`,
});
// NOTE: The command is specifically targeting the src directory in the case of a standalone Nx workspace
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -192,7 +192,7 @@ describe('@nx/eslint/plugin', () => {
'src/index.ts': `console.log('hello world')`,
});
// NOTE: The command is specifically targeting the src directory in the case of a standalone Nx workspace
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -207,7 +207,7 @@ describe('@nx/eslint/plugin', () => {
// This file is lintable so create the target
'apps/my-app/index.ts': `console.log('hello world')`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -248,7 +248,7 @@ describe('@nx/eslint/plugin', () => {
// This file is lintable so create the target
'apps/my-app/index.ts': `console.log('hello world')`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -293,7 +293,7 @@ describe('@nx/eslint/plugin', () => {
'apps/my-app/config-one.yaml': `...`,
'apps/my-app/config-two.yml': `...`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -312,7 +312,7 @@ describe('@nx/eslint/plugin', () => {
'apps/my-app/config-one.yaml': `...`,
'apps/my-app/config-two.yml': `...`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -327,7 +327,7 @@ describe('@nx/eslint/plugin', () => {
// This file is lintable so create the target
'apps/my-app/index.ts': `console.log('hello world')`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -342,7 +342,7 @@ describe('@nx/eslint/plugin', () => {
// This file is lintable so create the target
'apps/my-app/index.ts': `console.log('hello world')`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -361,7 +361,7 @@ describe('@nx/eslint/plugin', () => {
'libs/my-lib/project.json': `{}`,
'libs/my-lib/index.ts': `console.log('hello world')`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -431,7 +431,7 @@ describe('@nx/eslint/plugin', () => {
'libs/my-lib/project.json': `{}`,
'libs/my-lib/index.ts': `console.log('hello world')`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -448,7 +448,7 @@ describe('@nx/eslint/plugin', () => {
'libs/my-lib/project.json': `{}`,
'libs/my-lib/index.ts': `console.log('hello world')`,
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {},
Expand All @@ -470,7 +470,7 @@ describe('@nx/eslint/plugin', () => {
'libs/my-lib/index.ts': `console.log('hello world')`,
});
// NOTE: The nested projects have the root level config as an input to their lint targets
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -539,7 +539,7 @@ describe('@nx/eslint/plugin', () => {
'apps/myapp/index.ts': 'console.log("hello world")',
});
// NOTE: The nested projects have the root level config as an input to their lint targets
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -587,7 +587,7 @@ describe('@nx/eslint/plugin', () => {
'apps/myapp/nested/mylib/project.json': '{}',
'apps/myapp/nested/mylib/index.ts': 'console.log("hello world")',
});
expect(await invokeCreateNodesV2OnMatchingFiles(context, 'lint'))
expect(await invokeCreateNodesOnMatchingFiles(context, 'lint'))
.toMatchInlineSnapshot(`
{
"projects": {
Expand Down Expand Up @@ -634,7 +634,7 @@ describe('@nx/eslint/plugin', () => {
);
}

async function invokeCreateNodesV2OnMatchingFiles(
async function invokeCreateNodesOnMatchingFiles(
context: CreateNodesContextV2,
targetName: string
) {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface EslintPluginOptions {
}

const DEFAULT_EXTENSIONS = ['ts', 'tsx', 'js', 'jsx', 'html', 'vue'];
const ESLING_CONFIG_GLOB = combineGlobPatterns([
const ESLINT_CONFIG_GLOB = combineGlobPatterns([
...ESLINT_CONFIG_FILENAMES.map((f) => `**/${f}`),
baseEsLintConfigFile,
baseEsLintFlatConfigFile,
Expand Down
7 changes: 1 addition & 6 deletions packages/nx/src/project-graph/error-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,7 @@ export class AggregateCreateNodesError extends Error {
public readonly errors: Array<[file: string | null, error: Error]>,
public readonly partialResults: Awaited<ReturnType<CreateNodesFunctionV2>>
) {
super(
[
'Failed to create nodes',
...errors.map(([file, e]) => ` - ${file}: ${e.message}`),
].join()
);
super('Failed to create nodes');
this.name = this.constructor.name;
}
}
Expand Down

0 comments on commit 9ae3b9a

Please sign in to comment.