Skip to content

Commit

Permalink
chore(lint): set "no-console" rule to "error" (#2243)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito committed Aug 28, 2024
1 parent 63b7831 commit 78360c8
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 84 deletions.
15 changes: 9 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ module.exports = {
],
rules: {
// Forbid "console.debug()" statements.
'no-console': [
'error',
{
allow: ['log', 'warn', 'error', 'group', 'groupCollapsed', 'groupEnd'],
},
],
'no-console': ['error'],
'@typescript-eslint/prefer-ts-expect-error': 2,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
Expand All @@ -36,4 +31,12 @@ module.exports = {
},
],
},
overrides: [
{
files: ['**/*.test.ts'],
rules: {
'no-console': 'off',
},
},
],
}
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Install Playwright browsers
run: pnpm exec playwright install

- name: Lint
run: pnpm lint

- name: Unit tests
run: pnpm test:unit

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
- name: Install Playwright browsers
run: pnpm exec playwright install

- name: Lint
run: pnpm lint

- name: Build
run: pnpm build

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"scripts": {
"start": "tsup --watch",
"clean": "rimraf ./lib",
"lint": "eslint \"{cli,config,src,test}/**/*.ts\"",
"lint": "eslint \"{cli,src}/**/*.ts\"",
"build": "pnpm clean && cross-env NODE_ENV=production tsup && pnpm patch:dts",
"patch:dts": "node \"./config/scripts/patch-ts.js\"",
"check:exports": "node \"./config/scripts/validate-esm.js\"",
Expand Down Expand Up @@ -163,8 +163,8 @@
"@types/glob": "^8.1.0",
"@types/json-bigint": "^1.0.4",
"@types/node": "18.x",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"@web/dev-server": "^0.1.38",
"axios": "^1.6.5",
"babel-minify": "^0.5.1",
Expand Down
145 changes: 73 additions & 72 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/browser/setupWorker/start/createStartHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Please consider using a custom "serviceWorker.url" option to point to the actual
devUtils.error(
'Error while checking the worker script integrity. Please report this on GitHub (https://github.com/mswjs/msw/issues), including the original error below.',
)
// eslint-disable-next-line no-console
console.error(error)
})

Expand Down
Loading

0 comments on commit 78360c8

Please sign in to comment.