immosquare-cleaner 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/lib/immosquare-cleaner.rb +3 -2
- data/linters/eslintrc.json +54 -27
- data/package.json +7 -8
- metadata +30 -69
- data/node_modules/eslint-plugin-jsonc/LICENSE +0 -21
- data/node_modules/eslint-plugin-jsonc/README.md +0 -279
- data/node_modules/eslint-plugin-jsonc/conf/eslint-all.js +0 -11
- data/node_modules/eslint-plugin-jsonc/conf/eslint-recommended.js +0 -13
- data/node_modules/eslint-plugin-jsonc/conf/rules.js +0 -10
- data/node_modules/eslint-plugin-jsonc/dist/configs/all.js +0 -18
- data/node_modules/eslint-plugin-jsonc/dist/configs/auto-config.js +0 -13
- data/node_modules/eslint-plugin-jsonc/dist/configs/base.js +0 -15
- data/node_modules/eslint-plugin-jsonc/dist/configs/prettier.js +0 -26
- data/node_modules/eslint-plugin-jsonc/dist/configs/recommended-with-json.js +0 -41
- data/node_modules/eslint-plugin-jsonc/dist/configs/recommended-with-json5.js +0 -30
- data/node_modules/eslint-plugin-jsonc/dist/configs/recommended-with-jsonc.js +0 -39
- data/node_modules/eslint-plugin-jsonc/dist/index.js +0 -68
- data/node_modules/eslint-plugin-jsonc/dist/meta.js +0 -5
- data/node_modules/eslint-plugin-jsonc/dist/rules/array-bracket-newline.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/array-bracket-spacing.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/array-element-newline.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/auto.js +0 -66
- data/node_modules/eslint-plugin-jsonc/dist/rules/comma-dangle.js +0 -27
- data/node_modules/eslint-plugin-jsonc/dist/rules/comma-style.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/indent.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/key-name-casing.js +0 -94
- data/node_modules/eslint-plugin-jsonc/dist/rules/key-spacing.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-bigint-literals.js +0 -33
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-binary-expression.js +0 -38
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-binary-numeric-literals.js +0 -39
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-comments.js +0 -34
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-dupe-keys.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-escape-sequence-in-identifier.js +0 -57
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-floating-decimal.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-hexadecimal-numeric-literals.js +0 -39
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-infinity.js +0 -37
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-irregular-whitespace.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-multi-str.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-nan.js +0 -37
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-number-props.js +0 -41
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-numeric-separators.js +0 -42
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-octal-escape.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-octal-numeric-literals.js +0 -39
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-octal.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-parenthesized.js +0 -70
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-plus-sign.js +0 -39
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-regexp-literals.js +0 -33
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-sparse-arrays.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-template-literals.js +0 -36
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-undefined-value.js +0 -35
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-unicode-codepoint-escapes.js +0 -73
- data/node_modules/eslint-plugin-jsonc/dist/rules/no-useless-escape.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/object-curly-newline.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/object-curly-spacing.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/object-property-newline.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/quote-props.js +0 -27
- data/node_modules/eslint-plugin-jsonc/dist/rules/quotes.js +0 -27
- data/node_modules/eslint-plugin-jsonc/dist/rules/sort-array-values.js +0 -371
- data/node_modules/eslint-plugin-jsonc/dist/rules/sort-keys.js +0 -413
- data/node_modules/eslint-plugin-jsonc/dist/rules/space-unary-ops.js +0 -23
- data/node_modules/eslint-plugin-jsonc/dist/rules/valid-json-number.js +0 -138
- data/node_modules/eslint-plugin-jsonc/dist/rules/vue-custom-block/no-parsing-error.js +0 -86
- data/node_modules/eslint-plugin-jsonc/dist/types.js +0 -2
- data/node_modules/eslint-plugin-jsonc/dist/utils/casing.js +0 -134
- data/node_modules/eslint-plugin-jsonc/dist/utils/get-auto-jsonc-rules-config.js +0 -97
- data/node_modules/eslint-plugin-jsonc/dist/utils/index.js +0 -121
- data/node_modules/eslint-plugin-jsonc/dist/utils/rules.js +0 -96
- data/node_modules/eslint-plugin-jsonc/index.d.ts +0 -364
- data/node_modules/eslint-plugin-jsonc/package.json +0 -123
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
const rules_1 = require("../utils/rules");
|
6
|
-
const path_1 = __importDefault(require("path"));
|
7
|
-
const base = require.resolve("./base");
|
8
|
-
const baseExtend = path_1.default.extname(`${base}`) === ".ts" ? "plugin:jsonc/base" : base;
|
9
|
-
const all = {};
|
10
|
-
for (const rule of rules_1.rules) {
|
11
|
-
if (rule.meta.docs.ruleId === "jsonc/sort-array-values")
|
12
|
-
continue;
|
13
|
-
all[rule.meta.docs.ruleId] = "error";
|
14
|
-
}
|
15
|
-
module.exports = {
|
16
|
-
extends: [baseExtend],
|
17
|
-
rules: Object.assign({}, all),
|
18
|
-
};
|
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
const path_1 = __importDefault(require("path"));
|
6
|
-
const base = require.resolve("./base");
|
7
|
-
const baseExtend = path_1.default.extname(`${base}`) === ".ts" ? "plugin:jsonc/base" : base;
|
8
|
-
module.exports = {
|
9
|
-
extends: [baseExtend],
|
10
|
-
rules: {
|
11
|
-
"jsonc/auto": "error",
|
12
|
-
},
|
13
|
-
};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
module.exports = {
|
3
|
-
plugins: ["jsonc"],
|
4
|
-
overrides: [
|
5
|
-
{
|
6
|
-
files: ["*.json", "*.json5", "*.jsonc"],
|
7
|
-
parser: require.resolve("jsonc-eslint-parser"),
|
8
|
-
rules: {
|
9
|
-
strict: "off",
|
10
|
-
"no-unused-expressions": "off",
|
11
|
-
"no-unused-vars": "off",
|
12
|
-
},
|
13
|
-
},
|
14
|
-
],
|
15
|
-
};
|
@@ -1,26 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
const path_1 = __importDefault(require("path"));
|
6
|
-
const base = require.resolve("./base");
|
7
|
-
const baseExtend = path_1.default.extname(`${base}`) === ".ts" ? "plugin:jsonc/base" : base;
|
8
|
-
module.exports = {
|
9
|
-
extends: [baseExtend],
|
10
|
-
rules: {
|
11
|
-
"jsonc/array-bracket-newline": "off",
|
12
|
-
"jsonc/array-bracket-spacing": "off",
|
13
|
-
"jsonc/array-element-newline": "off",
|
14
|
-
"jsonc/comma-dangle": "off",
|
15
|
-
"jsonc/comma-style": "off",
|
16
|
-
"jsonc/indent": "off",
|
17
|
-
"jsonc/key-spacing": "off",
|
18
|
-
"jsonc/no-floating-decimal": "off",
|
19
|
-
"jsonc/object-curly-newline": "off",
|
20
|
-
"jsonc/object-curly-spacing": "off",
|
21
|
-
"jsonc/object-property-newline": "off",
|
22
|
-
"jsonc/quote-props": "off",
|
23
|
-
"jsonc/quotes": "off",
|
24
|
-
"jsonc/space-unary-ops": "off",
|
25
|
-
},
|
26
|
-
};
|
@@ -1,41 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
const path_1 = __importDefault(require("path"));
|
6
|
-
const base = require.resolve("./base");
|
7
|
-
const baseExtend = path_1.default.extname(`${base}`) === ".ts" ? "plugin:jsonc/base" : base;
|
8
|
-
module.exports = {
|
9
|
-
extends: [baseExtend],
|
10
|
-
rules: {
|
11
|
-
"jsonc/comma-dangle": "error",
|
12
|
-
"jsonc/no-bigint-literals": "error",
|
13
|
-
"jsonc/no-binary-expression": "error",
|
14
|
-
"jsonc/no-binary-numeric-literals": "error",
|
15
|
-
"jsonc/no-comments": "error",
|
16
|
-
"jsonc/no-dupe-keys": "error",
|
17
|
-
"jsonc/no-escape-sequence-in-identifier": "error",
|
18
|
-
"jsonc/no-floating-decimal": "error",
|
19
|
-
"jsonc/no-hexadecimal-numeric-literals": "error",
|
20
|
-
"jsonc/no-infinity": "error",
|
21
|
-
"jsonc/no-multi-str": "error",
|
22
|
-
"jsonc/no-nan": "error",
|
23
|
-
"jsonc/no-number-props": "error",
|
24
|
-
"jsonc/no-numeric-separators": "error",
|
25
|
-
"jsonc/no-octal-numeric-literals": "error",
|
26
|
-
"jsonc/no-octal": "error",
|
27
|
-
"jsonc/no-parenthesized": "error",
|
28
|
-
"jsonc/no-plus-sign": "error",
|
29
|
-
"jsonc/no-regexp-literals": "error",
|
30
|
-
"jsonc/no-sparse-arrays": "error",
|
31
|
-
"jsonc/no-template-literals": "error",
|
32
|
-
"jsonc/no-undefined-value": "error",
|
33
|
-
"jsonc/no-unicode-codepoint-escapes": "error",
|
34
|
-
"jsonc/no-useless-escape": "error",
|
35
|
-
"jsonc/quote-props": "error",
|
36
|
-
"jsonc/quotes": "error",
|
37
|
-
"jsonc/space-unary-ops": "error",
|
38
|
-
"jsonc/valid-json-number": "error",
|
39
|
-
"jsonc/vue-custom-block/no-parsing-error": "error",
|
40
|
-
},
|
41
|
-
};
|
@@ -1,30 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
const path_1 = __importDefault(require("path"));
|
6
|
-
const base = require.resolve("./base");
|
7
|
-
const baseExtend = path_1.default.extname(`${base}`) === ".ts" ? "plugin:jsonc/base" : base;
|
8
|
-
module.exports = {
|
9
|
-
extends: [baseExtend],
|
10
|
-
rules: {
|
11
|
-
"jsonc/no-bigint-literals": "error",
|
12
|
-
"jsonc/no-binary-expression": "error",
|
13
|
-
"jsonc/no-binary-numeric-literals": "error",
|
14
|
-
"jsonc/no-dupe-keys": "error",
|
15
|
-
"jsonc/no-escape-sequence-in-identifier": "error",
|
16
|
-
"jsonc/no-number-props": "error",
|
17
|
-
"jsonc/no-numeric-separators": "error",
|
18
|
-
"jsonc/no-octal-numeric-literals": "error",
|
19
|
-
"jsonc/no-octal": "error",
|
20
|
-
"jsonc/no-parenthesized": "error",
|
21
|
-
"jsonc/no-regexp-literals": "error",
|
22
|
-
"jsonc/no-sparse-arrays": "error",
|
23
|
-
"jsonc/no-template-literals": "error",
|
24
|
-
"jsonc/no-undefined-value": "error",
|
25
|
-
"jsonc/no-unicode-codepoint-escapes": "error",
|
26
|
-
"jsonc/no-useless-escape": "error",
|
27
|
-
"jsonc/space-unary-ops": "error",
|
28
|
-
"jsonc/vue-custom-block/no-parsing-error": "error",
|
29
|
-
},
|
30
|
-
};
|
@@ -1,39 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
const path_1 = __importDefault(require("path"));
|
6
|
-
const base = require.resolve("./base");
|
7
|
-
const baseExtend = path_1.default.extname(`${base}`) === ".ts" ? "plugin:jsonc/base" : base;
|
8
|
-
module.exports = {
|
9
|
-
extends: [baseExtend],
|
10
|
-
rules: {
|
11
|
-
"jsonc/no-bigint-literals": "error",
|
12
|
-
"jsonc/no-binary-expression": "error",
|
13
|
-
"jsonc/no-binary-numeric-literals": "error",
|
14
|
-
"jsonc/no-dupe-keys": "error",
|
15
|
-
"jsonc/no-escape-sequence-in-identifier": "error",
|
16
|
-
"jsonc/no-floating-decimal": "error",
|
17
|
-
"jsonc/no-hexadecimal-numeric-literals": "error",
|
18
|
-
"jsonc/no-infinity": "error",
|
19
|
-
"jsonc/no-multi-str": "error",
|
20
|
-
"jsonc/no-nan": "error",
|
21
|
-
"jsonc/no-number-props": "error",
|
22
|
-
"jsonc/no-numeric-separators": "error",
|
23
|
-
"jsonc/no-octal-numeric-literals": "error",
|
24
|
-
"jsonc/no-octal": "error",
|
25
|
-
"jsonc/no-parenthesized": "error",
|
26
|
-
"jsonc/no-plus-sign": "error",
|
27
|
-
"jsonc/no-regexp-literals": "error",
|
28
|
-
"jsonc/no-sparse-arrays": "error",
|
29
|
-
"jsonc/no-template-literals": "error",
|
30
|
-
"jsonc/no-undefined-value": "error",
|
31
|
-
"jsonc/no-unicode-codepoint-escapes": "error",
|
32
|
-
"jsonc/no-useless-escape": "error",
|
33
|
-
"jsonc/quote-props": "error",
|
34
|
-
"jsonc/quotes": "error",
|
35
|
-
"jsonc/space-unary-ops": "error",
|
36
|
-
"jsonc/valid-json-number": "error",
|
37
|
-
"jsonc/vue-custom-block/no-parsing-error": "error",
|
38
|
-
},
|
39
|
-
};
|
@@ -1,68 +0,0 @@
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
27
|
-
};
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
-
exports.getStaticJSONValue = exports.traverseNodes = exports.parseJSON = exports.parseForESLint = exports.rules = exports.configs = exports.meta = void 0;
|
30
|
-
const rules_1 = require("./utils/rules");
|
31
|
-
const base_1 = __importDefault(require("./configs/base"));
|
32
|
-
const auto_config_1 = __importDefault(require("./configs/auto-config"));
|
33
|
-
const recommended_with_json_1 = __importDefault(require("./configs/recommended-with-json"));
|
34
|
-
const recommended_with_jsonc_1 = __importDefault(require("./configs/recommended-with-jsonc"));
|
35
|
-
const recommended_with_json5_1 = __importDefault(require("./configs/recommended-with-json5"));
|
36
|
-
const prettier_1 = __importDefault(require("./configs/prettier"));
|
37
|
-
const all_1 = __importDefault(require("./configs/all"));
|
38
|
-
const meta = __importStar(require("./meta"));
|
39
|
-
exports.meta = meta;
|
40
|
-
const jsonc_eslint_parser_1 = require("jsonc-eslint-parser");
|
41
|
-
Object.defineProperty(exports, "parseForESLint", { enumerable: true, get: function () { return jsonc_eslint_parser_1.parseForESLint; } });
|
42
|
-
Object.defineProperty(exports, "parseJSON", { enumerable: true, get: function () { return jsonc_eslint_parser_1.parseJSON; } });
|
43
|
-
Object.defineProperty(exports, "traverseNodes", { enumerable: true, get: function () { return jsonc_eslint_parser_1.traverseNodes; } });
|
44
|
-
Object.defineProperty(exports, "getStaticJSONValue", { enumerable: true, get: function () { return jsonc_eslint_parser_1.getStaticJSONValue; } });
|
45
|
-
const configs = {
|
46
|
-
base: base_1.default,
|
47
|
-
"auto-config": auto_config_1.default,
|
48
|
-
"recommended-with-json": recommended_with_json_1.default,
|
49
|
-
"recommended-with-jsonc": recommended_with_jsonc_1.default,
|
50
|
-
"recommended-with-json5": recommended_with_json5_1.default,
|
51
|
-
prettier: prettier_1.default,
|
52
|
-
all: all_1.default,
|
53
|
-
};
|
54
|
-
exports.configs = configs;
|
55
|
-
const rules = rules_1.rules.reduce((obj, r) => {
|
56
|
-
obj[r.meta.docs.ruleName] = r;
|
57
|
-
return obj;
|
58
|
-
}, {});
|
59
|
-
exports.rules = rules;
|
60
|
-
exports.default = {
|
61
|
-
meta,
|
62
|
-
configs,
|
63
|
-
rules,
|
64
|
-
parseForESLint: jsonc_eslint_parser_1.parseForESLint,
|
65
|
-
parseJSON: jsonc_eslint_parser_1.parseJSON,
|
66
|
-
traverseNodes: jsonc_eslint_parser_1.traverseNodes,
|
67
|
-
getStaticJSONValue: jsonc_eslint_parser_1.getStaticJSONValue,
|
68
|
-
};
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const utils_1 = require("../utils");
|
5
|
-
const coreRule = (0, utils_1.getCoreRule)("array-bracket-newline");
|
6
|
-
exports.default = (0, utils_1.createRule)("array-bracket-newline", {
|
7
|
-
meta: {
|
8
|
-
docs: {
|
9
|
-
description: "enforce line breaks after opening and before closing array brackets",
|
10
|
-
recommended: null,
|
11
|
-
extensionRule: true,
|
12
|
-
layout: true,
|
13
|
-
},
|
14
|
-
fixable: (_a = coreRule.meta) === null || _a === void 0 ? void 0 : _a.fixable,
|
15
|
-
hasSuggestions: coreRule.meta.hasSuggestions,
|
16
|
-
schema: coreRule.meta.schema,
|
17
|
-
messages: coreRule.meta.messages,
|
18
|
-
type: coreRule.meta.type,
|
19
|
-
},
|
20
|
-
create(context) {
|
21
|
-
return (0, utils_1.defineWrapperListener)(coreRule, context, context.options);
|
22
|
-
},
|
23
|
-
});
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const utils_1 = require("../utils");
|
5
|
-
const coreRule = (0, utils_1.getCoreRule)("array-bracket-spacing");
|
6
|
-
exports.default = (0, utils_1.createRule)("array-bracket-spacing", {
|
7
|
-
meta: {
|
8
|
-
docs: {
|
9
|
-
description: "disallow or enforce spaces inside of brackets",
|
10
|
-
recommended: null,
|
11
|
-
extensionRule: true,
|
12
|
-
layout: true,
|
13
|
-
},
|
14
|
-
fixable: (_a = coreRule.meta) === null || _a === void 0 ? void 0 : _a.fixable,
|
15
|
-
hasSuggestions: coreRule.meta.hasSuggestions,
|
16
|
-
schema: coreRule.meta.schema,
|
17
|
-
messages: coreRule.meta.messages,
|
18
|
-
type: coreRule.meta.type,
|
19
|
-
},
|
20
|
-
create(context) {
|
21
|
-
return (0, utils_1.defineWrapperListener)(coreRule, context, context.options);
|
22
|
-
},
|
23
|
-
});
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const utils_1 = require("../utils");
|
5
|
-
const coreRule = (0, utils_1.getCoreRule)("array-element-newline");
|
6
|
-
exports.default = (0, utils_1.createRule)("array-element-newline", {
|
7
|
-
meta: {
|
8
|
-
docs: {
|
9
|
-
description: "enforce line breaks between array elements",
|
10
|
-
recommended: null,
|
11
|
-
extensionRule: true,
|
12
|
-
layout: true,
|
13
|
-
},
|
14
|
-
fixable: (_a = coreRule.meta) === null || _a === void 0 ? void 0 : _a.fixable,
|
15
|
-
hasSuggestions: coreRule.meta.hasSuggestions,
|
16
|
-
schema: coreRule.meta.schema,
|
17
|
-
messages: coreRule.meta.messages,
|
18
|
-
type: coreRule.meta.type,
|
19
|
-
},
|
20
|
-
create(context) {
|
21
|
-
return (0, utils_1.defineWrapperListener)(coreRule, context, context.options);
|
22
|
-
},
|
23
|
-
});
|
@@ -1,66 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const utils_1 = require("../utils");
|
4
|
-
const get_auto_jsonc_rules_config_1 = require("../utils/get-auto-jsonc-rules-config");
|
5
|
-
exports.default = (0, utils_1.createRule)("auto", {
|
6
|
-
meta: {
|
7
|
-
docs: {
|
8
|
-
description: "apply jsonc rules similar to your configured ESLint core rules",
|
9
|
-
recommended: null,
|
10
|
-
extensionRule: false,
|
11
|
-
layout: false,
|
12
|
-
},
|
13
|
-
fixable: "code",
|
14
|
-
schema: [],
|
15
|
-
messages: {},
|
16
|
-
type: "suggestion",
|
17
|
-
},
|
18
|
-
create(context, params) {
|
19
|
-
if (!context.parserServices.isJSON) {
|
20
|
-
return {};
|
21
|
-
}
|
22
|
-
const autoConfig = (0, get_auto_jsonc_rules_config_1.getAutoConfig)(context.getFilename());
|
23
|
-
const visitor = {};
|
24
|
-
for (const ruleId of Object.keys(autoConfig)) {
|
25
|
-
const rule = require(`./${ruleId.replace(/^jsonc\//u, "")}`).default;
|
26
|
-
const subContext = {
|
27
|
-
__proto__: context,
|
28
|
-
options: getRuleOptions(autoConfig[ruleId]),
|
29
|
-
report(options) {
|
30
|
-
if (options.messageId) {
|
31
|
-
options.message = `[${ruleId}] ${rule.meta.messages[options.messageId]}`;
|
32
|
-
delete options.messageId;
|
33
|
-
}
|
34
|
-
else {
|
35
|
-
options.message = `[${ruleId}] ${options.message}`;
|
36
|
-
}
|
37
|
-
context.report(options);
|
38
|
-
},
|
39
|
-
};
|
40
|
-
const ruleVisitor = rule.jsoncDefineRule.create(subContext, params);
|
41
|
-
for (const key of Object.keys(ruleVisitor)) {
|
42
|
-
const newVisit = ruleVisitor[key];
|
43
|
-
const oldVisit = visitor[key];
|
44
|
-
if (!newVisit) {
|
45
|
-
continue;
|
46
|
-
}
|
47
|
-
if (!oldVisit) {
|
48
|
-
visitor[key] = ruleVisitor[key];
|
49
|
-
}
|
50
|
-
else {
|
51
|
-
visitor[key] = (...args) => {
|
52
|
-
oldVisit(...args);
|
53
|
-
newVisit(...args);
|
54
|
-
};
|
55
|
-
}
|
56
|
-
}
|
57
|
-
}
|
58
|
-
return visitor;
|
59
|
-
},
|
60
|
-
});
|
61
|
-
function getRuleOptions(options) {
|
62
|
-
if (!Array.isArray(options)) {
|
63
|
-
return [];
|
64
|
-
}
|
65
|
-
return options.slice(1);
|
66
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const utils_1 = require("../utils");
|
5
|
-
const coreRule = (0, utils_1.getCoreRule)("comma-dangle");
|
6
|
-
exports.default = (0, utils_1.createRule)("comma-dangle", {
|
7
|
-
meta: {
|
8
|
-
docs: {
|
9
|
-
description: "require or disallow trailing commas",
|
10
|
-
recommended: ["json"],
|
11
|
-
extensionRule: true,
|
12
|
-
layout: true,
|
13
|
-
},
|
14
|
-
fixable: (_a = coreRule.meta) === null || _a === void 0 ? void 0 : _a.fixable,
|
15
|
-
hasSuggestions: coreRule.meta.hasSuggestions,
|
16
|
-
schema: coreRule.meta.schema,
|
17
|
-
messages: coreRule.meta.messages,
|
18
|
-
type: coreRule.meta.type,
|
19
|
-
},
|
20
|
-
create(context) {
|
21
|
-
const options = [...context.options];
|
22
|
-
if (!options[0]) {
|
23
|
-
options[0] = "never";
|
24
|
-
}
|
25
|
-
return (0, utils_1.defineWrapperListener)(coreRule, context, options);
|
26
|
-
},
|
27
|
-
});
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const utils_1 = require("../utils");
|
5
|
-
const coreRule = (0, utils_1.getCoreRule)("comma-style");
|
6
|
-
exports.default = (0, utils_1.createRule)("comma-style", {
|
7
|
-
meta: {
|
8
|
-
docs: {
|
9
|
-
description: "enforce consistent comma style",
|
10
|
-
recommended: null,
|
11
|
-
extensionRule: true,
|
12
|
-
layout: true,
|
13
|
-
},
|
14
|
-
fixable: (_a = coreRule.meta) === null || _a === void 0 ? void 0 : _a.fixable,
|
15
|
-
hasSuggestions: coreRule.meta.hasSuggestions,
|
16
|
-
schema: coreRule.meta.schema,
|
17
|
-
messages: coreRule.meta.messages,
|
18
|
-
type: coreRule.meta.type,
|
19
|
-
},
|
20
|
-
create(context) {
|
21
|
-
return (0, utils_1.defineWrapperListener)(coreRule, context, context.options);
|
22
|
-
},
|
23
|
-
});
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const utils_1 = require("../utils");
|
5
|
-
const coreRule = (0, utils_1.getCoreRule)("indent");
|
6
|
-
exports.default = (0, utils_1.createRule)("indent", {
|
7
|
-
meta: {
|
8
|
-
docs: {
|
9
|
-
description: "enforce consistent indentation",
|
10
|
-
recommended: null,
|
11
|
-
extensionRule: true,
|
12
|
-
layout: true,
|
13
|
-
},
|
14
|
-
fixable: (_a = coreRule.meta) === null || _a === void 0 ? void 0 : _a.fixable,
|
15
|
-
hasSuggestions: coreRule.meta.hasSuggestions,
|
16
|
-
schema: coreRule.meta.schema,
|
17
|
-
messages: coreRule.meta.messages,
|
18
|
-
type: coreRule.meta.type,
|
19
|
-
},
|
20
|
-
create(context) {
|
21
|
-
return (0, utils_1.defineWrapperListener)(coreRule, context, context.options);
|
22
|
-
},
|
23
|
-
});
|
@@ -1,94 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const utils_1 = require("../utils");
|
4
|
-
const casing_1 = require("../utils/casing");
|
5
|
-
exports.default = (0, utils_1.createRule)("key-name-casing", {
|
6
|
-
meta: {
|
7
|
-
docs: {
|
8
|
-
description: "enforce naming convention to property key names",
|
9
|
-
recommended: null,
|
10
|
-
extensionRule: false,
|
11
|
-
layout: false,
|
12
|
-
},
|
13
|
-
schema: [
|
14
|
-
{
|
15
|
-
type: "object",
|
16
|
-
properties: {
|
17
|
-
camelCase: {
|
18
|
-
type: "boolean",
|
19
|
-
default: true,
|
20
|
-
},
|
21
|
-
PascalCase: {
|
22
|
-
type: "boolean",
|
23
|
-
default: false,
|
24
|
-
},
|
25
|
-
SCREAMING_SNAKE_CASE: {
|
26
|
-
type: "boolean",
|
27
|
-
default: false,
|
28
|
-
},
|
29
|
-
"kebab-case": {
|
30
|
-
type: "boolean",
|
31
|
-
default: false,
|
32
|
-
},
|
33
|
-
snake_case: {
|
34
|
-
type: "boolean",
|
35
|
-
default: false,
|
36
|
-
},
|
37
|
-
ignores: {
|
38
|
-
type: "array",
|
39
|
-
items: {
|
40
|
-
type: "string",
|
41
|
-
},
|
42
|
-
uniqueItems: true,
|
43
|
-
additionalItems: false,
|
44
|
-
},
|
45
|
-
},
|
46
|
-
additionalProperties: false,
|
47
|
-
},
|
48
|
-
],
|
49
|
-
messages: {
|
50
|
-
doesNotMatchFormat: "Property name `{{name}}` must match one of the following formats: {{formats}}",
|
51
|
-
},
|
52
|
-
type: "suggestion",
|
53
|
-
},
|
54
|
-
create(context) {
|
55
|
-
if (!context.parserServices.isJSON) {
|
56
|
-
return {};
|
57
|
-
}
|
58
|
-
const sourceCode = context.getSourceCode();
|
59
|
-
const option = Object.assign({}, context.options[0]);
|
60
|
-
if (option.camelCase !== false) {
|
61
|
-
option.camelCase = true;
|
62
|
-
}
|
63
|
-
const ignores = option.ignores
|
64
|
-
? option.ignores.map((ignore) => new RegExp(ignore))
|
65
|
-
: [];
|
66
|
-
const formats = Object.keys(option)
|
67
|
-
.filter((key) => casing_1.allowedCaseOptions.includes(key))
|
68
|
-
.filter((key) => option[key]);
|
69
|
-
const checkers = formats.map(casing_1.getChecker);
|
70
|
-
function isValid(name) {
|
71
|
-
if (ignores.some((regex) => regex.test(name))) {
|
72
|
-
return true;
|
73
|
-
}
|
74
|
-
return checkers.length ? checkers.some((c) => c(name)) : true;
|
75
|
-
}
|
76
|
-
return {
|
77
|
-
JSONProperty(node) {
|
78
|
-
const name = node.key.type === "JSONLiteral" && typeof node.key.value === "string"
|
79
|
-
? node.key.value
|
80
|
-
: sourceCode.text.slice(...node.key.range);
|
81
|
-
if (!isValid(name)) {
|
82
|
-
context.report({
|
83
|
-
loc: node.key.loc,
|
84
|
-
messageId: "doesNotMatchFormat",
|
85
|
-
data: {
|
86
|
-
name,
|
87
|
-
formats: formats.join(", "),
|
88
|
-
},
|
89
|
-
});
|
90
|
-
}
|
91
|
-
},
|
92
|
-
};
|
93
|
-
},
|
94
|
-
});
|
@@ -1,23 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var _a;
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
-
const utils_1 = require("../utils");
|
5
|
-
const coreRule = (0, utils_1.getCoreRule)("key-spacing");
|
6
|
-
exports.default = (0, utils_1.createRule)("key-spacing", {
|
7
|
-
meta: {
|
8
|
-
docs: {
|
9
|
-
description: "enforce consistent spacing between keys and values in object literal properties",
|
10
|
-
recommended: null,
|
11
|
-
extensionRule: true,
|
12
|
-
layout: true,
|
13
|
-
},
|
14
|
-
fixable: (_a = coreRule.meta) === null || _a === void 0 ? void 0 : _a.fixable,
|
15
|
-
hasSuggestions: coreRule.meta.hasSuggestions,
|
16
|
-
schema: coreRule.meta.schema,
|
17
|
-
messages: coreRule.meta.messages,
|
18
|
-
type: coreRule.meta.type,
|
19
|
-
},
|
20
|
-
create(context) {
|
21
|
-
return (0, utils_1.defineWrapperListener)(coreRule, context, context.options);
|
22
|
-
},
|
23
|
-
});
|
@@ -1,33 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const utils_1 = require("../utils");
|
4
|
-
exports.default = (0, utils_1.createRule)("no-bigint-literals", {
|
5
|
-
meta: {
|
6
|
-
docs: {
|
7
|
-
description: "disallow BigInt literals",
|
8
|
-
recommended: ["json", "jsonc", "json5"],
|
9
|
-
extensionRule: false,
|
10
|
-
layout: false,
|
11
|
-
},
|
12
|
-
schema: [],
|
13
|
-
messages: {
|
14
|
-
unexpected: "BigInt literals are not allowed.",
|
15
|
-
},
|
16
|
-
type: "problem",
|
17
|
-
},
|
18
|
-
create(context) {
|
19
|
-
if (!context.parserServices.isJSON) {
|
20
|
-
return {};
|
21
|
-
}
|
22
|
-
return {
|
23
|
-
JSONLiteral(node) {
|
24
|
-
if (node.bigint != null) {
|
25
|
-
context.report({
|
26
|
-
loc: node.loc,
|
27
|
-
messageId: "unexpected",
|
28
|
-
});
|
29
|
-
}
|
30
|
-
},
|
31
|
-
};
|
32
|
-
},
|
33
|
-
});
|