eslint-plugin-hex-under 1.2.1 → 1.2.3
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/package.json +2 -1
- package/src/rules/binary-under.js +17 -3
- package/src/rules/hex-under.js +3 -0
- package/src/rules/octal-under.js +17 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-hex-under",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/eslint-plugin-hex-under.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"@vitest/eslint-plugin": "1.6.12",
|
|
32
32
|
"bats": "1.13.0",
|
|
33
33
|
"eslint": "10.0.3",
|
|
34
|
+
"eslint-plugin-eslint-plugin": "7.3.2",
|
|
34
35
|
"prettier": "3.8.1",
|
|
35
36
|
"tinyexec": "1.0.4",
|
|
36
37
|
"vitest": "4.1.0"
|
|
@@ -3,20 +3,34 @@ const BINARY_REGEX_BIGINT = /^0[bB][01_]+n$/;
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
meta: {
|
|
6
|
-
version: '0.1.
|
|
6
|
+
version: '0.1.1',
|
|
7
7
|
type: 'suggestion',
|
|
8
8
|
docs: {
|
|
9
9
|
description: 'Ensures binary numbers do not exceed a limit.',
|
|
10
10
|
recommended: false,
|
|
11
11
|
},
|
|
12
|
+
defaultOptions: [
|
|
13
|
+
{
|
|
14
|
+
limit: 15,
|
|
15
|
+
skipBigInt: false,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
12
18
|
fixable: 'code',
|
|
13
19
|
schema: [
|
|
14
20
|
{
|
|
15
21
|
type: 'object',
|
|
16
22
|
properties: {
|
|
17
|
-
limit: {
|
|
18
|
-
|
|
23
|
+
limit: {
|
|
24
|
+
type: 'integer',
|
|
25
|
+
minimum: 0,
|
|
26
|
+
description: 'The maximum allowed value for binary literals.',
|
|
27
|
+
},
|
|
28
|
+
skipBigInt: {
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
description: 'Whether to skip BigInt literals.',
|
|
31
|
+
},
|
|
19
32
|
},
|
|
33
|
+
description: 'Options for binary-under rule',
|
|
20
34
|
additionalProperties: false,
|
|
21
35
|
},
|
|
22
36
|
],
|
package/src/rules/hex-under.js
CHANGED
|
@@ -24,11 +24,14 @@ export default {
|
|
|
24
24
|
limit: {
|
|
25
25
|
type: 'integer',
|
|
26
26
|
minimum: 0,
|
|
27
|
+
description: 'The maximum allowed value for hexadecimal literals.',
|
|
27
28
|
},
|
|
28
29
|
skipBigInt: {
|
|
29
30
|
type: 'boolean',
|
|
31
|
+
description: 'Whether to skip BigInt literals.',
|
|
30
32
|
},
|
|
31
33
|
},
|
|
34
|
+
description: 'Options for hex-under rule',
|
|
32
35
|
additionalProperties: false,
|
|
33
36
|
},
|
|
34
37
|
],
|
package/src/rules/octal-under.js
CHANGED
|
@@ -3,20 +3,34 @@ const OCTAL_REGEX_BIGINT = /^0[oO]?[0-7_]+n$/;
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
meta: {
|
|
6
|
-
version: '0.1.
|
|
6
|
+
version: '0.1.1',
|
|
7
7
|
type: 'suggestion',
|
|
8
8
|
docs: {
|
|
9
9
|
description: 'Ensures octal numbers do not exceed a limit.',
|
|
10
10
|
recommended: false,
|
|
11
11
|
},
|
|
12
|
+
defaultOptions: [
|
|
13
|
+
{
|
|
14
|
+
limit: 511,
|
|
15
|
+
skipBigInt: false,
|
|
16
|
+
},
|
|
17
|
+
],
|
|
12
18
|
fixable: 'code',
|
|
13
19
|
schema: [
|
|
14
20
|
{
|
|
15
21
|
type: 'object',
|
|
16
22
|
properties: {
|
|
17
|
-
limit: {
|
|
18
|
-
|
|
23
|
+
limit: {
|
|
24
|
+
type: 'integer',
|
|
25
|
+
minimum: 0,
|
|
26
|
+
description: 'The maximum allowed value for octal literals.',
|
|
27
|
+
},
|
|
28
|
+
skipBigInt: {
|
|
29
|
+
type: 'boolean',
|
|
30
|
+
description: 'Whether to skip BigInt literals.',
|
|
31
|
+
},
|
|
19
32
|
},
|
|
33
|
+
description: 'Options for octal-under rule',
|
|
20
34
|
additionalProperties: false,
|
|
21
35
|
},
|
|
22
36
|
],
|