eslint-plugin-hex-under 1.10.0 → 1.11.0

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/README.md CHANGED
@@ -109,7 +109,7 @@ const octalTooBig = 0o777777;
109
109
  #### Ignore Bigint values
110
110
 
111
111
  ```js
112
- // valid with { limit: 255, ignoreBigInt: true }
112
+ // valid with { limit: 255, checkBigInt: false }
113
113
  const mask = 0xdead_beefn;
114
114
  ```
115
115
 
@@ -133,9 +133,9 @@ export default [
133
133
  'hex-under': eslintPluginHexUnder,
134
134
  },
135
135
  rules: {
136
- 'hex-under/hex-under': ['error', { limit: 255, ignoreBigInt: false }],
137
- 'hex-under/octal-under': ['error', { limit: 511, ignoreBigInt: false }],
138
- 'hex-under/binary-under': ['error', { limit: 15, ignoreBigInt: false }],
136
+ 'hex-under/hex-under': ['error', { limit: 255, checkBigInt: true }],
137
+ 'hex-under/octal-under': ['error', { limit: 511, checkBigInt: true }],
138
+ 'hex-under/binary-under': ['error', { limit: 15, checkBigInt: true }],
139
139
  },
140
140
  },
141
141
  ];
@@ -151,10 +151,10 @@ export default [
151
151
 
152
152
  ## Configuration
153
153
 
154
- | Option | Type | Default | Description |
155
- | ------------ | ------- | --------------- | --------------------- |
156
- | `limit` | number | format-specific | Maximum allowed value |
157
- | `ignoreBigInt` | boolean | false | Ignore BigInt values |
154
+ | Option | Type | Default | Description |
155
+ | ------------- | ------- | --------------- | --------------------- |
156
+ | `limit` | number | format-specific | Maximum allowed value |
157
+ | `checkBigInt` | boolean | true | Check BigInt values |
158
158
 
159
159
  ## Testing & Code Coverage
160
160
 
package/package.json CHANGED
@@ -2,21 +2,22 @@
2
2
  "author": "0xflotus",
3
3
  "description": "This ESLint rule proves that hex numbers are less than a specified value.",
4
4
  "type": "module",
5
- "version": "1.10.0",
5
+ "version": "1.11.0",
6
6
  "devDependencies": {
7
7
  "@eslint/js": "10.0.1",
8
- "@eslint/json": "1.2.0",
9
- "@vitest/coverage-istanbul": "4.1.7",
10
- "@vitest/eslint-plugin": "1.6.18",
8
+ "@eslint/json": "2.1.0",
9
+ "@vitest/coverage-istanbul": "4.1.11",
10
+ "@vitest/eslint-plugin": "1.6.27",
11
11
  "bats": "1.13.0",
12
- "eslint": "10.4.0",
13
- "eslint-plugin-eslint-plugin": "7.3.3",
12
+ "eslint": "10.9.1",
13
+ "eslint-plugin-eslint-plugin": "7.6.2",
14
14
  "eslint-vitest-rule-tester": "3.1.0",
15
- "prettier": "3.8.3",
16
- "vitest": "4.1.7"
15
+ "prettier": "3.9.6",
16
+ "vitest": "4.1.11"
17
17
  },
18
18
  "engines": {
19
- "node": ">=22"
19
+ "node": ">=24",
20
+ "npm": ">=11"
20
21
  },
21
22
  "files": [
22
23
  "src/",
@@ -13,16 +13,16 @@ const plugin = {
13
13
  export const configs = {
14
14
  recommended: {
15
15
  rules: {
16
- 'hex-under/hex-under': ['warn', { limit: 255, ignoreBigInt: false }],
17
- 'hex-under/octal-under': ['warn', { limit: 511, ignoreBigInt: false }],
18
- 'hex-under/binary-under': ['warn', { limit: 255, ignoreBigInt: false }],
16
+ 'hex-under/hex-under': ['warn', { limit: 255, checkBigInt: true }],
17
+ 'hex-under/octal-under': ['warn', { limit: 511, checkBigInt: true }],
18
+ 'hex-under/binary-under': ['warn', { limit: 255, checkBigInt: true }],
19
19
  },
20
20
  },
21
21
  all: {
22
22
  rules: {
23
- 'hex-under/hex-under': ['error', { limit: 255, ignoreBigInt: false }],
24
- 'hex-under/octal-under': ['error', { limit: 511, ignoreBigInt: false }],
25
- 'hex-under/binary-under': ['error', { limit: 15, ignoreBigInt: false }],
23
+ 'hex-under/hex-under': ['error', { limit: 255, checkBigInt: true }],
24
+ 'hex-under/octal-under': ['error', { limit: 511, checkBigInt: true }],
25
+ 'hex-under/binary-under': ['error', { limit: 15, checkBigInt: true }],
26
26
  },
27
27
  },
28
28
  };
@@ -11,7 +11,7 @@ export default {
11
11
  defaultOptions: [
12
12
  {
13
13
  limit: 15,
14
- ignoreBigInt: false,
14
+ checkBigInt: true,
15
15
  },
16
16
  ],
17
17
  fixable: 'code',
@@ -24,9 +24,9 @@ export default {
24
24
  minimum: 0,
25
25
  description: 'The maximum allowed value for binary literals.',
26
26
  },
27
- ignoreBigInt: {
27
+ checkBigInt: {
28
28
  type: 'boolean',
29
- description: 'Whether to skip BigInt literals.',
29
+ description: 'Whether to check BigInt literals.',
30
30
  },
31
31
  },
32
32
  description: 'Options for binary-under rule',
@@ -40,7 +40,7 @@ export default {
40
40
  },
41
41
 
42
42
  create(context) {
43
- const [{ limit = 15, ignoreBigInt = false } = {}] = context.options;
43
+ const [{ limit = 15, checkBigInt = true } = {}] = context.options;
44
44
  return {
45
45
  'Literal[raw=/^0[bB][01_]+n?$/]'(node) {
46
46
  const raw = node.raw;
@@ -48,7 +48,7 @@ export default {
48
48
  const isBigInt = BINARY_REGEX_BIGINT.test(raw);
49
49
  const isBinary = BINARY_REGEX.test(raw);
50
50
 
51
- if (ignoreBigInt && isBigInt) return;
51
+ if (!checkBigInt && isBigInt) return;
52
52
 
53
53
  const normalized = raw.replace(/_/g, '').replace(/n$/, '');
54
54
  let value = null;
@@ -6,7 +6,7 @@ export default {
6
6
  defaultOptions: [
7
7
  {
8
8
  limit: 255,
9
- ignoreBigInt: false,
9
+ checkBigInt: true,
10
10
  },
11
11
  ],
12
12
  languages: ['js/js'],
@@ -25,9 +25,9 @@ export default {
25
25
  minimum: 0,
26
26
  description: 'The maximum allowed value for hexadecimal literals.',
27
27
  },
28
- ignoreBigInt: {
28
+ checkBigInt: {
29
29
  type: 'boolean',
30
- description: 'Whether to skip BigInt literals.',
30
+ description: 'Whether to check BigInt literals.',
31
31
  },
32
32
  },
33
33
  description: 'Options for hex-under rule',
@@ -41,7 +41,7 @@ export default {
41
41
  },
42
42
 
43
43
  create(context) {
44
- const [{ limit = 255, ignoreBigInt = false } = {}] = context.options;
44
+ const [{ limit = 255, checkBigInt = true } = {}] = context.options;
45
45
  return {
46
46
  'Literal[raw=/^0[xX][0-9a-fA-F_]+n?$/]'(node) {
47
47
  const raw = node.raw;
@@ -49,7 +49,7 @@ export default {
49
49
  const isHexBigInt = HEX_REGEX_BIGINT.test(raw);
50
50
  const isHex = HEX_REGEX.test(raw);
51
51
 
52
- if (ignoreBigInt && isHexBigInt) return;
52
+ if (!checkBigInt && isHexBigInt) return;
53
53
 
54
54
  const normalized = raw.replace(/_/g, '').replace(/n$/, '');
55
55
  let value = null;
@@ -11,7 +11,7 @@ export default {
11
11
  defaultOptions: [
12
12
  {
13
13
  limit: 511,
14
- ignoreBigInt: false,
14
+ checkBigInt: true,
15
15
  },
16
16
  ],
17
17
  fixable: 'code',
@@ -24,9 +24,9 @@ export default {
24
24
  minimum: 0,
25
25
  description: 'The maximum allowed value for octal literals.',
26
26
  },
27
- ignoreBigInt: {
27
+ checkBigInt: {
28
28
  type: 'boolean',
29
- description: 'Whether to skip BigInt literals.',
29
+ description: 'Whether to check BigInt literals.',
30
30
  },
31
31
  },
32
32
  description: 'Options for octal-under rule',
@@ -40,7 +40,7 @@ export default {
40
40
  },
41
41
 
42
42
  create(context) {
43
- const [{ limit = 511, ignoreBigInt = false } = {}] = context.options;
43
+ const [{ limit = 511, checkBigInt = true } = {}] = context.options;
44
44
  return {
45
45
  'Literal[raw=/^0[oO]?[0-7_]+n?$/]'(node) {
46
46
  const raw = node.raw;
@@ -56,7 +56,7 @@ export default {
56
56
  const isBigInt = OCTAL_REGEX_BIGINT.test(raw);
57
57
  const isOctal = OCTAL_REGEX.test(raw);
58
58
 
59
- if (ignoreBigInt && isBigInt) return;
59
+ if (!checkBigInt && isBigInt) return;
60
60
 
61
61
  const normalized = raw.replace(/_/g, '').replace(/n$/, '');
62
62
  let value = null;