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

fix(linter): fix messages on deps checks #18484

Merged
merged 1 commit into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions packages/eslint-plugin/src/rules/dependency-checks.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/dependency-checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export default createESLintRule<Options, MessageIds>({
},
],
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}}`,
},
Expand Down