mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-16 22:09:57 +02:00
jq -> node
This commit is contained in:
17
bin/checkCSpell.ts
Normal file
17
bin/checkCSpell.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { readFileSync, writeFileSync } from 'node:fs';
|
||||
import prettier from 'prettier';
|
||||
|
||||
const filepath = './cSpell.json';
|
||||
const cSpell: { words: string[] } = JSON.parse(readFileSync(filepath, 'utf8'));
|
||||
|
||||
cSpell.words = [...new Set(cSpell.words.map((word) => word.toLowerCase()))];
|
||||
cSpell.words.sort((a, b) => a.localeCompare(b));
|
||||
|
||||
const prettierConfig = prettier.resolveConfig.sync(filepath) ?? {};
|
||||
writeFileSync(
|
||||
filepath,
|
||||
prettier.format(JSON.stringify(cSpell), {
|
||||
...prettierConfig,
|
||||
filepath,
|
||||
})
|
||||
);
|
Reference in New Issue
Block a user