From 67be9fb091e39852b463fbabf9a66dccee08fdff Mon Sep 17 00:00:00 2001 From: Miroslav Jonas Date: Fri, 4 Aug 2023 11:48:28 +0200 Subject: [PATCH] fix(linter): fix messages on deps checks --- .../src/rules/dependency-checks.spec.ts | 14 +++++++------- .../eslint-plugin/src/rules/dependency-checks.ts | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/eslint-plugin/src/rules/dependency-checks.spec.ts b/packages/eslint-plugin/src/rules/dependency-checks.spec.ts index c0fa7ade83621..f1966332ed10b 100644 --- a/packages/eslint-plugin/src/rules/dependency-checks.spec.ts +++ b/packages/eslint-plugin/src/rules/dependency-checks.spec.ts @@ -446,7 +446,7 @@ describe('Dependency checks (eslint)', () => { ); expect(failures.length).toEqual(1); expect(failures[0].message).toMatchInlineSnapshot(` - "The "liba" uses the following packages, but they are missing from the "dependencies": + "The "liba" project uses the following packages, but they are missing from the "dependencies": - external2" `); expect(failures[0].line).toEqual(3); @@ -805,7 +805,7 @@ describe('Dependency checks (eslint)', () => { ); expect(failures.length).toEqual(1); expect(failures[0].message).toMatchInlineSnapshot( - `"The "unneeded" package is not used by "liba"."` + `"The "unneeded" package is not used by "liba" project."` ); expect(failures[0].line).toEqual(7); @@ -884,7 +884,7 @@ describe('Dependency checks (eslint)', () => { ); expect(failures.length).toEqual(1); expect(failures[0].message).toMatchInlineSnapshot( - `"The "unneeded" package is not used by "liba"."` + `"The "unneeded" package is not used by "liba" project."` ); expect(failures[0].line).toEqual(5); @@ -963,7 +963,7 @@ describe('Dependency checks (eslint)', () => { ); expect(failures.length).toEqual(1); expect(failures[0].message).toMatchInlineSnapshot( - `"The "unneeded" package is not used by "liba"."` + `"The "unneeded" package is not used by "liba" project."` ); expect(failures[0].line).toEqual(4); @@ -1042,7 +1042,7 @@ describe('Dependency checks (eslint)', () => { ); expect(failures.length).toEqual(1); expect(failures[0].message).toMatchInlineSnapshot( - `"The "unneeded" package is not used by "liba"."` + `"The "unneeded" package is not used by "liba" project."` ); // should apply fixer @@ -1462,7 +1462,7 @@ describe('Dependency checks (eslint)', () => { ); expect(failures.length).toEqual(1); expect(failures[0].message).toMatchInlineSnapshot(` - "The "liba" uses the following packages, but they are missing from the "dependencies": + "The "liba" project uses the following packages, but they are missing from the "dependencies": - tslib" `); expect(failures[0].line).toEqual(3); @@ -1525,7 +1525,7 @@ it('should require swc if @nx/js:swc executor', () => { ); expect(failures.length).toEqual(1); expect(failures[0].message).toMatchInlineSnapshot(` - "The "liba" uses the following packages, but they are missing from the "dependencies": + "The "liba" project uses the following packages, but they are missing from the "dependencies": - @swc/helpers" `); expect(failures[0].line).toEqual(3); diff --git a/packages/eslint-plugin/src/rules/dependency-checks.ts b/packages/eslint-plugin/src/rules/dependency-checks.ts index 2f5e799eda66c..8b2c7d59d0af0 100644 --- a/packages/eslint-plugin/src/rules/dependency-checks.ts +++ b/packages/eslint-plugin/src/rules/dependency-checks.ts @@ -57,8 +57,8 @@ export default createESLintRule({ }, ], messages: { - missingDependency: `The "{{projectName}}" uses the following packages, but they are missing from the "{{section}}":{{packageNames}}`, - obsoleteDependency: `The "{{packageName}}" package is not used by "{{projectName}}".`, + missingDependency: `The "{{projectName}}" project uses the following packages, but they are missing from the "{{section}}":{{packageNames}}`, + obsoleteDependency: `The "{{packageName}}" package is not used by "{{projectName}}" project.`, versionMismatch: `The version specifier does not contain the installed version of "{{packageName}}" package: {{version}}.`, missingDependencySection: `Dependency sections are missing from the "package.json" but following dependencies were detected:{{dependencies}}`, },