From 1304e8b00b8d7e2731460257d0ea69c7ccaafe43 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 7 Nov 2022 14:06:35 +0530 Subject: [PATCH] chore: Move from bin to scripts. --- .lintstagedrc.json | 2 +- package.json | 2 +- {bin => scripts}/fixCSpell.ts | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-) rename {bin => scripts}/fixCSpell.ts (76%) diff --git a/.lintstagedrc.json b/.lintstagedrc.json index 10899e59d..863473f2a 100644 --- a/.lintstagedrc.json +++ b/.lintstagedrc.json @@ -1,4 +1,4 @@ { "!(docs/**/*)*.{ts,js,json,html,md,mts}": ["eslint --fix", "prettier --write"], - "cSpell.json": ["ts-node-esm bin/fixCSpell.ts"] + "cSpell.json": ["ts-node-esm scripts/fixCSpell.ts"] } diff --git a/package.json b/package.json index 20c8acba4..0881fa3f2 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"", "release": "pnpm build", "lint": "eslint --cache --ignore-path .gitignore . && pnpm --filter mermaid run lint:jison && prettier --check .", - "lint:fix": "eslint --fix --ignore-path .gitignore . && prettier --write . && ts-node-esm bin/fixCSpell.ts", + "lint:fix": "eslint --fix --ignore-path .gitignore . && prettier --write . && ts-node-esm scripts/fixCSpell.ts", "cypress": "cypress run", "cypress:open": "cypress open", "e2e": "start-server-and-test dev http://localhost:9000/ cypress", diff --git a/bin/fixCSpell.ts b/scripts/fixCSpell.ts similarity index 76% rename from bin/fixCSpell.ts rename to scripts/fixCSpell.ts index 3616d39e0..1d15e2194 100644 --- a/bin/fixCSpell.ts +++ b/scripts/fixCSpell.ts @@ -1,3 +1,10 @@ +/** + * Sorts all the `words` in the cSpell.json file. + * + * Run from the same folder as the `cSpell.json` file + * (i.e. the root of the Mermaid project). + */ + import { readFileSync, writeFileSync } from 'node:fs'; import prettier from 'prettier';