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 LINT3024 and LINT3025 case sensitivity bug #129

Merged
merged 2 commits into from
Aug 23, 2024
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
6 changes: 4 additions & 2 deletions src/plugins/codeStyle/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,8 @@ describe('codeStyle', () => {
} as any);
const actual = fmtDiagnostics(diagnostics);
const expected = [
`06:LINT3024:Avoid using field type 'assocarray'`
`06:LINT3024:Avoid using field type 'assocarray'`,
`07:LINT3024:Avoid using field type 'assocarray'`
];
expect(actual).deep.equal(expected);
});
Expand All @@ -561,7 +562,8 @@ describe('codeStyle', () => {
} as any);
const actual = fmtDiagnostics(diagnostics);
const expected = [
`04:LINT3025:Avoid using field type 'array'`
`04:LINT3025:Avoid using field type 'array'`,
`08:LINT3025:Avoid using field type 'array'`
];
expect(actual).deep.equal(expected);
});
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/codeStyle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class CodeStyle {
if (tag.text === 'field') {
const typeAttribute = attributes.find(({ key }) => key.text === 'type');

const typeValue = typeAttribute?.value.text;
const typeValue = typeAttribute?.value.text?.toLowerCase();
if (typeValue === 'array' && validateArrayComponentFieldType) {
diagnostics.push(
messages.noArrayFieldType(
Expand Down
2 changes: 2 additions & 0 deletions test/project1/components/interfaceTest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
<field id="test" type="array" />
<field id="test2" type="node" />
<field id="test3" type="assocarray" />
<field id="test3" type="assocArray" />
<field id="test" type="arRay" />
</interface>
</component>