@alexlit/lint-kit 167.2.0 → 167.4.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/package.json +1 -1
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/LICENSE +21 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/README.md +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.d.ts +23 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/base.js +25 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.d.ts +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/base.js +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.d.ts +1194 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/flat/recommended.js +39 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.d.ts +29 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/configs/recommended.js +29 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.d.ts +2532 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/index.js +62 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/key-format-style.js +247 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-component.js +85 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-place-attr.js +41 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-i18n-places-prop.js +36 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-modulo-syntax.js +94 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-tc.js +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-deprecated-v-t.js +33 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-duplicate-keys-in-locale.js +271 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-dynamic-keys.js +105 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-html-messages.js +137 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-i18n-t-path-prop.js +44 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys-in-other-locales.js +264 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-missing-keys.js +111 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-raw-text.js +575 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unknown-locale.js +198 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-unused-keys.js +456 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/no-v-html.js +50 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-linked-key-with-paren.js +108 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/prefer-sfc-lang-attr.js +58 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/sfc-locale-attr.js +65 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/rules/valid-message-syntax.js +186 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.d.ts +216 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/eslint.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.d.ts +5 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/i18n.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/index.js +22 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.d.ts +7 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/nodes.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.d.ts +8 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/settings.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.d.ts +38 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/types.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.d.ts +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/types/vue-parser-services.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-function.js +11 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/cache-loader.js +27 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/casing.js +101 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.d.ts +13 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-keys.js +160 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/collect-linked-keys.js +49 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.d.ts +3 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/compat.js +35 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/default-timeouts.js +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/get-cwd.js +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.d.ts +15 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/glob-utils.js +154 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.d.ts +43 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/ignored-paths.js +234 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.d.ts +25 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/index.js +446 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/key-path.js +27 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.d.ts +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/locale-messages.js +187 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.d.ts +8 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser-v9.js +40 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.d.ts +5 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/parser.js +18 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.d.ts +6 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/traverser.js +31 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.d.ts +28 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/message-compiler/utils.js +279 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-flat-config.js +11 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/build-parser-using-legacy-config.js +46 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.d.ts +4 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/index.js +18 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.d.ts +3 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/parse-by-parser.js +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/should-use-flat-config.js +54 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.d.ts +1 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parser-config-resolver/worker.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.d.ts +4 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/parsers/index.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.d.ts +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/path-utils.js +21 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.d.ts +1 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/regexp.js +16 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.d.ts +10 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/resource-loader.js +32 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.d.ts +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/dist/utils/rule.js +75 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/globals.json +3345 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.d.ts +3452 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/index.js +2 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/license +9 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/package.json +117 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/node_modules/globals/readme.md +42 -0
- package/packages/config-eslint/node_modules/@intlify/eslint-plugin-vue-i18n/package.json +147 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/LICENSE +21 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/README.md +332 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.d.ts +667 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js +6642 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/index.js.map +1 -0
- package/packages/config-eslint/node_modules/vue-eslint-parser/package.json +100 -0
- package/packages/config-eslint/package.json +5 -5
- package/packages/config-eslint/plugins/unicorn.js +2 -0
- package/packages/config-prettier/package.json +3 -3
- package/packages/config-stylelint/package.json +3 -3
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue_eslint_parser_1 = require("vue-eslint-parser");
|
|
3
|
+
const jsonc_eslint_parser_1 = require("jsonc-eslint-parser");
|
|
4
|
+
const index_1 = require("../utils/index");
|
|
5
|
+
const casing_1 = require("../utils/casing");
|
|
6
|
+
const rule_1 = require("../utils/rule");
|
|
7
|
+
const regexp_1 = require("../utils/regexp");
|
|
8
|
+
const compat_1 = require("../utils/compat");
|
|
9
|
+
function getFixQuote(quotes, code) {
|
|
10
|
+
if (!code.includes('\n')) {
|
|
11
|
+
for (const q of ["'", '"']) {
|
|
12
|
+
if (!quotes.has(q) && !code.includes(q)) {
|
|
13
|
+
return q;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (!quotes.has('`') && !code.includes('`')) {
|
|
18
|
+
return '`';
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const hasOnlyWhitespace = (value) => /^[\r\n\s\t\f\v]+$/.test(value);
|
|
23
|
+
const INNER_START_OFFSET = '<template>'.length;
|
|
24
|
+
function getTargetAttrs(tagName, config) {
|
|
25
|
+
const result = [];
|
|
26
|
+
for (const { name, attrs } of config.attributes) {
|
|
27
|
+
name.lastIndex = 0;
|
|
28
|
+
if (name.test(tagName)) {
|
|
29
|
+
result.push(...attrs);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if ((0, casing_1.isKebabCase)(tagName)) {
|
|
33
|
+
result.push(...getTargetAttrs((0, casing_1.pascalCase)(tagName), config));
|
|
34
|
+
}
|
|
35
|
+
return new Set(result);
|
|
36
|
+
}
|
|
37
|
+
function calculateRange(node, base) {
|
|
38
|
+
const range = node.range;
|
|
39
|
+
if (!base) {
|
|
40
|
+
return range;
|
|
41
|
+
}
|
|
42
|
+
const offset = base.range[0] + 1 - INNER_START_OFFSET;
|
|
43
|
+
return [offset + range[0], offset + range[1]];
|
|
44
|
+
}
|
|
45
|
+
function calculateLoc(node, base, context) {
|
|
46
|
+
if (!base) {
|
|
47
|
+
return node.loc;
|
|
48
|
+
}
|
|
49
|
+
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
50
|
+
const range = calculateRange(node, base);
|
|
51
|
+
return {
|
|
52
|
+
start: sourceCode.getLocFromIndex(range[0]),
|
|
53
|
+
end: sourceCode.getLocFromIndex(range[1])
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function testValue(value, config) {
|
|
57
|
+
if (typeof value === 'string') {
|
|
58
|
+
return (hasOnlyWhitespace(value) ||
|
|
59
|
+
config.ignorePattern.test(value.trim()) ||
|
|
60
|
+
config.ignoreText.includes(value.trim()));
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function checkVAttributeDirective(context, node, config, baseNode, scope) {
|
|
67
|
+
const attrNode = node.parent;
|
|
68
|
+
if (attrNode.key && attrNode.key.type === 'VDirectiveKey') {
|
|
69
|
+
if ((attrNode.key.name === 'text' ||
|
|
70
|
+
attrNode.key.name.name === 'text') &&
|
|
71
|
+
node.expression) {
|
|
72
|
+
checkExpressionContainerText(context, node.expression, config, baseNode, scope);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function checkVExpressionContainer(context, node, config, baseNode, scope) {
|
|
77
|
+
if (!node.expression) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (node.parent && node.parent.type === 'VElement') {
|
|
81
|
+
checkExpressionContainerText(context, node.expression, config, baseNode, scope);
|
|
82
|
+
}
|
|
83
|
+
else if (node.parent &&
|
|
84
|
+
node.parent.type === 'VAttribute' &&
|
|
85
|
+
node.parent.directive) {
|
|
86
|
+
checkVAttributeDirective(context, node, config, baseNode, scope);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function checkExpressionContainerText(context, expression, config, baseNode, scope) {
|
|
90
|
+
if ((0, index_1.isStaticLiteral)(expression)) {
|
|
91
|
+
checkLiteral(context, expression, config, baseNode, scope);
|
|
92
|
+
}
|
|
93
|
+
else if (expression.type === 'ConditionalExpression') {
|
|
94
|
+
const targets = [expression.consequent, expression.alternate];
|
|
95
|
+
targets.forEach(target => {
|
|
96
|
+
if ((0, index_1.isStaticLiteral)(target)) {
|
|
97
|
+
checkLiteral(context, target, config, baseNode, scope);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function checkLiteral(context, literal, config, baseNode, scope) {
|
|
103
|
+
const value = (0, index_1.getStaticLiteralValue)(literal);
|
|
104
|
+
if (testValue(value, config)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const loc = calculateLoc(literal, baseNode, context);
|
|
108
|
+
context.report({
|
|
109
|
+
loc,
|
|
110
|
+
message: `raw text '${value}' is used`,
|
|
111
|
+
suggest: buildSuggest()
|
|
112
|
+
});
|
|
113
|
+
function buildSuggest() {
|
|
114
|
+
if (scope === 'template-option') {
|
|
115
|
+
if (!withoutEscape(context, baseNode)) {
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
else if (scope !== 'template') {
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
const replaceRange = calculateRange(literal, baseNode);
|
|
123
|
+
const suggest = [];
|
|
124
|
+
for (const key of extractMessageKeys(context, `${value}`)) {
|
|
125
|
+
suggest.push({
|
|
126
|
+
desc: `Replace to "$t('${key}')".`,
|
|
127
|
+
fix(fixer) {
|
|
128
|
+
return fixer.replaceTextRange(replaceRange, `$t('${key}')`);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
const i18nBlocks = getFixableI18nBlocks(context, `${value}`);
|
|
133
|
+
if (i18nBlocks) {
|
|
134
|
+
suggest.push({
|
|
135
|
+
desc: "Add the resource to the '<i18n>' block.",
|
|
136
|
+
fix(fixer) {
|
|
137
|
+
return generateFixAddI18nBlock(context, fixer, i18nBlocks, `${value}`, [
|
|
138
|
+
fixer.insertTextBeforeRange(replaceRange, '$t('),
|
|
139
|
+
fixer.insertTextAfterRange(replaceRange, ')')
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return suggest;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function checkVAttribute(context, attribute, config, baseNode, scope) {
|
|
148
|
+
if (!attribute.value) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const literal = attribute.value;
|
|
152
|
+
const value = literal.value;
|
|
153
|
+
if (testValue(value, config)) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
const loc = calculateLoc(literal, baseNode, context);
|
|
157
|
+
context.report({
|
|
158
|
+
loc,
|
|
159
|
+
message: `raw text '${value}' is used`,
|
|
160
|
+
suggest: buildSuggest()
|
|
161
|
+
});
|
|
162
|
+
function buildSuggest() {
|
|
163
|
+
if (scope === 'template-option') {
|
|
164
|
+
if (!withoutEscape(context, baseNode)) {
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else if (scope !== 'template') {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
const literalRange = calculateRange(literal, baseNode);
|
|
172
|
+
const replaceRange = [literalRange[0] + 1, literalRange[1] - 1];
|
|
173
|
+
const keyRange = calculateRange(attribute.key, baseNode);
|
|
174
|
+
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
175
|
+
const attrQuote = sourceCode.text[literalRange[0]];
|
|
176
|
+
const quotes = new Set(attrQuote);
|
|
177
|
+
if (baseNode) {
|
|
178
|
+
const baseQuote = sourceCode.text[baseNode.range[0]];
|
|
179
|
+
quotes.add(baseQuote);
|
|
180
|
+
}
|
|
181
|
+
const suggest = [];
|
|
182
|
+
for (const key of extractMessageKeys(context, `${value}`)) {
|
|
183
|
+
const quote = getFixQuote(quotes, key);
|
|
184
|
+
if (quote) {
|
|
185
|
+
suggest.push({
|
|
186
|
+
desc: `Replace to "$t('${key}')".`,
|
|
187
|
+
fix(fixer) {
|
|
188
|
+
return [
|
|
189
|
+
fixer.insertTextBeforeRange(keyRange, ':'),
|
|
190
|
+
fixer.replaceTextRange(replaceRange, `$t(${quote}${key}${quote})`)
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
const i18nBlocks = getFixableI18nBlocks(context, `${value}`);
|
|
197
|
+
const quote = getFixQuote(quotes, sourceCode.text.slice(...replaceRange));
|
|
198
|
+
if (i18nBlocks && quote) {
|
|
199
|
+
suggest.push({
|
|
200
|
+
desc: "Add the resource to the '<i18n>' block.",
|
|
201
|
+
fix(fixer) {
|
|
202
|
+
return generateFixAddI18nBlock(context, fixer, i18nBlocks, `${value}`, [
|
|
203
|
+
fixer.insertTextBeforeRange(keyRange, ':'),
|
|
204
|
+
fixer.insertTextBeforeRange(replaceRange, `$t(${quote}`),
|
|
205
|
+
fixer.insertTextAfterRange(replaceRange, `${quote})`)
|
|
206
|
+
]);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
return suggest;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function checkText(context, textNode, config, baseNode, scope) {
|
|
214
|
+
const value = textNode.value;
|
|
215
|
+
if (testValue(value, config)) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const loc = calculateLoc(textNode, baseNode, context);
|
|
219
|
+
context.report({
|
|
220
|
+
loc,
|
|
221
|
+
message: `raw text '${value}' is used`,
|
|
222
|
+
suggest: buildSuggest()
|
|
223
|
+
});
|
|
224
|
+
function buildSuggest() {
|
|
225
|
+
if (scope === 'template-option') {
|
|
226
|
+
if (!withoutEscape(context, baseNode)) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const replaceRange = calculateRange(textNode, baseNode);
|
|
231
|
+
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
232
|
+
const quotes = new Set();
|
|
233
|
+
if (baseNode) {
|
|
234
|
+
const baseQuote = sourceCode.text[baseNode.range[0]];
|
|
235
|
+
quotes.add(baseQuote);
|
|
236
|
+
}
|
|
237
|
+
const suggest = [];
|
|
238
|
+
for (const key of extractMessageKeys(context, value)) {
|
|
239
|
+
const quote = getFixQuote(quotes, key);
|
|
240
|
+
if (quote) {
|
|
241
|
+
const before = `${scope === 'jsx' ? '{' : '{{'}$t(${quote}`;
|
|
242
|
+
const after = `${quote})${scope === 'jsx' ? '}' : '}}'}`;
|
|
243
|
+
suggest.push({
|
|
244
|
+
desc: `Replace to "${before}${key}${after}".`,
|
|
245
|
+
fix(fixer) {
|
|
246
|
+
return fixer.replaceTextRange(replaceRange, before + key + after);
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const i18nBlocks = getFixableI18nBlocks(context, `${value}`);
|
|
252
|
+
const quote = getFixQuote(quotes, sourceCode.text.slice(...replaceRange));
|
|
253
|
+
if (i18nBlocks && quote) {
|
|
254
|
+
const before = `${scope === 'jsx' ? '{' : '{{'}$t(${quote}`;
|
|
255
|
+
const after = `${quote})${scope === 'jsx' ? '}' : '}}'}`;
|
|
256
|
+
suggest.push({
|
|
257
|
+
desc: "Add the resource to the '<i18n>' block.",
|
|
258
|
+
fix(fixer) {
|
|
259
|
+
return generateFixAddI18nBlock(context, fixer, i18nBlocks, `${value}`, [
|
|
260
|
+
fixer.insertTextBeforeRange(replaceRange, before),
|
|
261
|
+
fixer.insertTextAfterRange(replaceRange, after)
|
|
262
|
+
]);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
return suggest;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
function findVariable(variables, name) {
|
|
270
|
+
return variables.find(variable => variable.name === name);
|
|
271
|
+
}
|
|
272
|
+
function getComponentTemplateValueNode(context, node) {
|
|
273
|
+
const templateNode = node.properties.find((p) => p.type === 'Property' &&
|
|
274
|
+
p.key.type === 'Identifier' &&
|
|
275
|
+
p.key.name === 'template');
|
|
276
|
+
if (templateNode) {
|
|
277
|
+
if ((0, index_1.isStaticLiteral)(templateNode.value)) {
|
|
278
|
+
return templateNode.value;
|
|
279
|
+
}
|
|
280
|
+
else if (templateNode.value.type === 'Identifier') {
|
|
281
|
+
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
282
|
+
const templateVariable = findVariable(sourceCode.getScope(node).variables, templateNode.value.name);
|
|
283
|
+
if (templateVariable) {
|
|
284
|
+
const varDeclNode = templateVariable.defs[0]
|
|
285
|
+
.node;
|
|
286
|
+
if (varDeclNode.init) {
|
|
287
|
+
if ((0, index_1.isStaticLiteral)(varDeclNode.init)) {
|
|
288
|
+
return varDeclNode.init;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
return null;
|
|
295
|
+
}
|
|
296
|
+
function getComponentTemplateNode(node) {
|
|
297
|
+
return (0, vue_eslint_parser_1.parse)(`<template>${(0, index_1.getStaticLiteralValue)(node)}</template>`, {})
|
|
298
|
+
.templateBody;
|
|
299
|
+
}
|
|
300
|
+
function withoutEscape(context, baseNode) {
|
|
301
|
+
if (!baseNode) {
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
305
|
+
const sourceText = sourceCode.getText(baseNode).slice(1, -1);
|
|
306
|
+
const templateText = `${(0, index_1.getStaticLiteralValue)(baseNode)}`;
|
|
307
|
+
return sourceText === templateText;
|
|
308
|
+
}
|
|
309
|
+
function getFixableI18nBlocks(context, newKey) {
|
|
310
|
+
var _a, _b;
|
|
311
|
+
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
312
|
+
const df = (_b = (_a = sourceCode.parserServices).getDocumentFragment) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
313
|
+
if (!df) {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
const i18nBlocks = [];
|
|
317
|
+
for (const i18n of df.children.filter(index_1.isI18nBlock)) {
|
|
318
|
+
const attrs = (0, index_1.getStaticAttributes)(i18n);
|
|
319
|
+
if (attrs.src != null ||
|
|
320
|
+
(attrs.lang != null && attrs.lang !== 'json' && attrs.lang !== 'json5')) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
const textNode = i18n.children[0];
|
|
324
|
+
const sourceString = textNode != null && textNode.type === 'VText' && textNode.value;
|
|
325
|
+
if (!sourceString) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
try {
|
|
329
|
+
const ast = (0, jsonc_eslint_parser_1.parseJSON)(sourceString);
|
|
330
|
+
const root = ast.body[0].expression;
|
|
331
|
+
if (root.type !== 'JSONObjectExpression') {
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
334
|
+
const objects = [];
|
|
335
|
+
if (attrs.locale) {
|
|
336
|
+
objects.push(root);
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
for (const prop of root.properties) {
|
|
340
|
+
if (prop.value.type !== 'JSONObjectExpression') {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
objects.push(prop.value);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
for (const objNode of objects) {
|
|
347
|
+
if (objNode.properties.some(prop => {
|
|
348
|
+
const keyValue = `${(0, jsonc_eslint_parser_1.getStaticJSONValue)(prop.key)}`;
|
|
349
|
+
return keyValue === newKey;
|
|
350
|
+
})) {
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
const offset = textNode.range[0];
|
|
355
|
+
const getIndex = (index) => offset + index;
|
|
356
|
+
i18nBlocks.push({
|
|
357
|
+
attrs,
|
|
358
|
+
i18n,
|
|
359
|
+
objects,
|
|
360
|
+
offsets: {
|
|
361
|
+
getLoc: (index) => {
|
|
362
|
+
return sourceCode.getLocFromIndex(getIndex(index));
|
|
363
|
+
},
|
|
364
|
+
getIndex
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
catch (_c) {
|
|
369
|
+
return null;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return i18nBlocks;
|
|
373
|
+
}
|
|
374
|
+
function* generateFixAddI18nBlock(context, fixer, i18nBlocks, resource, replaceFixes) {
|
|
375
|
+
const sourceCode = (0, compat_1.getSourceCode)(context);
|
|
376
|
+
const text = JSON.stringify(resource);
|
|
377
|
+
const df = sourceCode.parserServices.getDocumentFragment();
|
|
378
|
+
const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore();
|
|
379
|
+
if (!i18nBlocks.length) {
|
|
380
|
+
let baseToken = df.children.find(index_1.isVElement);
|
|
381
|
+
let beforeToken = tokenStore.getTokenBefore(baseToken, {
|
|
382
|
+
includeComments: true
|
|
383
|
+
});
|
|
384
|
+
while (beforeToken && beforeToken.type === 'HTMLComment') {
|
|
385
|
+
baseToken = beforeToken;
|
|
386
|
+
beforeToken = tokenStore.getTokenBefore(beforeToken, {
|
|
387
|
+
includeComments: true
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
yield fixer.insertTextBeforeRange(baseToken.range, `<i18n>\n{\n "en": {\n ${text}: ${text}\n }\n}\n</i18n>\n\n`);
|
|
391
|
+
yield* replaceFixes;
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
const replaceFix = replaceFixes[0];
|
|
395
|
+
const after = i18nBlocks.find(e => replaceFix.range[1] < e.i18n.range[0]);
|
|
396
|
+
for (const { i18n, offsets, objects } of i18nBlocks) {
|
|
397
|
+
if (after && after.i18n === i18n) {
|
|
398
|
+
yield* replaceFixes;
|
|
399
|
+
}
|
|
400
|
+
for (const objectNode of objects) {
|
|
401
|
+
const first = objectNode.properties[0];
|
|
402
|
+
let indent = `${/^\s*/.exec(sourceCode.lines[offsets.getLoc(objectNode.range[0]).line - 1])[0]} `;
|
|
403
|
+
let next = '';
|
|
404
|
+
if (first) {
|
|
405
|
+
if (objectNode.loc.start.line === first.loc.start.line) {
|
|
406
|
+
next = `,\n${indent}`;
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
indent = /^\s*/.exec(sourceCode.lines[offsets.getLoc(first.range[0]).line - 1])[0];
|
|
410
|
+
next = ',';
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
yield fixer.insertTextAfterRange([
|
|
414
|
+
offsets.getIndex(objectNode.range[0]),
|
|
415
|
+
offsets.getIndex(objectNode.range[0] + 1)
|
|
416
|
+
], `\n${indent}${text}: ${text}${next}`);
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
if (after == null) {
|
|
420
|
+
yield* replaceFixes;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
function extractMessageKeys(context, targetValue) {
|
|
424
|
+
const keys = new Set();
|
|
425
|
+
const localeMessages = (0, index_1.getLocaleMessages)(context, {
|
|
426
|
+
ignoreMissingSettingsError: true
|
|
427
|
+
});
|
|
428
|
+
for (const localeMessage of localeMessages.localeMessages) {
|
|
429
|
+
for (const locale of localeMessage.locales) {
|
|
430
|
+
const messages = localeMessage.getMessagesFromLocale(locale);
|
|
431
|
+
for (const key of extractMessageKeysFromObject(messages, [])) {
|
|
432
|
+
keys.add(key);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
return [...keys].sort();
|
|
437
|
+
function* extractMessageKeysFromObject(messages, paths) {
|
|
438
|
+
for (const key of Object.keys(messages)) {
|
|
439
|
+
const value = messages[key];
|
|
440
|
+
if (value == null) {
|
|
441
|
+
continue;
|
|
442
|
+
}
|
|
443
|
+
if (typeof value !== 'object') {
|
|
444
|
+
if (targetValue === value) {
|
|
445
|
+
yield [...paths, key].join('.');
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
else {
|
|
449
|
+
yield* extractMessageKeysFromObject(value, [...paths, key]);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function parseTargetAttrs(options) {
|
|
455
|
+
const regexps = [];
|
|
456
|
+
for (const tagName of Object.keys(options)) {
|
|
457
|
+
const attrs = new Set(options[tagName]);
|
|
458
|
+
regexps.push({
|
|
459
|
+
name: (0, regexp_1.toRegExp)(tagName),
|
|
460
|
+
attrs
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
return regexps;
|
|
464
|
+
}
|
|
465
|
+
function create(context) {
|
|
466
|
+
const options = context.options[0] || {};
|
|
467
|
+
const config = {
|
|
468
|
+
attributes: [],
|
|
469
|
+
ignorePattern: /^$/,
|
|
470
|
+
ignoreNodes: [],
|
|
471
|
+
ignoreText: []
|
|
472
|
+
};
|
|
473
|
+
if (options.ignorePattern) {
|
|
474
|
+
config.ignorePattern = new RegExp(options.ignorePattern, 'u');
|
|
475
|
+
}
|
|
476
|
+
if (options.ignoreNodes) {
|
|
477
|
+
config.ignoreNodes = options.ignoreNodes;
|
|
478
|
+
}
|
|
479
|
+
if (options.ignoreText) {
|
|
480
|
+
config.ignoreText = options.ignoreText;
|
|
481
|
+
}
|
|
482
|
+
if (options.attributes) {
|
|
483
|
+
config.attributes = parseTargetAttrs(options.attributes);
|
|
484
|
+
}
|
|
485
|
+
const templateVisitor = {
|
|
486
|
+
VExpressionContainer(node, baseNode = null, scope = 'template') {
|
|
487
|
+
checkVExpressionContainer(context, node, config, baseNode, scope);
|
|
488
|
+
},
|
|
489
|
+
VAttribute(node, baseNode = null, scope = 'template') {
|
|
490
|
+
if (node.directive) {
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
const tagName = node.parent.parent.rawName;
|
|
494
|
+
const attrName = node.key.name;
|
|
495
|
+
if (!getTargetAttrs(tagName, config).has(attrName)) {
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
checkVAttribute(context, node, config, baseNode, scope);
|
|
499
|
+
},
|
|
500
|
+
VText(node, baseNode = null, scope = 'template') {
|
|
501
|
+
if (config.ignoreNodes.includes(node.parent.name)) {
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
checkText(context, node, config, baseNode, scope);
|
|
505
|
+
}
|
|
506
|
+
};
|
|
507
|
+
return (0, index_1.defineTemplateBodyVisitor)(context, templateVisitor, {
|
|
508
|
+
ObjectExpression(node) {
|
|
509
|
+
const valueNode = getComponentTemplateValueNode(context, node);
|
|
510
|
+
if (!valueNode) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if ((0, index_1.getVueObjectType)(context, node) == null ||
|
|
514
|
+
(valueNode.type === 'Literal' && valueNode.value == null)) {
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
const templateNode = getComponentTemplateNode(valueNode);
|
|
518
|
+
vue_eslint_parser_1.AST.traverseNodes(templateNode, {
|
|
519
|
+
enterNode(node) {
|
|
520
|
+
const visitor = templateVisitor[node.type];
|
|
521
|
+
if (visitor) {
|
|
522
|
+
visitor(node, valueNode, 'template-option');
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
leaveNode() {
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
},
|
|
529
|
+
JSXText(node) {
|
|
530
|
+
checkText(context, node, config, null, 'jsx');
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
module.exports = (0, rule_1.createRule)({
|
|
535
|
+
meta: {
|
|
536
|
+
type: 'suggestion',
|
|
537
|
+
docs: {
|
|
538
|
+
description: 'disallow to string literal in template or JSX',
|
|
539
|
+
category: 'Recommended',
|
|
540
|
+
url: 'https://eslint-plugin-vue-i18n.intlify.dev/rules/no-raw-text.html',
|
|
541
|
+
recommended: true
|
|
542
|
+
},
|
|
543
|
+
fixable: null,
|
|
544
|
+
hasSuggestions: true,
|
|
545
|
+
schema: [
|
|
546
|
+
{
|
|
547
|
+
type: 'object',
|
|
548
|
+
properties: {
|
|
549
|
+
attributes: {
|
|
550
|
+
type: 'object',
|
|
551
|
+
patternProperties: {
|
|
552
|
+
'^(?:\\S+|/.*/[a-z]*)$': {
|
|
553
|
+
type: 'array',
|
|
554
|
+
items: { type: 'string' },
|
|
555
|
+
uniqueItems: true
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
additionalProperties: false
|
|
559
|
+
},
|
|
560
|
+
ignoreNodes: {
|
|
561
|
+
type: 'array'
|
|
562
|
+
},
|
|
563
|
+
ignorePattern: {
|
|
564
|
+
type: 'string'
|
|
565
|
+
},
|
|
566
|
+
ignoreText: {
|
|
567
|
+
type: 'array'
|
|
568
|
+
}
|
|
569
|
+
},
|
|
570
|
+
additionalProperties: false
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
},
|
|
574
|
+
create
|
|
575
|
+
});
|