Skip to content

Commit b59e6b7

Browse files
feat(flawless): add no-floating-point-equality rule
1 parent d94313d commit b59e6b7

6 files changed

Lines changed: 15 additions & 7 deletions

File tree

pnpm-lock.yaml

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ catalogs:
9090
eslint-plugin-better-max-params: 1.0.0
9191
eslint-plugin-comment-length: 2.3.1
9292
eslint-plugin-de-morgan: 2.1.3
93-
eslint-plugin-flawless: 1.4.3
93+
eslint-plugin-flawless: 1.5.0
9494
eslint-plugin-format-lua: 2.0.0
9595
eslint-plugin-import-lite: 0.6.0
9696
eslint-plugin-jsdoc: 63.2.0

src/rules/flawless.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export function flawlessRules({
6161
{ max: 30, skipBlankLines: true, skipComments: true },
6262
],
6363
"flawless/no-export-default-arrow": "error",
64+
"flawless/no-floating-point-equality": "error",
6465
"flawless/prefer-parameter-destructuring": "warn",
6566

6667
...arrowStyleRules(arrowOptions),

src/rules/oxlint-mapping.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,7 @@ export const oxlintRuleMapping: Readonly<Record<string, OxlintTarget>> = {
612612
"flawless/max-lines-per-function": "js-plugin",
613613
"flawless/no-conditional-in-test": "js-plugin",
614614
"flawless/no-export-default-arrow": "js-plugin",
615+
"flawless/no-floating-point-equality": "js-plugin",
615616
"flawless/no-unnecessary-use-callback": "js-plugin",
616617
"flawless/no-unnecessary-use-memo": "js-plugin",
617618
"flawless/padding-after-expect-assertions": "js-plugin",

test/__snapshots__/eslint-snapshot.spec.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1383,6 +1383,7 @@ exports[`config snapshots > 'package' > should match the config snapshot 1`] = `
13831383
"flawless/arrow-return-style [{"jsxAlwaysUseExplicitReturn":true,"maxLen":100,"maxObjectProperties":2,"namedExportsAlwaysUseExplicitReturn":true,"objectReturnStyle":"complex-explicit","tabWidth":4,"useOxfmt":{"printWidth":100}}]",
13841384
"flawless/max-lines-per-function (warn) [{"max":30,"skipBlankLines":true,"skipComments":true}]",
13851385
"flawless/no-export-default-arrow",
1386+
"flawless/no-floating-point-equality",
13861387
"flawless/prefer-parameter-destructuring (warn)",
13871388
],
13881389
},
@@ -3907,6 +3908,7 @@ exports[`config snapshots > 'roblox-game' > should match the config snapshot 1`]
39073908
"flawless/arrow-return-style [{"jsxAlwaysUseExplicitReturn":true,"maxLen":100,"maxObjectProperties":2,"namedExportsAlwaysUseExplicitReturn":true,"objectReturnStyle":"complex-explicit","tabWidth":4,"useOxfmt":{"printWidth":100}}]",
39083909
"flawless/max-lines-per-function (warn) [{"max":30,"skipBlankLines":true,"skipComments":true}]",
39093910
"flawless/no-export-default-arrow",
3911+
"flawless/no-floating-point-equality",
39103912
"flawless/prefer-parameter-destructuring (warn)",
39113913
],
39123914
},
@@ -6361,6 +6363,7 @@ exports[`config snapshots > 'scoped-roblox' > should match the config snapshot 1
63616363
"flawless/arrow-return-style [{"jsxAlwaysUseExplicitReturn":true,"maxLen":100,"maxObjectProperties":2,"namedExportsAlwaysUseExplicitReturn":true,"objectReturnStyle":"complex-explicit","tabWidth":4,"useOxfmt":{"printWidth":100}}]",
63626364
"flawless/max-lines-per-function (warn) [{"max":30,"skipBlankLines":true,"skipComments":true}]",
63636365
"flawless/no-export-default-arrow",
6366+
"flawless/no-floating-point-equality",
63646367
"flawless/prefer-parameter-destructuring (warn)",
63656368
],
63666369
},

test/__snapshots__/oxlint.spec.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6392,6 +6392,7 @@ exports[`oxlint config snapshots > 'package' > should match the config snapshot
63926392
},
63936393
],
63946394
"flawless/no-export-default-arrow": "error",
6395+
"flawless/no-floating-point-equality": "error",
63956396
"flawless/prefer-parameter-destructuring": "warn",
63966397
},
63976398
},
@@ -10454,6 +10455,7 @@ exports[`oxlint config snapshots > 'roblox-game' > should match the config snaps
1045410455
},
1045510456
],
1045610457
"flawless/no-export-default-arrow": "error",
10458+
"flawless/no-floating-point-equality": "error",
1045710459
"flawless/prefer-parameter-destructuring": "warn",
1045810460
},
1045910461
},
@@ -16901,6 +16903,7 @@ exports[`oxlint config snapshots > 'scoped-roblox' > should match the config sna
1690116903
},
1690216904
],
1690316905
"flawless/no-export-default-arrow": "error",
16906+
"flawless/no-floating-point-equality": "error",
1690416907
"flawless/prefer-parameter-destructuring": "warn",
1690516908
},
1690616909
},

0 commit comments

Comments
 (0)