eslint-plugin-hex-under 1.2.5 → 1.3.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/package.json
CHANGED
|
@@ -3,7 +3,7 @@ const BINARY_REGEX_BIGINT = /^0[bB][01_]+n$/;
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
meta: {
|
|
6
|
-
version: '0.
|
|
6
|
+
version: '0.3.0',
|
|
7
7
|
type: 'suggestion',
|
|
8
8
|
docs: {
|
|
9
9
|
description: 'Ensures binary numbers do not exceed a limit.',
|
|
@@ -47,6 +47,9 @@ export default {
|
|
|
47
47
|
const raw = node.raw;
|
|
48
48
|
|
|
49
49
|
const sourceCode = context.sourceCode;
|
|
50
|
+
if (sourceCode.lines[0] === '/* ignore-hex-under */') {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
50
53
|
const line = node.loc.end.line;
|
|
51
54
|
const ignore =
|
|
52
55
|
sourceCode.lines[line - 2]?.startsWith('// ignore-binary-under') ||
|
package/src/rules/hex-under.js
CHANGED
|
@@ -4,7 +4,7 @@ const HEX_REGEX_BIGINT = /^0[xX][0-9a-fA-F_]+n$/;
|
|
|
4
4
|
export default {
|
|
5
5
|
meta: {
|
|
6
6
|
type: 'suggestion',
|
|
7
|
-
version: '0.
|
|
7
|
+
version: '0.7.0',
|
|
8
8
|
defaultOptions: [
|
|
9
9
|
{
|
|
10
10
|
limit: 255,
|
|
@@ -48,6 +48,9 @@ export default {
|
|
|
48
48
|
const raw = node.raw;
|
|
49
49
|
|
|
50
50
|
const sourceCode = context.sourceCode;
|
|
51
|
+
if (sourceCode.lines[0] === '/* ignore-hex-under */') {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
51
54
|
const line = node.loc.end.line;
|
|
52
55
|
const ignore =
|
|
53
56
|
sourceCode.lines[line - 2]?.startsWith('// ignore-hex-under') ||
|
package/src/rules/octal-under.js
CHANGED
|
@@ -3,7 +3,7 @@ const OCTAL_REGEX_BIGINT = /^0[oO]?[0-7_]+n$/;
|
|
|
3
3
|
|
|
4
4
|
export default {
|
|
5
5
|
meta: {
|
|
6
|
-
version: '0.
|
|
6
|
+
version: '0.3.0',
|
|
7
7
|
type: 'suggestion',
|
|
8
8
|
docs: {
|
|
9
9
|
description: 'Ensures octal numbers do not exceed a limit.',
|
|
@@ -47,6 +47,9 @@ export default {
|
|
|
47
47
|
const raw = node.raw;
|
|
48
48
|
|
|
49
49
|
const sourceCode = context.sourceCode;
|
|
50
|
+
if (sourceCode.lines[0] === '/* ignore-hex-under */') {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
50
53
|
const line = node.loc.end.line;
|
|
51
54
|
const ignore =
|
|
52
55
|
sourceCode.lines[line - 2]?.startsWith('// ignore-octal-under') ||
|