eslint-plugin-hex-under 1.11.1 → 1.11.2

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.
Files changed (2) hide show
  1. package/README.md +20 -29
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -23,18 +23,18 @@ This can lead to:
23
23
 
24
24
  The plugin provides three independent rules:
25
25
 
26
- | Rule | Format | Default limit
27
- |---|---|---
28
- | hex-under/hex-under | Hexadecimal | 0xff (255)
29
- | hex-under/binary-under | Binary | 0b1111 (15)
30
- | hex-under/octal-under | Octal | 0o777 (511)
26
+ | Rule | Format | Default limit |
27
+ | ---------------------- | ----------- | ------------- |
28
+ | hex-under/hex-under | Hexadecimal | 0xff (255) |
29
+ | hex-under/binary-under | Binary | 0b1111 (15) |
30
+ | hex-under/octal-under | Octal | 0o777 (511) |
31
31
 
32
32
  The configured limit is inclusive.
33
33
 
34
34
  For example, with the default hexadecimal limit of 255:
35
35
 
36
36
  ```js
37
- const a = 0xff; // OK: 255
37
+ const a = 0xff; // OK: 255
38
38
  const b = 0x100; // Error: 256
39
39
  ```
40
40
 
@@ -60,18 +60,9 @@ export default [
60
60
  'hex-under': eslintPluginHexUnder,
61
61
  },
62
62
  rules: {
63
- 'hex-under/hex-under': [
64
- 'error',
65
- { limit: 255, checkBigInt: true },
66
- ],
67
- 'hex-under/octal-under': [
68
- 'error',
69
- { limit: 511, checkBigInt: true },
70
- ],
71
- 'hex-under/binary-under': [
72
- 'error',
73
- { limit: 15, checkBigInt: true },
74
- ],
63
+ 'hex-under/hex-under': ['error', { limit: 255, checkBigInt: true }],
64
+ 'hex-under/octal-under': ['error', { limit: 511, checkBigInt: true }],
65
+ 'hex-under/binary-under': ['error', { limit: 15, checkBigInt: true }],
75
66
  },
76
67
  },
77
68
  ];
@@ -186,7 +177,7 @@ BigInt literals can optionally be checked using the checkBigInt option.
186
177
  By default:
187
178
 
188
179
  ```js
189
- checkBigInt: true
180
+ checkBigInt: true;
190
181
  ```
191
182
 
192
183
  For example:
@@ -200,7 +191,7 @@ With checkBigInt: true, this literal is checked against the configured limit.
200
191
  If you don't want BigInt literals to be checked, set:
201
192
 
202
193
  ```js
203
- checkBigInt: false
194
+ checkBigInt: false;
204
195
  ```
205
196
 
206
197
  For example:
@@ -225,20 +216,20 @@ const mask = 0xdead_beefn;
225
216
 
226
217
  ## Rules
227
218
 
228
- | Rule | Description
229
- |---|---
230
- | hex-under/hex-under | Limits hexadecimal numeric literals
231
- | hex-under/binary-under | Limits binary numeric literals
232
- | hex-under/octal-under | Limits octal numeric literals
219
+ | Rule | Description |
220
+ | ---------------------- | ----------------------------------- |
221
+ | hex-under/hex-under | Limits hexadecimal numeric literals |
222
+ | hex-under/binary-under | Limits binary numeric literals |
223
+ | hex-under/octal-under | Limits octal numeric literals |
233
224
 
234
225
  Each rule can be configured independently.
235
226
 
236
227
  ## Options
237
228
 
238
- | Option | Type | Default | Description
239
- |---|---|---|---
240
- | limit | number | Format-specific | Maximum allowed numeric value
241
- |checkBigInt | boolean | true | Whether BigInt literals should be checked
229
+ | Option | Type | Default | Description |
230
+ | ----------- | ------- | --------------- | ----------------------------------------- |
231
+ | limit | number | Format-specific | Maximum allowed numeric value |
232
+ | checkBigInt | boolean | true | Whether BigInt literals should be checked |
242
233
 
243
234
  The limit is inclusive. A literal equal to the limit is valid; a literal greater than the limit is reported.
244
235
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
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.11.1",
5
+ "version": "1.11.2",
6
6
  "devDependencies": {
7
7
  "@eslint/js": "10.0.1",
8
8
  "@eslint/json": "2.1.0",