eslint-plugin-hex-under 0.11.0 → 0.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.
- package/package.json +1 -1
- package/src/rules/hex-under.js +4 -3
package/package.json
CHANGED
package/src/rules/hex-under.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
const HEX_REGEX = /^0[xX][0-9a-fA-F_]+$/;
|
|
2
|
+
const HEX_REGEX_BIGINT = /^0[xX][0-9a-fA-F_]+n$/;
|
|
3
|
+
|
|
1
4
|
export default {
|
|
2
5
|
meta: {
|
|
3
6
|
type: 'suggestion',
|
|
@@ -33,11 +36,9 @@ export default {
|
|
|
33
36
|
|
|
34
37
|
create(context) {
|
|
35
38
|
const [{ limit = 255 } = {}] = context.options;
|
|
36
|
-
const HEX_REGEX = /^0[xX][0-9a-fA-F_]+$/;
|
|
37
|
-
const HEX_REGEX_BIGINT = /^0[xX][0-9a-fA-F_]+n$/;
|
|
38
39
|
|
|
39
40
|
return {
|
|
40
|
-
Literal(node) {
|
|
41
|
+
'Literal[raw=/^0[xX]/]'(node) {
|
|
41
42
|
if (typeof node.value !== 'number' && typeof node.value !== 'bigint')
|
|
42
43
|
return;
|
|
43
44
|
if (typeof node.raw !== 'string') return;
|