@bleedingdev/modern-js-code-tools 3.5.0-ultramodern.9 → 3.5.0-ultramodern.90
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/dist/cjs/cli/i18n-check.cjs +0 -6
- package/dist/cjs/cli/workspace-source-check.cjs +0 -3
- package/dist/cjs/oxlint-plugin/ast.cjs +181 -0
- package/dist/cjs/oxlint-plugin/options.cjs +172 -0
- package/dist/cjs/oxlint-plugin/rules/no-hardcoded-jsx-text.cjs +82 -0
- package/dist/cjs/oxlint-plugin/rules/no-legacy-mf-boundary-attributes.cjs +61 -0
- package/dist/cjs/oxlint-plugin/rules/no-literal-visible-jsx-attributes.cjs +74 -0
- package/dist/cjs/oxlint-plugin/rules/no-manual-locale-copy-branching.cjs +80 -0
- package/dist/cjs/oxlint-plugin/rules/no-split-translation-keys.cjs +70 -0
- package/dist/cjs/oxlint-plugin/rules/strict-effect-api-boundaries.cjs +84 -0
- package/dist/cjs/oxlint-plugin/types.cjs +18 -0
- package/dist/cjs/oxlint-plugin.cjs +100 -382
- package/dist/esm/cli/i18n-check.js +1 -1
- package/dist/esm/cli/workspace-source-check.js +1 -1
- package/dist/esm/oxlint-plugin/ast.js +83 -0
- package/dist/esm/oxlint-plugin/options.js +89 -0
- package/dist/esm/oxlint-plugin/rules/no-hardcoded-jsx-text.js +44 -0
- package/dist/esm/oxlint-plugin/rules/no-legacy-mf-boundary-attributes.js +23 -0
- package/dist/esm/oxlint-plugin/rules/no-literal-visible-jsx-attributes.js +36 -0
- package/dist/esm/oxlint-plugin/rules/no-manual-locale-copy-branching.js +42 -0
- package/dist/esm/oxlint-plugin/rules/no-split-translation-keys.js +32 -0
- package/dist/esm/oxlint-plugin/rules/strict-effect-api-boundaries.js +46 -0
- package/dist/esm/oxlint-plugin/types.js +0 -0
- package/dist/esm/oxlint-plugin.js +15 -367
- package/dist/esm-node/cli/i18n-check.js +1 -1
- package/dist/esm-node/cli/workspace-source-check.js +1 -1
- package/dist/esm-node/oxlint-plugin/ast.js +84 -0
- package/dist/esm-node/oxlint-plugin/options.js +90 -0
- package/dist/esm-node/oxlint-plugin/rules/no-hardcoded-jsx-text.js +45 -0
- package/dist/esm-node/oxlint-plugin/rules/no-legacy-mf-boundary-attributes.js +24 -0
- package/dist/esm-node/oxlint-plugin/rules/no-literal-visible-jsx-attributes.js +37 -0
- package/dist/esm-node/oxlint-plugin/rules/no-manual-locale-copy-branching.js +43 -0
- package/dist/esm-node/oxlint-plugin/rules/no-split-translation-keys.js +33 -0
- package/dist/esm-node/oxlint-plugin/rules/strict-effect-api-boundaries.js +47 -0
- package/dist/esm-node/oxlint-plugin/types.js +1 -0
- package/dist/esm-node/oxlint-plugin.js +15 -367
- package/dist/types/cli/i18n-check.d.ts +0 -2
- package/dist/types/cli/workspace-source-check.d.ts +0 -1
- package/dist/types/oxlint-plugin/ast.d.ts +22 -0
- package/dist/types/oxlint-plugin/options.d.ts +62 -0
- package/dist/types/oxlint-plugin/rules/no-hardcoded-jsx-text.d.ts +2 -0
- package/dist/types/oxlint-plugin/rules/no-legacy-mf-boundary-attributes.d.ts +2 -0
- package/dist/types/oxlint-plugin/rules/no-literal-visible-jsx-attributes.d.ts +2 -0
- package/dist/types/oxlint-plugin/rules/no-manual-locale-copy-branching.d.ts +2 -0
- package/dist/types/oxlint-plugin/rules/no-split-translation-keys.d.ts +2 -0
- package/dist/types/oxlint-plugin/rules/strict-effect-api-boundaries.d.ts +2 -0
- package/dist/types/oxlint-plugin/types.d.ts +60 -0
- package/dist/types/oxlint-plugin.d.ts +15 -56
- package/package.json +6 -7
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { expressionStringValue, getIgnorePattern, getNodeName, hasAllowedElementAncestor, hasIgnoreComment, hasLetters, normalizeVisibleText } from "../ast.js";
|
|
3
|
+
import { DEFAULT_ALLOWED_ELEMENTS, DEFAULT_IGNORE_COMMENT_PATTERN, DEFAULT_VISIBLE_ATTRIBUTES, attributeOptionsSchema, getAttributeRuleOption } from "../options.js";
|
|
4
|
+
const createNoLiteralVisibleJsxAttributesRule = ()=>({
|
|
5
|
+
meta: {
|
|
6
|
+
type: 'problem',
|
|
7
|
+
docs: {
|
|
8
|
+
description: 'Disallow literal user-visible JSX attribute text in UltraModern generated apps.'
|
|
9
|
+
},
|
|
10
|
+
schema: [
|
|
11
|
+
attributeOptionsSchema
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
create (context) {
|
|
15
|
+
const options = getAttributeRuleOption(context, {
|
|
16
|
+
allowElements: DEFAULT_ALLOWED_ELEMENTS,
|
|
17
|
+
ignoreCommentPattern: DEFAULT_IGNORE_COMMENT_PATTERN,
|
|
18
|
+
visibleAttributes: DEFAULT_VISIBLE_ATTRIBUTES
|
|
19
|
+
});
|
|
20
|
+
const visibleAttributes = new Set(options.visibleAttributes);
|
|
21
|
+
const allowedElements = new Set(options.allowElements);
|
|
22
|
+
const ignorePattern = getIgnorePattern(options);
|
|
23
|
+
return {
|
|
24
|
+
JSXAttribute (node) {
|
|
25
|
+
const attributeName = getNodeName(node.name);
|
|
26
|
+
if (!attributeName || !visibleAttributes.has(attributeName)) return;
|
|
27
|
+
const text = normalizeVisibleText(expressionStringValue(node.value) ?? '');
|
|
28
|
+
if (!text || !hasLetters(text) || hasAllowedElementAncestor(node, allowedElements) || hasIgnoreComment(node, context, ignorePattern)) return;
|
|
29
|
+
context.report({
|
|
30
|
+
node,
|
|
31
|
+
message: `Move literal ${attributeName} copy to locale resources: ${JSON.stringify(text)}`
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
export { createNoLiteralVisibleJsxAttributesRule };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { getSourceText } from "../ast.js";
|
|
3
|
+
const looksLikeLocaleTest = (context, node)=>{
|
|
4
|
+
const text = getSourceText(context, node);
|
|
5
|
+
return /\b(?:language|locale|lng|currentLanguage)\b/u.test(text) && /(?:={2,3}|!==?|\.\s*startsWith\s*\()/u.test(text) && /['"][a-z]{2}(?:-[A-Za-z0-9]+)?['"]/u.test(text);
|
|
6
|
+
};
|
|
7
|
+
const isAllowedBranchLiteral = (text)=>new Set([
|
|
8
|
+
'page',
|
|
9
|
+
'undefined',
|
|
10
|
+
'null',
|
|
11
|
+
'true',
|
|
12
|
+
'false'
|
|
13
|
+
]).has(text);
|
|
14
|
+
const createNoManualLocaleCopyBranchingRule = ()=>({
|
|
15
|
+
meta: {
|
|
16
|
+
type: 'problem',
|
|
17
|
+
docs: {
|
|
18
|
+
description: 'Disallow manual locale conditionals that choose user-visible copy.'
|
|
19
|
+
},
|
|
20
|
+
schema: []
|
|
21
|
+
},
|
|
22
|
+
create (context) {
|
|
23
|
+
const reportBranch = (node, text)=>{
|
|
24
|
+
context.report({
|
|
25
|
+
node,
|
|
26
|
+
message: `Move locale-specific copy branch to i18n resources: ${JSON.stringify(normalizeVisibleText(text))}`
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
ConditionalExpression (node) {
|
|
31
|
+
if (!node.test || !looksLikeLocaleTest(context, node.test)) return;
|
|
32
|
+
for (const branch of [
|
|
33
|
+
node.consequent,
|
|
34
|
+
node.alternate
|
|
35
|
+
]){
|
|
36
|
+
const text = expressionStringValue(branch);
|
|
37
|
+
if (text && hasLetters(text) && !isAllowedBranchLiteral(text.trim())) reportBranch(branch, text);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
export { createNoManualLocaleCopyBranchingRule };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { expressionStringValue, getCallExpressionName } from "../ast.js";
|
|
3
|
+
import { DEFAULT_TRANSLATION_FUNCTIONS, SPLIT_TRANSLATION_KEY_PATTERN, getSplitTranslationKeyRuleOption, translationOptionsSchema } from "../options.js";
|
|
4
|
+
const createNoSplitTranslationKeysRule = ()=>({
|
|
5
|
+
meta: {
|
|
6
|
+
type: 'problem',
|
|
7
|
+
docs: {
|
|
8
|
+
description: 'Disallow split phrase translation key suffixes such as .prefix and .suffix.'
|
|
9
|
+
},
|
|
10
|
+
schema: [
|
|
11
|
+
translationOptionsSchema
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
create (context) {
|
|
15
|
+
const options = getSplitTranslationKeyRuleOption(context, {
|
|
16
|
+
translationFunctions: DEFAULT_TRANSLATION_FUNCTIONS
|
|
17
|
+
});
|
|
18
|
+
const translationFunctions = new Set(options.translationFunctions);
|
|
19
|
+
return {
|
|
20
|
+
CallExpression (node) {
|
|
21
|
+
const calleeName = getCallExpressionName(node.callee);
|
|
22
|
+
if (!calleeName || !translationFunctions.has(calleeName)) return;
|
|
23
|
+
const key = expressionStringValue(node.arguments?.[0]);
|
|
24
|
+
if (!key || !SPLIT_TRANSLATION_KEY_PATTERN.test(key)) return;
|
|
25
|
+
context.report({
|
|
26
|
+
node,
|
|
27
|
+
message: 'Keep translator-owned phrases whole instead of using split translation keys.'
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
export { createNoSplitTranslationKeysRule };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import "node:module";
|
|
2
|
+
import { getSourceText, isApiEntryFile, isApiSourceFile, isForbiddenGeneratedEffectPath, isSharedApiContractFile, normalizeFilename, reportMissingProgramPattern, reportProgramPattern } from "../ast.js";
|
|
3
|
+
const createStrictEffectApiBoundariesRule = ()=>({
|
|
4
|
+
meta: {
|
|
5
|
+
type: 'problem',
|
|
6
|
+
docs: {
|
|
7
|
+
description: 'Disallow raw HTTP handlers and non-Effect API runtime drift in UltraModern workspaces.'
|
|
8
|
+
},
|
|
9
|
+
schema: []
|
|
10
|
+
},
|
|
11
|
+
create (context) {
|
|
12
|
+
return {
|
|
13
|
+
Program (node) {
|
|
14
|
+
const source = getSourceText(context, node);
|
|
15
|
+
const filename = normalizeFilename(context.filename);
|
|
16
|
+
const apiFile = isApiSourceFile(filename);
|
|
17
|
+
if (isForbiddenGeneratedEffectPath(filename)) context.report({
|
|
18
|
+
node,
|
|
19
|
+
message: 'Generated UltraModern workspaces use direct api/index.ts, shared/api.ts and src/api/* paths; api/effect, api/lambda, shared/effect and src/effect are forbidden.'
|
|
20
|
+
});
|
|
21
|
+
reportProgramPattern(context, node, source, /@modern-js\/plugin-bff\/hono-server/u, 'UltraModern API workspaces must not import Hono server helpers; use @modern-js/plugin-bff/effect-edge and HttpApi.');
|
|
22
|
+
reportProgramPattern(context, node, source, /\bruntimeFramework\s*(?::|=)\s*['"]hono['"]/u, 'UltraModern API apps must use bff.runtimeFramework: "effect".');
|
|
23
|
+
reportProgramPattern(context, node, source, /(?:from|import)\s*['"][^'"]*(?:api\/effect|shared\/effect)[^'"]*['"]|shared-effect-api/u, 'Import API code from direct api/index.ts, shared/api.ts or src/api/* paths, not api/effect, shared/effect or shared Effect API packages.');
|
|
24
|
+
reportProgramPattern(context, node, source, /\bstrictEffectApproach\s*(?::|=)\s*false\b/u, 'UltraModern API apps must keep strictEffectApproach enabled.');
|
|
25
|
+
if (isApiEntryFile(filename)) {
|
|
26
|
+
reportMissingProgramPattern(context, node, source, /\bdefineEffectBff\b/u, 'Generated API entries must export defineEffectBff(...).');
|
|
27
|
+
reportMissingProgramPattern(context, node, source, /\bHttpApiBuilder\b/u, 'Generated API entries must implement handlers through HttpApiBuilder.');
|
|
28
|
+
reportMissingProgramPattern(context, node, source, /\bLayer\b/u, 'Generated API entries must compose dependencies with Effect Layer.');
|
|
29
|
+
reportMissingProgramPattern(context, node, source, /from\s+['"]\.\.\/shared\/api\.ts['"]/u, 'Generated API entries must import the contract from ../shared/api.ts.');
|
|
30
|
+
}
|
|
31
|
+
if (isSharedApiContractFile(filename)) {
|
|
32
|
+
reportMissingProgramPattern(context, node, source, /\bHttpApi\.make\b/u, 'Generated shared API contracts must declare an HttpApi contract.');
|
|
33
|
+
reportMissingProgramPattern(context, node, source, /\bHttpApiGroup\.make\b/u, 'Generated shared API contracts must declare HttpApi groups.');
|
|
34
|
+
reportMissingProgramPattern(context, node, source, /\bHttpApiEndpoint\./u, 'Generated shared API contracts must declare endpoints through HttpApiEndpoint.');
|
|
35
|
+
reportMissingProgramPattern(context, node, source, /\bSchema\./u, 'Generated shared API contracts must model request, response and error shapes with Schema.');
|
|
36
|
+
}
|
|
37
|
+
if (!apiFile) return;
|
|
38
|
+
reportProgramPattern(context, node, source, /\bnew\s+Response\s*\(|\bResponse\.json\s*\(/u, 'API modules must not hand-build Response objects; model endpoints through Effect HttpApi and schemas.');
|
|
39
|
+
reportProgramPattern(context, node, source, /\b(?:request|req)\.(?:json|text|formData|arrayBuffer)\s*\(/u, 'API modules must not manually parse request bodies; use HttpApiEndpoint payload/query/params schemas.');
|
|
40
|
+
reportProgramPattern(context, node, source, /\bexport\s+const\s+handler\b|\bexport\s+default\s+async\b/u, 'API modules must not export raw request handlers; export defineEffectBff(...) from api/index.ts.');
|
|
41
|
+
reportProgramPattern(context, node, source, /\bcreateHandler\s*[:=]\s*(?!defineEffectBff\b)/u, 'API modules must not define unbranded handler factories; use defineEffectBff(...).');
|
|
42
|
+
reportProgramPattern(context, node, source, /\bSchema\.(?:UnknownFromJsonString|Unknown|Any)\b/u, 'API modules must use concrete request, response and error schemas; Schema.UnknownFromJsonString, Schema.Unknown and Schema.Any are forbidden in UltraModern API code.');
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
export { createStrictEffectApiBoundariesRule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "node:module";
|
|
@@ -1,371 +1,19 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const attributeOptionsSchema = {
|
|
18
|
-
type: 'object',
|
|
19
|
-
properties: {
|
|
20
|
-
...commonOptionsSchema.properties,
|
|
21
|
-
visibleAttributes: {
|
|
22
|
-
type: 'array',
|
|
23
|
-
items: {
|
|
24
|
-
type: 'string'
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
additionalProperties: false
|
|
29
|
-
};
|
|
30
|
-
const translationOptionsSchema = {
|
|
31
|
-
type: 'object',
|
|
32
|
-
properties: {
|
|
33
|
-
translationFunctions: {
|
|
34
|
-
type: 'array',
|
|
35
|
-
items: {
|
|
36
|
-
type: 'string'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
additionalProperties: false
|
|
41
|
-
};
|
|
42
|
-
const DEFAULT_VISIBLE_ATTRIBUTES = [
|
|
43
|
-
'aria-label',
|
|
44
|
-
"aria-description",
|
|
45
|
-
"aria-roledescription",
|
|
46
|
-
'aria-valuetext',
|
|
47
|
-
'alt',
|
|
48
|
-
'placeholder',
|
|
49
|
-
'title'
|
|
50
|
-
];
|
|
51
|
-
const DEFAULT_ALLOWED_ELEMENTS = [
|
|
52
|
-
'code',
|
|
53
|
-
'kbd',
|
|
54
|
-
'samp'
|
|
55
|
-
];
|
|
56
|
-
const DEFAULT_TRANSLATION_FUNCTIONS = [
|
|
57
|
-
't'
|
|
58
|
-
];
|
|
59
|
-
const DEFAULT_IGNORE_COMMENT_PATTERN = 'i18n-ignore';
|
|
60
|
-
const LETTER_PATTERN = /\p{L}/u;
|
|
61
|
-
const SPLIT_TRANSLATION_KEY_PATTERN = /\.(?:prefix|suffix|before|after)$/u;
|
|
62
|
-
const API_SOURCE_FILE_PATTERN = /(?:^|\/)(?:api\/|shared\/api\.[cm]?[jt]sx?$)/u;
|
|
63
|
-
const FORBIDDEN_GENERATED_EFFECT_PATH_PATTERN = /(?:^|\/)(?:(?:apps|verticals)\/[^/]+\/(?:api\/(?:effect|lambda)|shared\/effect|src\/effect))(?:\/|$)/u;
|
|
64
|
-
const API_ENTRY_PATTERN = /(?:^|\/)(?:apps|verticals)\/[^/]+\/api\/index\.[cm]?[jt]sx?$/u;
|
|
65
|
-
const SHARED_API_CONTRACT_PATTERN = /(?:^|\/)(?:apps|verticals)\/[^/]+\/shared\/api\.[cm]?[jt]sx?$/u;
|
|
66
|
-
const isRecord = (value)=>Boolean(value) && 'object' == typeof value && !Array.isArray(value);
|
|
67
|
-
const asStringArray = (value, fallback)=>Array.isArray(value) && value.every((item)=>'string' == typeof item) ? value : fallback;
|
|
68
|
-
const getCommonRuleOption = (context, defaults)=>{
|
|
69
|
-
const options = context.options?.[0];
|
|
70
|
-
if (!isRecord(options)) return defaults;
|
|
71
|
-
return {
|
|
72
|
-
allowElements: asStringArray(options.allowElements, defaults.allowElements),
|
|
73
|
-
ignoreCommentPattern: 'string' == typeof options.ignoreCommentPattern ? options.ignoreCommentPattern : defaults.ignoreCommentPattern
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
const getAttributeRuleOption = (context, defaults)=>{
|
|
77
|
-
const options = context.options?.[0];
|
|
78
|
-
const commonOptions = getCommonRuleOption(context, defaults);
|
|
79
|
-
return {
|
|
80
|
-
...commonOptions,
|
|
81
|
-
visibleAttributes: isRecord(options) ? asStringArray(options.visibleAttributes, defaults.visibleAttributes) : defaults.visibleAttributes
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
const getSplitTranslationKeyRuleOption = (context, defaults)=>{
|
|
85
|
-
const options = context.options?.[0];
|
|
86
|
-
if (!isRecord(options)) return defaults;
|
|
87
|
-
return {
|
|
88
|
-
translationFunctions: asStringArray(options.translationFunctions, defaults.translationFunctions)
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
const normalizeVisibleText = (value)=>value.replaceAll(/\s+/gu, ' ').trim();
|
|
92
|
-
const hasLetters = (value)=>LETTER_PATTERN.test(value);
|
|
93
|
-
const getNodeName = (node)=>{
|
|
94
|
-
if (!node) return;
|
|
95
|
-
if ('string' == typeof node.name) return node.name;
|
|
96
|
-
if ('JSXIdentifier' === node.type && isRecord(node.name) && 'string' == typeof node.name.name) return node.name.name;
|
|
97
|
-
if ('JSXIdentifier' === node.type && 'string' == typeof node.name) return node.name;
|
|
98
|
-
if (('JSXMemberExpression' === node.type || 'MemberExpression' === node.type) && isRecord(node.property) && true !== node.computed) {
|
|
99
|
-
const objectName = getNodeName(node.object);
|
|
100
|
-
const propertyName = getNodeName(node.property);
|
|
101
|
-
return objectName && propertyName ? `${objectName}.${propertyName}` : propertyName;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const getJsxElementName = (node)=>{
|
|
105
|
-
if (node?.type !== 'JSXElement') return;
|
|
106
|
-
return getNodeName(node.openingElement?.name);
|
|
107
|
-
};
|
|
108
|
-
const hasAllowedElementAncestor = (node, allowedElements)=>{
|
|
109
|
-
let current = node;
|
|
110
|
-
while(current){
|
|
111
|
-
const elementName = getJsxElementName(current);
|
|
112
|
-
if (elementName && allowedElements.has(elementName)) return true;
|
|
113
|
-
current = current.parent;
|
|
114
|
-
}
|
|
115
|
-
return false;
|
|
116
|
-
};
|
|
117
|
-
const getTemplateLiteralValue = (node)=>{
|
|
118
|
-
if ('TemplateLiteral' !== node.type || (node.expressions?.length ?? 0) > 0) return;
|
|
119
|
-
const quasi = node.quasis?.[0];
|
|
120
|
-
if (!isRecord(quasi?.value)) return;
|
|
121
|
-
const cooked = quasi.value.cooked;
|
|
122
|
-
const raw = quasi.value.raw;
|
|
123
|
-
return 'string' == typeof cooked ? cooked : 'string' == typeof raw ? raw : void 0;
|
|
124
|
-
};
|
|
125
|
-
const getStringLiteralValue = (node)=>{
|
|
126
|
-
if (!node) return;
|
|
127
|
-
if (('Literal' === node.type || 'StringLiteral' === node.type) && 'string' == typeof node.value) return node.value;
|
|
128
|
-
return getTemplateLiteralValue(node);
|
|
129
|
-
};
|
|
130
|
-
const expressionStringValue = (node)=>getStringLiteralValue(node?.type === 'JSXExpressionContainer' ? node.expression : node);
|
|
131
|
-
const getLine = (node)=>node.loc?.start?.line;
|
|
132
|
-
const hasIgnoreComment = (node, context, pattern)=>{
|
|
133
|
-
const sourceCode = context.getSourceCode?.();
|
|
134
|
-
const nodeLine = getLine(node);
|
|
135
|
-
if (!sourceCode?.getAllComments || void 0 === nodeLine) return false;
|
|
136
|
-
return sourceCode.getAllComments().some((comment)=>{
|
|
137
|
-
const commentValue = String(comment.value ?? '');
|
|
138
|
-
if (!pattern.test(commentValue)) return false;
|
|
139
|
-
const startLine = comment.loc?.start?.line;
|
|
140
|
-
const endLine = comment.loc?.end?.line ?? startLine;
|
|
141
|
-
return void 0 !== startLine && void 0 !== endLine && startLine <= nodeLine + 1 && endLine >= nodeLine - 1;
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
const getIgnorePattern = (options)=>new RegExp(options.ignoreCommentPattern, 'u');
|
|
145
|
-
const reportVisibleText = (context, node, text)=>{
|
|
146
|
-
context.report({
|
|
147
|
-
node,
|
|
148
|
-
message: `Move user-visible JSX text to locale resources: ${JSON.stringify(text)}`
|
|
149
|
-
});
|
|
150
|
-
};
|
|
151
|
-
const createNoHardcodedJsxTextRule = ()=>({
|
|
152
|
-
meta: {
|
|
153
|
-
type: 'problem',
|
|
154
|
-
docs: {
|
|
155
|
-
description: 'Disallow literal user-visible text in JSX children in UltraModern generated apps.'
|
|
156
|
-
},
|
|
157
|
-
schema: [
|
|
158
|
-
commonOptionsSchema
|
|
159
|
-
]
|
|
160
|
-
},
|
|
161
|
-
create (context) {
|
|
162
|
-
const options = getCommonRuleOption(context, {
|
|
163
|
-
allowElements: DEFAULT_ALLOWED_ELEMENTS,
|
|
164
|
-
ignoreCommentPattern: DEFAULT_IGNORE_COMMENT_PATTERN
|
|
165
|
-
});
|
|
166
|
-
const allowedElements = new Set(options.allowElements);
|
|
167
|
-
const ignorePattern = getIgnorePattern(options);
|
|
168
|
-
const shouldSkipNode = (node)=>hasAllowedElementAncestor(node, allowedElements) || hasIgnoreComment(node, context, ignorePattern);
|
|
169
|
-
return {
|
|
170
|
-
JSXText (node) {
|
|
171
|
-
const text = normalizeVisibleText(String(node.value ?? ''));
|
|
172
|
-
if (!text || !hasLetters(text) || shouldSkipNode(node)) return;
|
|
173
|
-
reportVisibleText(context, node, text);
|
|
174
|
-
},
|
|
175
|
-
JSXExpressionContainer (node) {
|
|
176
|
-
if (node.parent?.type !== 'JSXElement' && node.parent?.type !== 'JSXFragment') return;
|
|
177
|
-
const text = normalizeVisibleText(expressionStringValue(node.expression) ?? '');
|
|
178
|
-
if (!text || !hasLetters(text) || shouldSkipNode(node)) return;
|
|
179
|
-
reportVisibleText(context, node, text);
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
const createNoLiteralVisibleJsxAttributesRule = ()=>({
|
|
185
|
-
meta: {
|
|
186
|
-
type: 'problem',
|
|
187
|
-
docs: {
|
|
188
|
-
description: 'Disallow literal user-visible JSX attribute text in UltraModern generated apps.'
|
|
189
|
-
},
|
|
190
|
-
schema: [
|
|
191
|
-
attributeOptionsSchema
|
|
192
|
-
]
|
|
193
|
-
},
|
|
194
|
-
create (context) {
|
|
195
|
-
const options = getAttributeRuleOption(context, {
|
|
196
|
-
allowElements: DEFAULT_ALLOWED_ELEMENTS,
|
|
197
|
-
ignoreCommentPattern: DEFAULT_IGNORE_COMMENT_PATTERN,
|
|
198
|
-
visibleAttributes: DEFAULT_VISIBLE_ATTRIBUTES
|
|
199
|
-
});
|
|
200
|
-
const visibleAttributes = new Set(options.visibleAttributes);
|
|
201
|
-
const ignorePattern = getIgnorePattern(options);
|
|
202
|
-
return {
|
|
203
|
-
JSXAttribute (node) {
|
|
204
|
-
const attributeName = getNodeName(node.name);
|
|
205
|
-
if (!attributeName || !visibleAttributes.has(attributeName)) return;
|
|
206
|
-
const text = normalizeVisibleText(expressionStringValue(node.value) ?? '');
|
|
207
|
-
if (!text || !hasLetters(text) || hasIgnoreComment(node, context, ignorePattern)) return;
|
|
208
|
-
context.report({
|
|
209
|
-
node,
|
|
210
|
-
message: `Move literal ${attributeName} copy to locale resources: ${JSON.stringify(text)}`
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
const getSourceText = (context, node)=>context.getSourceCode?.().getText?.(node) ?? context.getSourceCode?.().text ?? '';
|
|
217
|
-
const normalizeFilename = (filePath)=>(filePath ?? '').replaceAll('\\', '/');
|
|
218
|
-
const isApiSourceFile = (filePath)=>API_SOURCE_FILE_PATTERN.test(normalizeFilename(filePath));
|
|
219
|
-
const isForbiddenGeneratedEffectPath = (filePath)=>FORBIDDEN_GENERATED_EFFECT_PATH_PATTERN.test(normalizeFilename(filePath));
|
|
220
|
-
const isApiEntryFile = (filePath)=>API_ENTRY_PATTERN.test(normalizeFilename(filePath));
|
|
221
|
-
const isSharedApiContractFile = (filePath)=>SHARED_API_CONTRACT_PATTERN.test(normalizeFilename(filePath));
|
|
222
|
-
const looksLikeLocaleTest = (context, node)=>{
|
|
223
|
-
const text = getSourceText(context, node);
|
|
224
|
-
return /\b(?:language|locale|lng|currentLanguage)\b/u.test(text) && /(?:={2,3}|!==?)/u.test(text) && /['"][a-z]{2}(?:-[A-Za-z0-9]+)?['"]/u.test(text);
|
|
225
|
-
};
|
|
226
|
-
const isAllowedBranchLiteral = (text)=>new Set([
|
|
227
|
-
'page',
|
|
228
|
-
'undefined',
|
|
229
|
-
'null',
|
|
230
|
-
'true',
|
|
231
|
-
'false'
|
|
232
|
-
]).has(text);
|
|
233
|
-
const createNoManualLocaleCopyBranchingRule = ()=>({
|
|
234
|
-
meta: {
|
|
235
|
-
type: 'problem',
|
|
236
|
-
docs: {
|
|
237
|
-
description: 'Disallow manual locale conditionals that choose user-visible copy.'
|
|
238
|
-
},
|
|
239
|
-
schema: []
|
|
240
|
-
},
|
|
241
|
-
create (context) {
|
|
242
|
-
const reportBranch = (node, text)=>{
|
|
243
|
-
context.report({
|
|
244
|
-
node,
|
|
245
|
-
message: `Move locale-specific copy branch to i18n resources: ${JSON.stringify(normalizeVisibleText(text))}`
|
|
246
|
-
});
|
|
247
|
-
};
|
|
248
|
-
return {
|
|
249
|
-
ConditionalExpression (node) {
|
|
250
|
-
if (!node.test || !looksLikeLocaleTest(context, node.test)) return;
|
|
251
|
-
for (const branch of [
|
|
252
|
-
node.consequent,
|
|
253
|
-
node.alternate
|
|
254
|
-
]){
|
|
255
|
-
const text = expressionStringValue(branch);
|
|
256
|
-
if (text && hasLetters(text) && !isAllowedBranchLiteral(text.trim())) reportBranch(branch, text);
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
};
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
const getCallExpressionName = (node)=>getNodeName(node);
|
|
263
|
-
const createNoSplitTranslationKeysRule = ()=>({
|
|
264
|
-
meta: {
|
|
265
|
-
type: 'problem',
|
|
266
|
-
docs: {
|
|
267
|
-
description: 'Disallow split phrase translation key suffixes such as .prefix and .suffix.'
|
|
268
|
-
},
|
|
269
|
-
schema: [
|
|
270
|
-
translationOptionsSchema
|
|
271
|
-
]
|
|
272
|
-
},
|
|
273
|
-
create (context) {
|
|
274
|
-
const options = getSplitTranslationKeyRuleOption(context, {
|
|
275
|
-
translationFunctions: DEFAULT_TRANSLATION_FUNCTIONS
|
|
276
|
-
});
|
|
277
|
-
const translationFunctions = new Set(options.translationFunctions);
|
|
278
|
-
return {
|
|
279
|
-
CallExpression (node) {
|
|
280
|
-
const calleeName = getCallExpressionName(node.callee);
|
|
281
|
-
if (!calleeName || !translationFunctions.has(calleeName)) return;
|
|
282
|
-
const key = expressionStringValue(node.arguments?.[0]);
|
|
283
|
-
if (!key || !SPLIT_TRANSLATION_KEY_PATTERN.test(key)) return;
|
|
284
|
-
context.report({
|
|
285
|
-
node,
|
|
286
|
-
message: 'Keep translator-owned phrases whole instead of using split translation keys.'
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
const createNoLegacyMfBoundaryAttributesRule = ()=>({
|
|
293
|
-
meta: {
|
|
294
|
-
type: 'problem',
|
|
295
|
-
docs: {
|
|
296
|
-
description: 'Disallow legacy Module Federation boundary attributes in generated UltraModern workspaces.'
|
|
297
|
-
},
|
|
298
|
-
schema: []
|
|
299
|
-
},
|
|
300
|
-
create (context) {
|
|
301
|
-
return {
|
|
302
|
-
JSXAttribute (node) {
|
|
303
|
-
const attributeName = getNodeName(node.name);
|
|
304
|
-
if ('data-mf-boundary' !== attributeName && 'data-mf-remote' !== attributeName && 'data-mf-expose' !== attributeName) return;
|
|
305
|
-
context.report({
|
|
306
|
-
node,
|
|
307
|
-
message: 'Use data-modern-boundary-id and data-modern-mf-expose instead of legacy data-mf-* boundary attributes.'
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
});
|
|
313
|
-
const reportProgramPattern = (context, node, source, pattern, message)=>{
|
|
314
|
-
if (pattern.test(source)) context.report({
|
|
315
|
-
node,
|
|
316
|
-
message
|
|
317
|
-
});
|
|
318
|
-
};
|
|
319
|
-
const reportMissingProgramPattern = (context, node, source, pattern, message)=>{
|
|
320
|
-
if (!pattern.test(source)) context.report({
|
|
321
|
-
node,
|
|
322
|
-
message
|
|
323
|
-
});
|
|
324
|
-
};
|
|
325
|
-
const createStrictEffectApiBoundariesRule = ()=>({
|
|
326
|
-
meta: {
|
|
327
|
-
type: 'problem',
|
|
328
|
-
docs: {
|
|
329
|
-
description: 'Disallow raw HTTP handlers and non-Effect API runtime drift in UltraModern workspaces.'
|
|
330
|
-
},
|
|
331
|
-
schema: []
|
|
332
|
-
},
|
|
333
|
-
create (context) {
|
|
334
|
-
return {
|
|
335
|
-
Program (node) {
|
|
336
|
-
const source = getSourceText(context, node);
|
|
337
|
-
const filename = normalizeFilename(context.filename);
|
|
338
|
-
const apiFile = isApiSourceFile(filename);
|
|
339
|
-
if (isForbiddenGeneratedEffectPath(filename)) context.report({
|
|
340
|
-
node,
|
|
341
|
-
message: 'Generated UltraModern workspaces use direct api/index.ts, shared/api.ts and src/api/* paths; api/effect, api/lambda, shared/effect and src/effect are forbidden.'
|
|
342
|
-
});
|
|
343
|
-
reportProgramPattern(context, node, source, /@modern-js\/plugin-bff\/hono-server/u, 'UltraModern API workspaces must not import Hono server helpers; use @modern-js/plugin-bff/effect-edge and HttpApi.');
|
|
344
|
-
reportProgramPattern(context, node, source, /\bruntimeFramework\s*(?::|=)\s*['"]hono['"]/u, 'UltraModern API apps must use bff.runtimeFramework: "effect".');
|
|
345
|
-
reportProgramPattern(context, node, source, /(?:from|import)\s*['"][^'"]*(?:api\/effect|shared\/effect)[^'"]*['"]|shared-effect-api/u, 'Import API code from direct api/index.ts, shared/api.ts or src/api/* paths, not api/effect, shared/effect or shared Effect API packages.');
|
|
346
|
-
reportProgramPattern(context, node, source, /\bstrictEffectApproach\s*(?::|=)\s*false\b/u, 'UltraModern API apps must keep strictEffectApproach enabled.');
|
|
347
|
-
if (isApiEntryFile(filename)) {
|
|
348
|
-
reportMissingProgramPattern(context, node, source, /\bdefineEffectBff\b/u, 'Generated API entries must export defineEffectBff(...).');
|
|
349
|
-
reportMissingProgramPattern(context, node, source, /\bHttpApiBuilder\b/u, 'Generated API entries must implement handlers through HttpApiBuilder.');
|
|
350
|
-
reportMissingProgramPattern(context, node, source, /\bLayer\b/u, 'Generated API entries must compose dependencies with Effect Layer.');
|
|
351
|
-
reportMissingProgramPattern(context, node, source, /from\s+['"]\.\.\/shared\/api\.ts['"]/u, 'Generated API entries must import the contract from ../shared/api.ts.');
|
|
352
|
-
}
|
|
353
|
-
if (isSharedApiContractFile(filename)) {
|
|
354
|
-
reportMissingProgramPattern(context, node, source, /\bHttpApi\.make\b/u, 'Generated shared API contracts must declare an HttpApi contract.');
|
|
355
|
-
reportMissingProgramPattern(context, node, source, /\bHttpApiGroup\.make\b/u, 'Generated shared API contracts must declare HttpApi groups.');
|
|
356
|
-
reportMissingProgramPattern(context, node, source, /\bHttpApiEndpoint\./u, 'Generated shared API contracts must declare endpoints through HttpApiEndpoint.');
|
|
357
|
-
reportMissingProgramPattern(context, node, source, /\bSchema\./u, 'Generated shared API contracts must model request, response and error shapes with Schema.');
|
|
358
|
-
}
|
|
359
|
-
if (!apiFile) return;
|
|
360
|
-
reportProgramPattern(context, node, source, /\bnew\s+Response\s*\(|\bResponse\.json\s*\(/u, 'API modules must not hand-build Response objects; model endpoints through Effect HttpApi and schemas.');
|
|
361
|
-
reportProgramPattern(context, node, source, /\b(?:request|req)\.(?:json|text|formData|arrayBuffer)\s*\(/u, 'API modules must not manually parse request bodies; use HttpApiEndpoint payload/query/params schemas.');
|
|
362
|
-
reportProgramPattern(context, node, source, /\bexport\s+const\s+handler\b|\bexport\s+default\s+async\b/u, 'API modules must not export raw request handlers; export defineEffectBff(...) from api/index.ts.');
|
|
363
|
-
reportProgramPattern(context, node, source, /\bcreateHandler\s*[:=]\s*(?!defineEffectBff\b)/u, 'API modules must not define unbranded handler factories; use defineEffectBff(...).');
|
|
364
|
-
reportProgramPattern(context, node, source, /\bSchema\.(?:UnknownFromJsonString|Unknown|Any)\b/u, 'API modules must use concrete request, response and error schemas; Schema.UnknownFromJsonString, Schema.Unknown and Schema.Any are forbidden in UltraModern API code.');
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
}
|
|
368
|
-
});
|
|
2
|
+
import { createNoHardcodedJsxTextRule } from "./oxlint-plugin/rules/no-hardcoded-jsx-text.js";
|
|
3
|
+
import { createNoLegacyMfBoundaryAttributesRule } from "./oxlint-plugin/rules/no-legacy-mf-boundary-attributes.js";
|
|
4
|
+
import { createNoLiteralVisibleJsxAttributesRule } from "./oxlint-plugin/rules/no-literal-visible-jsx-attributes.js";
|
|
5
|
+
import { createNoManualLocaleCopyBranchingRule } from "./oxlint-plugin/rules/no-manual-locale-copy-branching.js";
|
|
6
|
+
import { createNoSplitTranslationKeysRule } from "./oxlint-plugin/rules/no-split-translation-keys.js";
|
|
7
|
+
import { createStrictEffectApiBoundariesRule } from "./oxlint-plugin/rules/strict-effect-api-boundaries.js";
|
|
8
|
+
export * from "./oxlint-plugin/ast.js";
|
|
9
|
+
export * from "./oxlint-plugin/options.js";
|
|
10
|
+
export * from "./oxlint-plugin/rules/no-hardcoded-jsx-text.js";
|
|
11
|
+
export * from "./oxlint-plugin/rules/no-legacy-mf-boundary-attributes.js";
|
|
12
|
+
export * from "./oxlint-plugin/rules/no-literal-visible-jsx-attributes.js";
|
|
13
|
+
export * from "./oxlint-plugin/rules/no-manual-locale-copy-branching.js";
|
|
14
|
+
export * from "./oxlint-plugin/rules/no-split-translation-keys.js";
|
|
15
|
+
export * from "./oxlint-plugin/rules/strict-effect-api-boundaries.js";
|
|
16
|
+
export * from "./oxlint-plugin/types.js";
|
|
369
17
|
const oxlint_plugin_plugin = {
|
|
370
18
|
meta: {
|
|
371
19
|
name: 'ultramodern'
|
|
@@ -2,8 +2,6 @@ type SingleAppI18nCheckOptions = {
|
|
|
2
2
|
readonly cwd?: string;
|
|
3
3
|
readonly targets?: readonly string[];
|
|
4
4
|
};
|
|
5
|
-
export declare const SINGLE_APP_I18N_SUCCESS = "No hardcoded user-visible JSX strings found.";
|
|
6
|
-
export declare const SINGLE_APP_I18N_FAILURE = "Hardcoded user-visible JSX strings found. Move copy to locale JSON files.";
|
|
7
5
|
export declare const runSingleAppI18nCheck: ({ cwd, targets, }?: SingleAppI18nCheckOptions) => number;
|
|
8
6
|
export declare const main: () => void;
|
|
9
7
|
export {};
|
|
@@ -16,6 +16,5 @@ export type WorkspaceSourceCheckOptions = {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly pluralCategories?: Readonly<Record<string, readonly string[]>>;
|
|
18
18
|
};
|
|
19
|
-
export declare const WORKSPACE_SOURCE_SUCCESS = "UltraModern i18n and boundary guardrails validated";
|
|
20
19
|
export declare const runWorkspaceSourceCheck: ({ cwd, sourceRoots, locales, pluralCategories, }?: WorkspaceSourceCheckOptions) => number;
|
|
21
20
|
export declare const main: () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AstNode, CommonRuleOptions, RuleContext } from './types.ts';
|
|
2
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
3
|
+
export declare const asStringArray: (value: unknown, fallback: readonly string[]) => readonly string[];
|
|
4
|
+
export declare const normalizeVisibleText: (value: string) => string;
|
|
5
|
+
export declare const hasLetters: (value: string) => boolean;
|
|
6
|
+
export declare const getNodeName: (node: AstNode | undefined) => string | undefined;
|
|
7
|
+
export declare const hasAllowedElementAncestor: (node: AstNode, allowedElements: ReadonlySet<string>) => boolean;
|
|
8
|
+
export declare const getStringLiteralValue: (node: AstNode | undefined) => string | undefined;
|
|
9
|
+
export declare const expressionStringValue: (node: AstNode | undefined) => string | undefined;
|
|
10
|
+
export declare const getLine: (node: AstNode) => number | undefined;
|
|
11
|
+
export declare const hasIgnoreComment: (node: AstNode, context: RuleContext, pattern: RegExp) => boolean;
|
|
12
|
+
export declare const getIgnorePattern: (options: CommonRuleOptions) => RegExp;
|
|
13
|
+
export declare const reportVisibleText: (context: RuleContext, node: AstNode, text: string) => void;
|
|
14
|
+
export declare const getSourceText: (context: RuleContext, node: AstNode) => string;
|
|
15
|
+
export declare const normalizeFilename: (filePath: string | undefined) => string;
|
|
16
|
+
export declare const isApiSourceFile: (filePath: string | undefined) => boolean;
|
|
17
|
+
export declare const isForbiddenGeneratedEffectPath: (filePath: string | undefined) => boolean;
|
|
18
|
+
export declare const isApiEntryFile: (filePath: string | undefined) => boolean;
|
|
19
|
+
export declare const isSharedApiContractFile: (filePath: string | undefined) => boolean;
|
|
20
|
+
export declare const getCallExpressionName: (node: AstNode | undefined) => string | undefined;
|
|
21
|
+
export declare const reportProgramPattern: (context: RuleContext, node: AstNode, source: string, pattern: RegExp, message: string) => void;
|
|
22
|
+
export declare const reportMissingProgramPattern: (context: RuleContext, node: AstNode, source: string, pattern: RegExp, message: string) => void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { AttributeRuleOptions, CommonRuleOptions, RuleContext, SplitTranslationKeyRuleOptions } from './types.ts';
|
|
2
|
+
export declare const commonOptionsSchema: {
|
|
3
|
+
type: string;
|
|
4
|
+
properties: {
|
|
5
|
+
allowElements: {
|
|
6
|
+
type: string;
|
|
7
|
+
items: {
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
ignoreCommentPattern: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
additionalProperties: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const attributeOptionsSchema: {
|
|
18
|
+
type: string;
|
|
19
|
+
properties: {
|
|
20
|
+
allowElements: {
|
|
21
|
+
type: string;
|
|
22
|
+
items: {
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
ignoreCommentPattern: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
visibleAttributes: {
|
|
30
|
+
type: string;
|
|
31
|
+
items: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
additionalProperties: boolean;
|
|
37
|
+
};
|
|
38
|
+
export declare const translationOptionsSchema: {
|
|
39
|
+
type: string;
|
|
40
|
+
properties: {
|
|
41
|
+
translationFunctions: {
|
|
42
|
+
type: string;
|
|
43
|
+
items: {
|
|
44
|
+
type: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
additionalProperties: boolean;
|
|
49
|
+
};
|
|
50
|
+
export declare const DEFAULT_VISIBLE_ATTRIBUTES: string[];
|
|
51
|
+
export declare const DEFAULT_ALLOWED_ELEMENTS: string[];
|
|
52
|
+
export declare const DEFAULT_TRANSLATION_FUNCTIONS: string[];
|
|
53
|
+
export declare const DEFAULT_IGNORE_COMMENT_PATTERN = "i18n-ignore";
|
|
54
|
+
export declare const LETTER_PATTERN: RegExp;
|
|
55
|
+
export declare const SPLIT_TRANSLATION_KEY_PATTERN: RegExp;
|
|
56
|
+
export declare const API_SOURCE_FILE_PATTERN: RegExp;
|
|
57
|
+
export declare const FORBIDDEN_GENERATED_EFFECT_PATH_PATTERN: RegExp;
|
|
58
|
+
export declare const API_ENTRY_PATTERN: RegExp;
|
|
59
|
+
export declare const SHARED_API_CONTRACT_PATTERN: RegExp;
|
|
60
|
+
export declare const getCommonRuleOption: (context: RuleContext, defaults: CommonRuleOptions) => CommonRuleOptions;
|
|
61
|
+
export declare const getAttributeRuleOption: (context: RuleContext, defaults: AttributeRuleOptions) => AttributeRuleOptions;
|
|
62
|
+
export declare const getSplitTranslationKeyRuleOption: (context: RuleContext, defaults: SplitTranslationKeyRuleOptions) => SplitTranslationKeyRuleOptions;
|