mirror of
https://github.com/jacobinwwey/obsidian-NotEMD.git
synced 2026-07-22 05:48:27 +00:00
fix(release): normalize i18n audit paths
This commit is contained in:
parent
41efd8a926
commit
c43422b014
2 changed files with 14 additions and 2 deletions
|
|
@ -42,7 +42,7 @@ const matchers = [
|
|||
{ kind: 'button-text', regex: /\.setButtonText\((['"`])/ },
|
||||
{ kind: 'title-text', regex: /titleEl\.setText\((['"`])/ },
|
||||
{ kind: 'element-text', regex: /createEl\([^)]*\{\s*text:\s*(['"`])/ },
|
||||
{ kind: 'name-prop', regex: /\bname:\s*(['"`])/ },
|
||||
{ kind: 'name-prop', regex: /\bname:\s*(['"`])(?!\1)/ },
|
||||
{ kind: 'placeholder', regex: /\.setPlaceholder\((['"`])/ },
|
||||
{ kind: 'status-bar', regex: /updateStatusBar\((['"`])/ },
|
||||
{ kind: 'progress-status', regex: /\.updateStatus\((['"`])/ },
|
||||
|
|
@ -84,7 +84,7 @@ const allFiles = candidateFiles
|
|||
const absolute = path.join(projectRoot, candidate);
|
||||
return fs.existsSync(absolute) ? walk(absolute) : [];
|
||||
})
|
||||
.map(file => path.relative(projectRoot, file))
|
||||
.map(file => path.relative(projectRoot, file).split(path.sep).join('/'))
|
||||
.filter(shouldInspect)
|
||||
.sort();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,4 +11,16 @@ describe('hardcoded UI audit script configuration', () => {
|
|||
expect(source).not.toContain('/definition\\.description/');
|
||||
expect(source).not.toContain('/definition\\.setupHint/');
|
||||
});
|
||||
|
||||
test('normalizes platform separators before matching candidate directories', () => {
|
||||
const source = fs.readFileSync(scriptPath, 'utf8');
|
||||
|
||||
expect(source).toContain(".split(path.sep).join('/')");
|
||||
});
|
||||
|
||||
test('does not treat an empty name state field as visible UI copy', () => {
|
||||
const source = fs.readFileSync(scriptPath, 'utf8');
|
||||
|
||||
expect(source).toContain("{ kind: 'name-prop', regex: /\\bname:\\s*(['\"`])(?!\\1)/ }");
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue