eslint-plugin-hex-under 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/hex-under.js CHANGED
@@ -1,6 +1,12 @@
1
1
  module.exports = {
2
2
  meta: {
3
- type: "problem",
3
+ type: "suggestion",
4
+ version: "0.2.6",
5
+ defaultOptions: [
6
+ {
7
+ limit: 255,
8
+ },
9
+ ],
4
10
  docs: {
5
11
  description:
6
12
  "Proves that a hexadecimal number must be less than a specified value. Default is 255.",
@@ -26,7 +32,7 @@ module.exports = {
26
32
  },
27
33
  },
28
34
  create(context) {
29
- const limit = context.options[0]?.limit || 255;
35
+ const limit = context.options[0]?.limit;
30
36
  return {
31
37
  onCodePathEnd: function (_codePath, node) {
32
38
  const tokens =
package/hex-under.test.js CHANGED
@@ -11,6 +11,10 @@ ruleTester.run("hex-under", hexUnderRule, {
11
11
  options: [{ limit: 255 }],
12
12
  code: "const foo = 0xff;",
13
13
  },
14
+ {
15
+ options: [{ limit: 15 }],
16
+ code: "const foo = 0xf;",
17
+ },
14
18
  {
15
19
  options: [{ limit: 256 }],
16
20
  code: "const foo = 0x100;",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-hex-under",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "main": "eslint-plugin-hex-under.js",
5
5
  "scripts": {
6
6
  "lint": "prettier . --check && eslint .",