Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ jobs:
cache: npm
cache-dependency-path: npm-shrinkwrap.json

- name: Cache ESLint
uses: actions/cache@v3
with:
path: .eslintcache
key: eslint-${{ runner.os }}-node${{ matrix.node-version }}-${{ hashFiles('**/*.ts', '**/*.js') }}
restore-keys: |
eslint-${{ runner.os }}-node${{ matrix.node-version }}-

- run: npm i -g npm@9.5
- run: npm ci
- run: npm test -- -- --forbid-only
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ test_output.log
scripts/emulator-tests/functions/index.js
yarn.lock
.npmrc
.eslintcache

.DS_Store
.idea
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"lint": "npm run lint:ts && npm run lint:other",
"lint:changed-files": "ts-node ./scripts/lint-changed-files.ts",
"lint:other": "prettier --check '**/*.{md,yaml,yml}'",
"lint:quiet": "npm run lint:ts -- --quiet && npm run lint:other",
"lint:ts": "eslint --config .eslintrc.js --ext .ts,.js .",
"lint:quiet": "npm run lint:ts -- --cache --quiet && npm run lint:other",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The --cache flag is redundant here because it is already included in the lint:ts script definition on line 25. When npm run lint:quiet is executed, it calls npm run lint:ts, which now includes the cache flag by default.

Suggested change
"lint:quiet": "npm run lint:ts -- --cache --quiet && npm run lint:other",
"lint:quiet": "npm run lint:ts -- --quiet && npm run lint:other",

"lint:ts": "eslint --cache --config .eslintrc.js --ext .ts,.js .",
"mocha:fast": "mocha 'src/**/*.spec.{ts,js}'",
"mocha": "nyc --reporter=html mocha 'src/**/*.spec.{ts,js}'",
"prepare": "npm run clean && npm run build:publish",
Expand Down
Loading