Skip to content

Commit

Permalink
Enable ESLint caching (#645)
Browse files Browse the repository at this point in the history
Closes #550.
  • Loading branch information
72636c authored Nov 6, 2021
1 parent a34efe5 commit 5a50cbf
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changeset/loud-apricots-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"skuba": minor
---

format, lint: Enable ESLint caching

ESLint now writes to a local `.eslintcache` store. This speeds up subsequent runs of `skuba format` and `skuba lint` as they can skip unchanged files.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ node_modules*/
/tmp*/

.DS_Store
.eslintcache
.npmrc
*.tgz
*.tsbuildinfo
Expand Down
4 changes: 3 additions & 1 deletion src/cli/__snapshots__/format.int.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ Prettier
Initialising Prettier...
Detected project root: <random>
Discovering files...
Discovered 6 files.
Discovered 7 files.
Formatting files...
.eslintcache
parser: -
b.md
parser: markdown
c.json
Expand Down
4 changes: 3 additions & 1 deletion src/cli/__snapshots__/lint.int.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ ESLint │ ○ d.js
Prettier │ Initialising Prettier...
Prettier │ Detected project root: <random>
Prettier │ Discovering files...
Prettier │ Discovered 6 files.
Prettier │ Discovered 7 files.
Prettier │ Linting files...
Prettier │ .eslintcache
Prettier │ parser: -
Prettier │ b.md
Prettier │ parser: markdown
Prettier │ c.json
Expand Down
4 changes: 1 addition & 3 deletions src/cli/adapter/eslint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ export const runESLint = async (
logger.debug('Initialising ESLint...');

const engine = new ESLint({
// TODO: enable this once we have a less overzealous `skuba configure` that
// everyone can apply to update their `.gitignore` files.
// cache: true,
cache: true,
extensions: ['js', 'ts', 'tsx'],
fix: mode === 'format',
reportUnusedDisableDirectives: 'error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ node_modules*/
/tmp*/
.DS_Store
.eslintcache
.npmrc
*.tgz
*.tsbuildinfo
Expand Down
1 change: 1 addition & 0 deletions template/base/_.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ node_modules*/
/tmp*/

.DS_Store
.eslintcache
.npmrc
*.tgz
*.tsbuildinfo
Expand Down

0 comments on commit 5a50cbf

Please sign in to comment.