Skip to content

Commit 436fb15

Browse files
authored
JS-577 Move schema.json files to the rule folders (#5140)
1 parent b632d93 commit 436fb15

28 files changed

+4
-2
lines changed

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ lib
66
packages/*/tests/**/fixtures
77
packages/jsts/src/rules/**/*.fixture.*
88
packages/jsts/src/rules/**/fixtures
9+
packages/jsts/src/rules/**/schema.json
910
packages/ruling/tests/actual
1011

1112
its/sources

tools/helpers.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ export async function generateMetaForRule(sonarKey: string) {
137137
console.log(`Type not found for rule ${sonarKey}`);
138138
}
139139

140-
const schemaFile = join(METADATA_FOLDER, 'schemas', `${sonarKey}-schema.json`);
140+
const ruleFolder = join(RULES_FOLDER, sonarKey);
141+
const schemaFile = join(ruleFolder, `schema.json`);
141142
let schema = '';
142143
if (await exists(schemaFile)) {
143144
try {
@@ -147,7 +148,7 @@ export async function generateMetaForRule(sonarKey: string) {
147148

148149
await inflateTemplateToFile(
149150
join(TS_TEMPLATES_FOLDER, 'generated-meta.template'),
150-
join(RULES_FOLDER, sonarKey, `generated-meta.ts`),
151+
join(ruleFolder, `generated-meta.ts`),
151152
{
152153
___HEADER___: header,
153154
___RULE_TYPE___: typeMatrix[ruleRspecMeta.type],

0 commit comments

Comments
 (0)