eslint-plugin-hex-under 0.1.1 → 0.1.4

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.
@@ -0,0 +1,39 @@
1
+ name: Build and Test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ lint:
13
+ name: Linting
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Setup Node.js
18
+ uses: actions/setup-node@v4
19
+ with:
20
+ node-version: 22
21
+ - run: npm install
22
+ - name: Run Linting
23
+ run: DEBUG=eslint:eslint npm run lint
24
+ build:
25
+ name: Testing
26
+ needs: lint
27
+ strategy:
28
+ matrix:
29
+ os: [ubuntu-latest, ubuntu-24.04-arm]
30
+ node-version: [18, 20, 22]
31
+ runs-on: ${{ matrix.os }}
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+ - name: Setup Node.js ${{ matrix.node-version }}
35
+ uses: actions/setup-node@v4
36
+ with:
37
+ node-version: ${{ matrix.node-version }}
38
+ - run: npm install
39
+ - run: npm test
package/README.md CHANGED
@@ -13,7 +13,7 @@ const signal = 0xef;
13
13
  // invalid with { limit: 255 }
14
14
  const signal = 0x21b;
15
15
 
16
- // This will be transformed to:
16
+ // This can be transformed to:
17
17
  const signal = 539;
18
18
  ```
19
19
 
package/hex-under.js CHANGED
@@ -2,7 +2,8 @@ module.exports = {
2
2
  meta: {
3
3
  type: "problem",
4
4
  docs: {
5
- description: "Proves that a hexadecimal number must be less than a specified value. Default is 255.",
5
+ description:
6
+ "Proves that a hexadecimal number must be less than a specified value. Default is 255.",
6
7
  },
7
8
  fixable: "code",
8
9
  schema: [
@@ -19,7 +20,7 @@ module.exports = {
19
20
  ],
20
21
  messages: {
21
22
  valueOver:
22
- "Value of '{{ variableName }}' must be less than {{ limitPlusOne }}. {{ over255Raw }} is greater than {{ limit }}.",
23
+ "Value of '{{ variableName }}' must be less than or equal {{ limit }}. {{ overValue }} ({{ over255Raw }}) is greater than {{ limit }}.",
23
24
  },
24
25
  },
25
26
  create(context) {
@@ -38,8 +39,8 @@ module.exports = {
38
39
  messageId: "valueOver",
39
40
  data: {
40
41
  limit: limit,
41
- limitPlusOne: limit + 1,
42
42
  over255Raw: node.init.raw,
43
+ overValue: node.init.value,
43
44
  variableName: node.id.name,
44
45
  },
45
46
  fix(fixer) {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "eslint-plugin-hex-under",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "main": "eslint-plugin-hex-under.js",
5
5
  "scripts": {
6
6
  "lint": "prettier . --check && eslint .",
7
- "test": "node hex-under-256.test.js"
7
+ "test": "node hex-under.test.js"
8
8
  },
9
9
  "repository": {
10
10
  "type": "git",