Skip to content

Commit

Permalink
chore(eslint-plugin): [no-loss-of-precision] fix spelling of `isSepar…
Browse files Browse the repository at this point in the history
…atedNumeric` (#3390)
  • Loading branch information
tniessen committed May 15, 2021
1 parent c80b5f2 commit df7a0d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/eslint-plugin/src/rules/no-loss-of-precision.ts
Expand Up @@ -38,14 +38,14 @@ export default util.createRule<Options, MessageIds>({
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const rules = baseRule!.create(context);

function isSeperatedNumeric(node: TSESTree.Literal): boolean {
function isSeparatedNumeric(node: TSESTree.Literal): boolean {
return typeof node.value === 'number' && node.raw.includes('_');
}
return {
Literal(node: TSESTree.Literal): void {
rules.Literal({
...node,
raw: isSeperatedNumeric(node) ? node.raw.replace(/_/g, '') : node.raw,
raw: isSeparatedNumeric(node) ? node.raw.replace(/_/g, '') : node.raw,
} as never);
},
};
Expand Down

0 comments on commit df7a0d6

Please sign in to comment.