eslint-plugin-toml 0.9.2 → 0.11.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 +32 -1
- package/lib/configs/flat/base.d.ts +21 -0
- package/lib/configs/flat/base.js +45 -0
- package/lib/configs/flat/recommended.d.ts +26 -0
- package/lib/configs/flat/recommended.js +17 -0
- package/lib/configs/flat/standard.d.ts +41 -0
- package/lib/configs/flat/standard.js +32 -0
- package/lib/index.d.ts +83 -0
- package/lib/index.js +6 -0
- package/lib/meta.d.ts +1 -1
- package/lib/meta.js +1 -1
- package/lib/rules/indent.d.ts +0 -4
- package/lib/rules/indent.js +0 -2
- package/lib/rules/precision-of-integer.d.ts +0 -8
- package/lib/rules/precision-of-integer.js +2 -43
- package/lib/utils/bit.d.ts +8 -0
- package/lib/utils/bit.js +44 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -51,7 +51,38 @@ npm install --save-dev eslint eslint-plugin-toml
|
|
|
51
51
|
|
|
52
52
|
### Configuration
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
#### New Config (`eslint.config.js`)
|
|
55
|
+
|
|
56
|
+
Use `eslint.config.js` file to configure rules. See also: <https://eslint.org/docs/latest/use/configure/configuration-files-new>.
|
|
57
|
+
|
|
58
|
+
Example **eslint.config.js**:
|
|
59
|
+
|
|
60
|
+
```mjs
|
|
61
|
+
import eslintPluginToml from 'eslint-plugin-toml';
|
|
62
|
+
export default [
|
|
63
|
+
// add more generic rule sets here, such as:
|
|
64
|
+
// js.configs.recommended,
|
|
65
|
+
...eslintPluginToml.configs['flat/recommended'],
|
|
66
|
+
{
|
|
67
|
+
rules: {
|
|
68
|
+
// override/add rules settings here, such as:
|
|
69
|
+
// 'toml/rule-name': 'error'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
This plugin provides configs:
|
|
76
|
+
|
|
77
|
+
- `*.configs['flat/base']` ... Configuration to enable correct TOML parsing.
|
|
78
|
+
- `*.configs['flat/recommended']` ... Above, plus rules to prevent errors or unintended behavior.
|
|
79
|
+
- `*.configs['flat/standard']` ... Above, plus rules to enforce the common stylistic conventions.
|
|
80
|
+
|
|
81
|
+
See [the rule list](https://ota-meshi.github.io/eslint-plugin-toml/rules/) to get the `rules` that this plugin provides.
|
|
82
|
+
|
|
83
|
+
#### Legacy Config (`.eslintrc`)
|
|
84
|
+
|
|
85
|
+
Use `.eslintrc.*` file to configure rules. See also: <https://eslint.org/docs/latest/use/configure/>.
|
|
55
86
|
|
|
56
87
|
Example **.eslintrc.js**:
|
|
57
88
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ESLint } from "eslint";
|
|
2
|
+
import * as parser from "toml-eslint-parser";
|
|
3
|
+
declare const _default: ({
|
|
4
|
+
plugins: {
|
|
5
|
+
readonly toml: ESLint.Plugin;
|
|
6
|
+
};
|
|
7
|
+
files?: undefined;
|
|
8
|
+
languageOptions?: undefined;
|
|
9
|
+
rules?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
files: string[];
|
|
12
|
+
languageOptions: {
|
|
13
|
+
parser: typeof parser;
|
|
14
|
+
};
|
|
15
|
+
rules: {
|
|
16
|
+
"no-irregular-whitespace": "off";
|
|
17
|
+
"spaced-comment": "off";
|
|
18
|
+
};
|
|
19
|
+
plugins?: undefined;
|
|
20
|
+
})[];
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const parser = __importStar(require("toml-eslint-parser"));
|
|
27
|
+
exports.default = [
|
|
28
|
+
{
|
|
29
|
+
plugins: {
|
|
30
|
+
get toml() {
|
|
31
|
+
return require("../../index");
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
files: ["*.toml", "**/*.toml"],
|
|
37
|
+
languageOptions: {
|
|
38
|
+
parser,
|
|
39
|
+
},
|
|
40
|
+
rules: {
|
|
41
|
+
"no-irregular-whitespace": "off",
|
|
42
|
+
"spaced-comment": "off",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
];
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
plugins: {
|
|
3
|
+
readonly toml: import("eslint").ESLint.Plugin;
|
|
4
|
+
};
|
|
5
|
+
files?: undefined;
|
|
6
|
+
languageOptions?: undefined;
|
|
7
|
+
rules?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
files: string[];
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parser: typeof import("toml-eslint-parser");
|
|
12
|
+
};
|
|
13
|
+
rules: {
|
|
14
|
+
"no-irregular-whitespace": "off";
|
|
15
|
+
"spaced-comment": "off";
|
|
16
|
+
};
|
|
17
|
+
plugins?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
rules: {
|
|
20
|
+
"toml/no-unreadable-number-separator": "error";
|
|
21
|
+
"toml/precision-of-fractional-seconds": "error";
|
|
22
|
+
"toml/precision-of-integer": "error";
|
|
23
|
+
"toml/vue-custom-block/no-parsing-error": "error";
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const base_1 = __importDefault(require("./base"));
|
|
7
|
+
exports.default = [
|
|
8
|
+
...base_1.default,
|
|
9
|
+
{
|
|
10
|
+
rules: {
|
|
11
|
+
"toml/no-unreadable-number-separator": "error",
|
|
12
|
+
"toml/precision-of-fractional-seconds": "error",
|
|
13
|
+
"toml/precision-of-integer": "error",
|
|
14
|
+
"toml/vue-custom-block/no-parsing-error": "error",
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
declare const _default: ({
|
|
2
|
+
plugins: {
|
|
3
|
+
readonly toml: import("eslint").ESLint.Plugin;
|
|
4
|
+
};
|
|
5
|
+
files?: undefined;
|
|
6
|
+
languageOptions?: undefined;
|
|
7
|
+
rules?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
files: string[];
|
|
10
|
+
languageOptions: {
|
|
11
|
+
parser: typeof import("toml-eslint-parser");
|
|
12
|
+
};
|
|
13
|
+
rules: {
|
|
14
|
+
"no-irregular-whitespace": "off";
|
|
15
|
+
"spaced-comment": "off";
|
|
16
|
+
};
|
|
17
|
+
plugins?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
rules: {
|
|
20
|
+
"toml/array-bracket-newline": "error";
|
|
21
|
+
"toml/array-bracket-spacing": "error";
|
|
22
|
+
"toml/array-element-newline": "error";
|
|
23
|
+
"toml/comma-style": "error";
|
|
24
|
+
"toml/indent": "error";
|
|
25
|
+
"toml/inline-table-curly-spacing": "error";
|
|
26
|
+
"toml/key-spacing": "error";
|
|
27
|
+
"toml/keys-order": "error";
|
|
28
|
+
"toml/no-space-dots": "error";
|
|
29
|
+
"toml/no-unreadable-number-separator": "error";
|
|
30
|
+
"toml/padding-line-between-pairs": "error";
|
|
31
|
+
"toml/padding-line-between-tables": "error";
|
|
32
|
+
"toml/precision-of-fractional-seconds": "error";
|
|
33
|
+
"toml/precision-of-integer": "error";
|
|
34
|
+
"toml/quoted-keys": "error";
|
|
35
|
+
"toml/spaced-comment": "error";
|
|
36
|
+
"toml/table-bracket-spacing": "error";
|
|
37
|
+
"toml/tables-order": "error";
|
|
38
|
+
"toml/vue-custom-block/no-parsing-error": "error";
|
|
39
|
+
};
|
|
40
|
+
})[];
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const base_1 = __importDefault(require("./base"));
|
|
7
|
+
exports.default = [
|
|
8
|
+
...base_1.default,
|
|
9
|
+
{
|
|
10
|
+
rules: {
|
|
11
|
+
"toml/array-bracket-newline": "error",
|
|
12
|
+
"toml/array-bracket-spacing": "error",
|
|
13
|
+
"toml/array-element-newline": "error",
|
|
14
|
+
"toml/comma-style": "error",
|
|
15
|
+
"toml/indent": "error",
|
|
16
|
+
"toml/inline-table-curly-spacing": "error",
|
|
17
|
+
"toml/key-spacing": "error",
|
|
18
|
+
"toml/keys-order": "error",
|
|
19
|
+
"toml/no-space-dots": "error",
|
|
20
|
+
"toml/no-unreadable-number-separator": "error",
|
|
21
|
+
"toml/padding-line-between-pairs": "error",
|
|
22
|
+
"toml/padding-line-between-tables": "error",
|
|
23
|
+
"toml/precision-of-fractional-seconds": "error",
|
|
24
|
+
"toml/precision-of-integer": "error",
|
|
25
|
+
"toml/quoted-keys": "error",
|
|
26
|
+
"toml/spaced-comment": "error",
|
|
27
|
+
"toml/table-bracket-spacing": "error",
|
|
28
|
+
"toml/tables-order": "error",
|
|
29
|
+
"toml/vue-custom-block/no-parsing-error": "error",
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
];
|
package/lib/index.d.ts
CHANGED
|
@@ -47,6 +47,89 @@ declare const _default: {
|
|
|
47
47
|
"toml/vue-custom-block/no-parsing-error": string;
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
+
"flat/base": ({
|
|
51
|
+
plugins: {
|
|
52
|
+
readonly toml: import("eslint").ESLint.Plugin;
|
|
53
|
+
};
|
|
54
|
+
files?: undefined;
|
|
55
|
+
languageOptions?: undefined;
|
|
56
|
+
rules?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
files: string[];
|
|
59
|
+
languageOptions: {
|
|
60
|
+
parser: typeof import("toml-eslint-parser");
|
|
61
|
+
};
|
|
62
|
+
rules: {
|
|
63
|
+
"no-irregular-whitespace": "off";
|
|
64
|
+
"spaced-comment": "off";
|
|
65
|
+
};
|
|
66
|
+
plugins?: undefined;
|
|
67
|
+
})[];
|
|
68
|
+
"flat/recommended": ({
|
|
69
|
+
plugins: {
|
|
70
|
+
readonly toml: import("eslint").ESLint.Plugin;
|
|
71
|
+
};
|
|
72
|
+
files?: undefined;
|
|
73
|
+
languageOptions?: undefined;
|
|
74
|
+
rules?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
files: string[];
|
|
77
|
+
languageOptions: {
|
|
78
|
+
parser: typeof import("toml-eslint-parser");
|
|
79
|
+
};
|
|
80
|
+
rules: {
|
|
81
|
+
"no-irregular-whitespace": "off";
|
|
82
|
+
"spaced-comment": "off";
|
|
83
|
+
};
|
|
84
|
+
plugins?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
rules: {
|
|
87
|
+
"toml/no-unreadable-number-separator": "error";
|
|
88
|
+
"toml/precision-of-fractional-seconds": "error";
|
|
89
|
+
"toml/precision-of-integer": "error";
|
|
90
|
+
"toml/vue-custom-block/no-parsing-error": "error";
|
|
91
|
+
};
|
|
92
|
+
})[];
|
|
93
|
+
"flat/standard": ({
|
|
94
|
+
plugins: {
|
|
95
|
+
readonly toml: import("eslint").ESLint.Plugin;
|
|
96
|
+
};
|
|
97
|
+
files?: undefined;
|
|
98
|
+
languageOptions?: undefined;
|
|
99
|
+
rules?: undefined;
|
|
100
|
+
} | {
|
|
101
|
+
files: string[];
|
|
102
|
+
languageOptions: {
|
|
103
|
+
parser: typeof import("toml-eslint-parser");
|
|
104
|
+
};
|
|
105
|
+
rules: {
|
|
106
|
+
"no-irregular-whitespace": "off";
|
|
107
|
+
"spaced-comment": "off";
|
|
108
|
+
};
|
|
109
|
+
plugins?: undefined;
|
|
110
|
+
} | {
|
|
111
|
+
rules: {
|
|
112
|
+
"toml/array-bracket-newline": "error";
|
|
113
|
+
"toml/array-bracket-spacing": "error";
|
|
114
|
+
"toml/array-element-newline": "error";
|
|
115
|
+
"toml/comma-style": "error";
|
|
116
|
+
"toml/indent": "error";
|
|
117
|
+
"toml/inline-table-curly-spacing": "error";
|
|
118
|
+
"toml/key-spacing": "error";
|
|
119
|
+
"toml/keys-order": "error";
|
|
120
|
+
"toml/no-space-dots": "error";
|
|
121
|
+
"toml/no-unreadable-number-separator": "error";
|
|
122
|
+
"toml/padding-line-between-pairs": "error";
|
|
123
|
+
"toml/padding-line-between-tables": "error";
|
|
124
|
+
"toml/precision-of-fractional-seconds": "error";
|
|
125
|
+
"toml/precision-of-integer": "error";
|
|
126
|
+
"toml/quoted-keys": "error";
|
|
127
|
+
"toml/spaced-comment": "error";
|
|
128
|
+
"toml/table-bracket-spacing": "error";
|
|
129
|
+
"toml/tables-order": "error";
|
|
130
|
+
"toml/vue-custom-block/no-parsing-error": "error";
|
|
131
|
+
};
|
|
132
|
+
})[];
|
|
50
133
|
};
|
|
51
134
|
rules: {
|
|
52
135
|
[key: string]: RuleModule;
|
package/lib/index.js
CHANGED
|
@@ -29,11 +29,17 @@ const rules_1 = require("./utils/rules");
|
|
|
29
29
|
const base_1 = __importDefault(require("./configs/base"));
|
|
30
30
|
const recommended_1 = __importDefault(require("./configs/recommended"));
|
|
31
31
|
const standard_1 = __importDefault(require("./configs/standard"));
|
|
32
|
+
const base_2 = __importDefault(require("./configs/flat/base"));
|
|
33
|
+
const recommended_2 = __importDefault(require("./configs/flat/recommended"));
|
|
34
|
+
const standard_2 = __importDefault(require("./configs/flat/standard"));
|
|
32
35
|
const meta = __importStar(require("./meta"));
|
|
33
36
|
const configs = {
|
|
34
37
|
base: base_1.default,
|
|
35
38
|
recommended: recommended_1.default,
|
|
36
39
|
standard: standard_1.default,
|
|
40
|
+
"flat/base": base_2.default,
|
|
41
|
+
"flat/recommended": recommended_2.default,
|
|
42
|
+
"flat/standard": standard_2.default,
|
|
37
43
|
};
|
|
38
44
|
const rules = rules_1.rules.reduce((obj, r) => {
|
|
39
45
|
obj[r.meta.docs.ruleName] = r;
|
package/lib/meta.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name: "eslint-plugin-toml";
|
|
2
|
-
export declare const version: "0.
|
|
2
|
+
export declare const version: "0.11.0";
|
package/lib/meta.js
CHANGED
package/lib/rules/indent.d.ts
CHANGED
package/lib/rules/indent.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildIndentUtility = void 0;
|
|
4
3
|
const toml_eslint_parser_1 = require("toml-eslint-parser");
|
|
5
4
|
const utils_1 = require("../utils");
|
|
6
5
|
const ast_utils_1 = require("../utils/ast-utils");
|
|
@@ -18,7 +17,6 @@ function buildIndentUtility(optionValue) {
|
|
|
18
17
|
},
|
|
19
18
|
};
|
|
20
19
|
}
|
|
21
|
-
exports.buildIndentUtility = buildIndentUtility;
|
|
22
20
|
exports.default = (0, utils_1.createRule)("indent", {
|
|
23
21
|
meta: {
|
|
24
22
|
docs: {
|
|
@@ -1,55 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maxBitToMaxValues = void 0;
|
|
4
3
|
const utils_1 = require("../utils");
|
|
5
4
|
const compat_1 = require("../utils/compat");
|
|
5
|
+
const bit_1 = require("../utils/bit");
|
|
6
6
|
const cacheMaxValues = {};
|
|
7
|
-
function maxBitToMaxValues(maxBit) {
|
|
8
|
-
const binaryMax = [];
|
|
9
|
-
const minusMax = [0];
|
|
10
|
-
const plusMax = [0];
|
|
11
|
-
const hexMax = [0];
|
|
12
|
-
const octalMax = [0];
|
|
13
|
-
for (let index = 0; index < maxBit; index++) {
|
|
14
|
-
const binaryNum = index === 0 ? 1 : 0;
|
|
15
|
-
binaryMax.push(binaryNum);
|
|
16
|
-
processDigits(minusMax, binaryNum, 10);
|
|
17
|
-
processDigits(hexMax, binaryNum, 16);
|
|
18
|
-
processDigits(octalMax, binaryNum, 8);
|
|
19
|
-
if (index > 0) {
|
|
20
|
-
processDigits(plusMax, 1, 10);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
"+": plusMax.reverse().join(""),
|
|
25
|
-
"-": minusMax.reverse().join(""),
|
|
26
|
-
"0x": hexMax
|
|
27
|
-
.map((i) => i.toString(16))
|
|
28
|
-
.reverse()
|
|
29
|
-
.join("")
|
|
30
|
-
.toLowerCase(),
|
|
31
|
-
"0o": octalMax.reverse().join(""),
|
|
32
|
-
"0b": binaryMax.join(""),
|
|
33
|
-
};
|
|
34
|
-
function processDigits(digits, binaryNum, radix) {
|
|
35
|
-
let num = binaryNum;
|
|
36
|
-
for (let place = 0; place < digits.length; place++) {
|
|
37
|
-
num = digits[place] * 2 + num;
|
|
38
|
-
digits[place] = num % radix;
|
|
39
|
-
num = Math.floor(num / radix);
|
|
40
|
-
}
|
|
41
|
-
while (num > 0) {
|
|
42
|
-
digits.push(num % radix);
|
|
43
|
-
num = Math.floor(num / radix);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
exports.maxBitToMaxValues = maxBitToMaxValues;
|
|
48
7
|
function getMaxValues(bit) {
|
|
49
8
|
if (cacheMaxValues[bit]) {
|
|
50
9
|
return cacheMaxValues[bit];
|
|
51
10
|
}
|
|
52
|
-
return (cacheMaxValues[bit] = maxBitToMaxValues(bit));
|
|
11
|
+
return (cacheMaxValues[bit] = (0, bit_1.maxBitToMaxValues)(bit));
|
|
53
12
|
}
|
|
54
13
|
exports.default = (0, utils_1.createRule)("precision-of-integer", {
|
|
55
14
|
meta: {
|
package/lib/utils/bit.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maxBitToMaxValues = void 0;
|
|
4
|
+
function maxBitToMaxValues(maxBit) {
|
|
5
|
+
const binaryMax = [];
|
|
6
|
+
const minusMax = [0];
|
|
7
|
+
const plusMax = [0];
|
|
8
|
+
const hexMax = [0];
|
|
9
|
+
const octalMax = [0];
|
|
10
|
+
for (let index = 0; index < maxBit; index++) {
|
|
11
|
+
const binaryNum = index === 0 ? 1 : 0;
|
|
12
|
+
binaryMax.push(binaryNum);
|
|
13
|
+
processDigits(minusMax, binaryNum, 10);
|
|
14
|
+
processDigits(hexMax, binaryNum, 16);
|
|
15
|
+
processDigits(octalMax, binaryNum, 8);
|
|
16
|
+
if (index > 0) {
|
|
17
|
+
processDigits(plusMax, 1, 10);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
"+": plusMax.reverse().join(""),
|
|
22
|
+
"-": minusMax.reverse().join(""),
|
|
23
|
+
"0x": hexMax
|
|
24
|
+
.map((i) => i.toString(16))
|
|
25
|
+
.reverse()
|
|
26
|
+
.join("")
|
|
27
|
+
.toLowerCase(),
|
|
28
|
+
"0o": octalMax.reverse().join(""),
|
|
29
|
+
"0b": binaryMax.join(""),
|
|
30
|
+
};
|
|
31
|
+
function processDigits(digits, binaryNum, radix) {
|
|
32
|
+
let num = binaryNum;
|
|
33
|
+
for (let place = 0; place < digits.length; place++) {
|
|
34
|
+
num = digits[place] * 2 + num;
|
|
35
|
+
digits[place] = num % radix;
|
|
36
|
+
num = Math.floor(num / radix);
|
|
37
|
+
}
|
|
38
|
+
while (num > 0) {
|
|
39
|
+
digits.push(num % radix);
|
|
40
|
+
num = Math.floor(num / radix);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.maxBitToMaxValues = maxBitToMaxValues;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-toml",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "This ESLint plugin provides linting rules for TOML.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"debug": "^4.1.1",
|
|
60
|
-
"eslint-compat-utils": "^0.
|
|
60
|
+
"eslint-compat-utils": "^0.5.0",
|
|
61
61
|
"lodash": "^4.17.19",
|
|
62
62
|
"toml-eslint-parser": "^0.9.0"
|
|
63
63
|
},
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@types/debug": "^4.1.5",
|
|
70
70
|
"@types/eslint": "^8.0.0",
|
|
71
71
|
"@types/eslint-scope": "^3.7.0",
|
|
72
|
-
"@types/eslint-visitor-keys": "^
|
|
72
|
+
"@types/eslint-visitor-keys": "^3.0.0",
|
|
73
73
|
"@types/estree": "^1.0.0",
|
|
74
74
|
"@types/lodash": "^4.14.158",
|
|
75
75
|
"@types/mocha": "^10.0.0",
|
|
@@ -79,20 +79,21 @@
|
|
|
79
79
|
"@typescript-eslint/parser": "^6.19.0",
|
|
80
80
|
"cross-env": "^7.0.2",
|
|
81
81
|
"env-cmd": "^10.1.0",
|
|
82
|
-
"esbuild": "^0.
|
|
82
|
+
"esbuild": "^0.20.0",
|
|
83
83
|
"eslint": "^8.0.0",
|
|
84
84
|
"eslint-config-prettier": "^9.0.0",
|
|
85
85
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
86
86
|
"eslint-plugin-eslint-plugin": "^5.0.0",
|
|
87
|
-
"eslint-plugin-json-schema-validator": "^
|
|
87
|
+
"eslint-plugin-json-schema-validator": "^5.0.0",
|
|
88
88
|
"eslint-plugin-jsonc": "^2.0.0",
|
|
89
89
|
"eslint-plugin-markdown": "^3.0.0",
|
|
90
90
|
"eslint-plugin-n": "^16.0.0",
|
|
91
91
|
"eslint-plugin-prettier": "^5.0.0",
|
|
92
92
|
"eslint-plugin-regexp": "^2.0.0",
|
|
93
|
+
"eslint-plugin-toml": "^0.10.0",
|
|
93
94
|
"eslint-plugin-vue": "^9.0.0",
|
|
94
95
|
"eslint-plugin-yml": "^1.0.0",
|
|
95
|
-
"espree": "^
|
|
96
|
+
"espree": "^10.0.0",
|
|
96
97
|
"events": "^3.3.0",
|
|
97
98
|
"mocha": "^10.0.0",
|
|
98
99
|
"nyc": "^15.1.0",
|