Fix duplicate case lint errors in rome
MODIFY
packages/@romejs/js-analysis/evaluators/modules/ExportLocalDeclaration.ts
packages/@romejs/js-analysis/evaluators/modules/ExportLocalDeclaration.ts
@@ -48,7 +48,6 @@ export default function ExportLocalDeclaration(
}
break;
- case 'TypeAliasTypeAnnotation':
case 'TypeAliasTypeAnnotation':
const type = scope.getBinding(decl.id.name);
if (type === undefined) {

MODIFY
packages/@romejs/js-ast-utils/isStatement.ts
packages/@romejs/js-ast-utils/isStatement.ts
@@ -48,7 +48,6 @@ export default function isStatement(
case 'FlowDeclareOpaqueType':
case 'FlowDeclareVariable':
case 'FlowInterfaceDeclaration':
- case 'TypeAliasTypeAnnotation':
case 'FlowOpaqueType':
case 'TypeAliasTypeAnnotation':
return true;

MODIFY
packages/@romejs/js-compiler/transforms/lint/noDuplicateCase.ts
packages/@romejs/js-compiler/transforms/lint/noDuplicateCase.ts
@@ -14,7 +14,7 @@ export default {
const {node, context} = path;
if (node.type === 'SwitchStatement') {
- let uniqueSwitchCases = new Set();
+ const uniqueSwitchCases = new Set();
for (const param of node.cases) {
if (param.test && param.test.type === 'StringLiteral') {
@@ -23,7 +23,7 @@ export default {
if (uniqueSwitchCases.has(test.value)) {
context.addNodeDiagnostic(param, {
category: 'lint/noDuplicateCase',
- message: `Duplicate case <emphasis>${test.value}</emphasis> not allowed`,
+ message: `Duplicate case <emphasis>${test.value}</emphasis> not allowed.`,
});
}

Fix duplicate case lint errors in rome