mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 02:39:41 +02:00
build(lint): cache eslint with strategy content
Cache eslint using `--cache-strategy content` instead of the default `--cache-strategy metadata`. By default, `eslint` uses the file metadata (e.g. modification time) to detect when the cache should be invalidated. However, this is not efficient with `git`, since git constantly changes the modification time, e.g. running `git switch main && git switch original-branch` would not change the file contents, but would change the file mtimes and force eslint to re-lint everything. Using the file contents is slower (~3% for me), but more resilient. See https://eslint.org/docs/latest/use/command-line-interface#--cache-strategy
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
"build": "pnpm run -r clean && concurrently \"pnpm build:vite\" \"pnpm build:types\"",
|
||||
"dev": "concurrently \"pnpm build:vite --watch\" \"ts-node-esm .vite/server.ts\"",
|
||||
"release": "pnpm build",
|
||||
"lint": "eslint --cache --ignore-path .gitignore . && pnpm lint:jison && prettier --cache --check .",
|
||||
"lint": "eslint --cache --cache-strategy content --ignore-path .gitignore . && pnpm lint:jison && prettier --cache --check .",
|
||||
"lint:fix": "eslint --fix --ignore-path .gitignore . && prettier --write . && ts-node-esm scripts/fixCSpell.ts",
|
||||
"lint:jison": "ts-node-esm ./scripts/jison/lint.mts",
|
||||
"cypress": "cypress run",
|
||||
|
Reference in New Issue
Block a user