Skip to content

Commit

Permalink
Improve lint workflow (#2839)
Browse files Browse the repository at this point in the history
* Improve lint workflow

* Fix typo
  • Loading branch information
muodov authored Dec 9, 2024
1 parent c8ec311 commit 676e14d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
node-version: 20
cache: 'npm'
- run: npm run install-ci
- run: npm run lint
- run: npm run lint && echo 'No lint issues!' || (npm run lint-fix; git diff; echo 'Lint check failed, review diff above or run "npm run lint-fix"'; return 1)

build:
strategy:
Expand Down
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,14 @@ The extension imports several DDG-owned modules (see [package.json](https://gith

### Linting
- All linting: `npm run lint`
- This includes both the ESLint and TypeScript checks.
- This includes the ESLint and TypeScript checks as well as Prettier style checks.
- To automatically fix all lint issues: `npm run lint-fix`
- ESLint linting: `npm run eslint`
- To automatically fix mistakes found (where possible) use: `npm run eslint-fix`
- TypeScript Linting: `npm run tsc`
- Prettier linting: `npm run prettier`
- To automatically fix style issues use: `npm run prettier-fix`
- Since Prettier rules are stylistic-only, it is okay to add `// prettier-ignore` comments to ignore specific lines or blocks of code.

### Testing
- Unit tests: `npm test` (full docs [here](./unit-test/README.md))
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"dev": "echo 'Try npm run dev-firefox or npm run dev-chrome instead' && exit 0",
"eslint": "eslint '*.js' shared/js shared/data unit-test integration-test scripts",
"eslint-fix": "npm run eslint -- --fix",
"lint": "npm run eslint && prettier . --check && npm run tsc",
"prettier": "prettier . --check",
"prettier-fix": "prettier . --write",
"lint": "npm run eslint && npm run prettier && npm run tsc",
"lint-fix": "npm run eslint-fix && npm run prettier-fix",
"test": "npm run test.unit && npm run test.node",
"test.unit": "make unit-test",
"test.node": "make node-test",
Expand Down

0 comments on commit 676e14d

Please sign in to comment.