diff --git a/src/rules/no-phyisical-properties/rule.ts b/src/rules/no-phyisical-properties/rule.ts index de45f99..01c77c9 100644 --- a/src/rules/no-phyisical-properties/rule.ts +++ b/src/rules/no-phyisical-properties/rule.ts @@ -107,7 +107,7 @@ function report({ node: TSESTree.JSXAttribute; invalid: string; valid: string; - token: Token | null; + token: Token; }) { return ctx.report({ node, @@ -117,12 +117,10 @@ function report({ valid, }, loc: { - start: token?.loc?.start ?? node.loc!.start, - end: token?.loc?.end ?? node.loc!.end, + start: token?.loc?.start, + end: token?.loc?.end, }, fix: (fixer) => { - if (!token) return null; - return fixer.replaceText(token, token?.getRaw()?.replace(invalid, valid)); }, }); diff --git a/src/rules/no-phyisical-properties/test.ts b/src/rules/no-phyisical-properties/test.ts index 7c094e8..5e84493 100644 --- a/src/rules/no-phyisical-properties/test.ts +++ b/src/rules/no-phyisical-properties/test.ts @@ -57,7 +57,7 @@ vitest.describe(RULE_NAME, () => { }, { name: "JSXNamespacedName", - code: ``, + code: ``, }, ], invalid: [ diff --git a/src/utils/ast.ts b/src/utils/ast.ts index a1d18cf..465360b 100644 --- a/src/utils/ast.ts +++ b/src/utils/ast.ts @@ -5,7 +5,7 @@ import { NO_PHYSICAL_CLASSESS, type Context, type MessageId, -} from "../rules/no-phyisical-properties/rule"; +} from "../rules/no-phyisical-properties/rule.js"; const unimplemented = new Set();