eslint-plugin-hex-under 0.5.2 → 0.6.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/README.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
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
|
+
|
|
5
22
|
## hex-under
|
|
6
23
|
|
|
7
24
|
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.
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-hex-under",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"main": "src/eslint-plugin-hex-under.js",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"lint": "prettier . --check && eslint .",
|
|
7
|
-
"test": "
|
|
8
|
-
"test:
|
|
9
|
-
"
|
|
8
|
+
"test": "vitest run",
|
|
9
|
+
"test:watch": "vitest",
|
|
10
|
+
"coverage": "vitest run --coverage"
|
|
10
11
|
},
|
|
11
12
|
"repository": {
|
|
12
13
|
"type": "git",
|
|
@@ -17,8 +18,11 @@
|
|
|
17
18
|
"license": "MIT",
|
|
18
19
|
"description": "This ESLint rule proves that hex numbers are less than a specified value.",
|
|
19
20
|
"devDependencies": {
|
|
21
|
+
"@vitest/coverage-v8": "4.1.0",
|
|
20
22
|
"eslint": "10.0.3",
|
|
21
|
-
"prettier": "3.8.1"
|
|
23
|
+
"prettier": "3.8.1",
|
|
24
|
+
"tinyexec": "1.0.4",
|
|
25
|
+
"vitest": "4.1.0"
|
|
22
26
|
},
|
|
23
27
|
"peerDependencies": {
|
|
24
28
|
"eslint": "^10.0.0"
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import hexUnderRule from "./rules/hex-under.js";
|
|
2
|
+
import hexUnderBigintRule from "./rules/hex-under-bigint.js";
|
|
3
|
+
|
|
3
4
|
const plugin = {
|
|
4
5
|
rules: {
|
|
5
6
|
"hex-under": hexUnderRule,
|
|
6
7
|
"hex-under-bigint": hexUnderBigintRule,
|
|
7
8
|
},
|
|
8
9
|
};
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
export default plugin;
|
package/src/rules/hex-under.js
CHANGED