Skip to content

Commit

Permalink
ci: shift automatic checks to ease debugging (#1421)
Browse files Browse the repository at this point in the history
1. Move `unused variable` check from ts build to eslint. For debugging
purposes, often commenting out pieces of code is required. Sometimes it
leads to build failures, like `error 'foo' is defined but never used`.
2. Move pre-commit checks from `pre-commit` to `pre-push` stage. This is
required to be able to fix a progress without polishing out the whole
project before each commit + to speed up the commits.

---------

Co-authored-by: Maksim Sadym <[email protected]>
  • Loading branch information
sadym-chromium and Maksim Sadym authored Oct 12, 2023
1 parent 4cd32b6 commit 19fe3cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module.exports = {
'@typescript-eslint/no-unsafe-enum-comparison': 'warn',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-vars': ['warn', {argsIgnorePattern: '^_'}],
'@typescript-eslint/no-unused-vars': ['error', {argsIgnorePattern: '^_'}],
'@typescript-eslint/prefer-return-this-type': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/restrict-template-expressions': 'off',
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#
# Apply all pre-commit hooks to all files:
# $ pre-commit run --all-files
default_stages: [pre-commit]
default_stages: [pre-push]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ We use [cddlconv](https://github.com/google/cddlconv) to generate our WebDriverB

Refer to the documentation at [.pre-commit-config.yaml](.pre-commit-config.yaml).

```sh
pre-commit install --hook-type pre-push
```

### Starting the Server

This will run the server on port `8080`:
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"noImplicitThis": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"resolveJsonModule": true,
"sourceMap": true,
"strict": true,
Expand Down

0 comments on commit 19fe3cc

Please sign in to comment.