Skip to content

Commit

Permalink
chore(eslint-config): remove '--cache-strategy' in recommended scripts
Browse files Browse the repository at this point in the history
This should speed up cache lint commands a bit, since not all files have to be read to determine if it has been changed.

The downside is that files can be modified between lint runs, but not have changed. In which case, we run all lint rules which shouldn't be neceesary.

Seems like a decent trade-off.

Signed-off-by: Dirk de Visser <github@dirkdevisser.nl>
  • Loading branch information
dirkdev98 committed Jul 31, 2024
1 parent 585d59c commit 00bb95c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build:ws": "npm run build && npm run build --workspaces --if-present",
"clean:ws": "npm run clean --workspaces --if-present --include-workspace-root",
"build": "tsc --build",
"lint": "eslint . --fix --cache --cache-strategy content --cache-location .cache/eslint/ --color",
"lint": "eslint . --fix --cache --cache-location .cache/eslint/ --color",
"test": "vitest",
"lint:ci": "eslint .",
"clean": "rm -rf ./.cache ./tsconfig.tsbuildinfo"
Expand Down
13 changes: 11 additions & 2 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Add the following scripts to your `package.json`:
```json
{
"scripts": {
"lint": "eslint . --fix --cache --cache-strategy content --cache-location .cache/eslint/",
"lint": "eslint . --fix --cache --cache-location .cache/eslint/",
"lint:ci": "eslint ."
}
}
Expand All @@ -51,7 +51,16 @@ Add the following scripts to your `package.json`:
> but not yet supported by all our plugins.
- Use `eslint.config.mjs` instead of `eslint.config.js`
- Specify `--config eslint.config.mjs` in the `package.json` scripts.
- Specify `--config eslint.config.mjs` in the `package.json` scripts. For example:

```json
{
"scripts": {
"lint": "eslint . --fix --cache --cache-location .cache/eslint/ --config eslint.config.mjs",
"lint:ci": "eslint . --config eslint.config.mjs"
}
}
```

## Default configuration and options

Expand Down

0 comments on commit 00bb95c

Please sign in to comment.