Skip to content

Commit a8fb3f2

Browse files
committed
chore: fix lint issues
1 parent 4576ad9 commit a8fb3f2

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

packages/apidom-ls/src/config/openapi/tag/documentation.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,16 @@ import { OpenAPI2, OpenAPI30, OpenAPI31, OpenAPI3 } from '../target-specs.ts';
1313
const documentation = [
1414
{ target: 'name', docs: '**Required.** The name of the tag.', targetSpecs: OpenAPI2 },
1515
{ target: 'name', docs: '**REQUIRED**. The name of the tag.', targetSpecs: OpenAPI3 },
16-
{ target: 'name', docs: 'Tag Objects must have unique `name` field values.', targetSpecs: OpenAPI3 },
17-
{ target: 'name', docs: 'Tag Objects must have unique `name` field values.', targetSpecs: OpenAPI2 },
16+
{
17+
target: 'name',
18+
docs: 'Tag Objects must have unique `name` field values.',
19+
targetSpecs: OpenAPI3,
20+
},
21+
{
22+
target: 'name',
23+
docs: 'Tag Objects must have unique `name` field values.',
24+
targetSpecs: OpenAPI2,
25+
},
1826
{
1927
target: 'description',
2028
docs: 'A short description for the tag. [GFM syntax](https://guides.github.com/features/mastering-markdown/#GitHub-flavored-markdown) can be used for rich text representation.',

packages/apidom-ls/src/config/openapi/tag/lint/name--unique.ts

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ import { LinterMeta } from '../../../../apidom-language-types.ts';
55
import { OpenAPI2, OpenAPI3 } from '../../target-specs.ts';
66

77
const nameUniqueLint: LinterMeta = {
8-
code: ApilintCodes.OPENAPI2_TAG_FIELD_UNIQUE_NAME_VALUE_TYPE,
9-
source: 'apilint',
10-
message: "Tag Objects must have unique `name` field values.",
11-
severity: DiagnosticSeverity.Error,
12-
linterFunction: 'apilintPropertyUniqueSiblingValue',
13-
linterParams: ['tags', 'name'],
14-
marker: 'value',
8+
code: ApilintCodes.OPENAPI2_TAG_FIELD_UNIQUE_NAME_VALUE_TYPE,
9+
source: 'apilint',
10+
message: 'Tag Objects must have unique `name` field values.',
11+
severity: DiagnosticSeverity.Error,
12+
linterFunction: 'apilintPropertyUniqueSiblingValue',
13+
linterParams: ['tags', 'name'],
14+
marker: 'value',
1515
target: 'name',
1616
markerTarget: 'name',
17-
data: {},
18-
targetSpecs: [...OpenAPI2, ...OpenAPI3],
17+
data: {},
18+
targetSpecs: [...OpenAPI2, ...OpenAPI3],
1919
};
2020

2121
export default nameUniqueLint;
22-

packages/apidom-ls/test/validate.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3791,9 +3791,7 @@ describe('apidom-ls-validate', function () {
37913791

37923792
it('oas - tags name should have unique values', async function () {
37933793
const spec = fs
3794-
.readFileSync(
3795-
path.join(__dirname, 'fixtures', 'validation', 'oas', 'tags-unique-name.yaml'),
3796-
)
3794+
.readFileSync(path.join(__dirname, 'fixtures', 'validation', 'oas', 'tags-unique-name.yaml'))
37973795
.toString();
37983796
const doc: TextDocument = TextDocument.create(
37993797
'foo://bar/tags-unique-name.yaml',
@@ -3804,7 +3802,7 @@ describe('apidom-ls-validate', function () {
38043802
const languageService: LanguageService = getLanguageService(contextNoSchema);
38053803

38063804
const result = await languageService.doValidation(doc);
3807-
const expected: Diagnostic[] = [
3805+
const expected: Diagnostic[] = [
38083806
{
38093807
message: 'Tag Objects must have unique `name` field values.',
38103808
severity: 1,
@@ -3825,5 +3823,5 @@ describe('apidom-ls-validate', function () {
38253823
assert.deepEqual(result, expected);
38263824

38273825
languageService.terminate();
3828-
})
3826+
});
38293827
});

0 commit comments

Comments
 (0)