eslint-plugin-hex-under 0.5.2 → 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
CHANGED
|
@@ -46,9 +46,9 @@ npm install --save-dev eslint-plugin-hex-under
|
|
|
46
46
|
```js
|
|
47
47
|
// eslint.config.js
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
import eslintPluginHexUnder from "eslint-plugin-hex-under";
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
export default [
|
|
52
52
|
{
|
|
53
53
|
files: ["*.js"],
|
|
54
54
|
plugins: {
|
|
@@ -68,9 +68,9 @@ There is a similar rule to prove for BigInteger hexadecimal numbers. You can ena
|
|
|
68
68
|
```js
|
|
69
69
|
// eslint.config.js
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
import eslintPluginHexUnder from "eslint-plugin-hex-under";
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
export default = [
|
|
74
74
|
{
|
|
75
75
|
files: ["*.js"],
|
|
76
76
|
plugins: {
|
|
@@ -82,3 +82,20 @@ module.exports = [
|
|
|
82
82
|
},
|
|
83
83
|
];
|
|
84
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
|
+
```
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-hex-under",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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