eslint-plugin-hex-under 0.6.0 → 0.6.1
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 +21 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,23 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Sometimes it's really hard for humans to read hexadecimal numbers and know the exact decimal value.
|
|
4
4
|
|
|
5
|
-
## Testing & Code Coverage
|
|
6
|
-
|
|
7
|
-
This project uses **Vitest** as its test runner with comprehensive code coverage tracking. All tests are written using Vitest's modern testing framework and ESLint's RuleTester for validating rule behavior.
|
|
8
|
-
|
|
9
|
-
### Running Tests
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
# Run all tests once
|
|
13
|
-
npm run test
|
|
14
|
-
|
|
15
|
-
# Run tests in watch mode (for development)
|
|
16
|
-
npm run test:watch
|
|
17
|
-
|
|
18
|
-
# Run tests with coverage report
|
|
19
|
-
npm run coverage
|
|
20
|
-
```
|
|
21
|
-
|
|
22
5
|
## hex-under
|
|
23
6
|
|
|
24
7
|
This ESLint plugin proves, if you use hexadecimal numbers in your code, that its value is less than or equal a specified value (default: 255). If you use a hexadecimal number greater than this specified value, it will be transformed to its decimal value.
|
|
@@ -63,9 +46,9 @@ npm install --save-dev eslint-plugin-hex-under
|
|
|
63
46
|
```js
|
|
64
47
|
// eslint.config.js
|
|
65
48
|
|
|
66
|
-
|
|
49
|
+
import eslintPluginHexUnder from "eslint-plugin-hex-under";
|
|
67
50
|
|
|
68
|
-
|
|
51
|
+
export default [
|
|
69
52
|
{
|
|
70
53
|
files: ["*.js"],
|
|
71
54
|
plugins: {
|
|
@@ -85,9 +68,9 @@ There is a similar rule to prove for BigInteger hexadecimal numbers. You can ena
|
|
|
85
68
|
```js
|
|
86
69
|
// eslint.config.js
|
|
87
70
|
|
|
88
|
-
|
|
71
|
+
import eslintPluginHexUnder from "eslint-plugin-hex-under";
|
|
89
72
|
|
|
90
|
-
|
|
73
|
+
export default = [
|
|
91
74
|
{
|
|
92
75
|
files: ["*.js"],
|
|
93
76
|
plugins: {
|
|
@@ -99,3 +82,20 @@ module.exports = [
|
|
|
99
82
|
},
|
|
100
83
|
];
|
|
101
84
|
```
|
|
85
|
+
|
|
86
|
+
## Testing & Code Coverage
|
|
87
|
+
|
|
88
|
+
This project uses **Vitest** as its test runner with comprehensive code coverage tracking. All tests are written using Vitest's modern testing framework and ESLint's RuleTester for validating rule behavior.
|
|
89
|
+
|
|
90
|
+
### Running Tests
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
# Run all tests once
|
|
94
|
+
npm run test
|
|
95
|
+
|
|
96
|
+
# Run tests in watch mode (for development)
|
|
97
|
+
npm run test:watch
|
|
98
|
+
|
|
99
|
+
# Run tests with coverage report
|
|
100
|
+
npm run coverage
|
|
101
|
+
```
|