Skip to content

Commit

Permalink
fix: allow void as statement in ts file (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
zanminkian committed Dec 16, 2022
1 parent 2ad3503 commit 5d5b3c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -57,7 +57,7 @@ Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?it

### TypeScript Aware Rules

Type aware rules are enabled when a `tsconfig.eslint.json` is found in the project root. If you want to enable it while have no `tsconfig.eslint.json` in the project root, you can change tsconfig name by modifying `ESLINT_TSCONFIG` env.
Type aware rules are enabled when a `tsconfig.eslint.json` is found in the project root, which will introduce some stricter rules into your project. If you want to enable it while have no `tsconfig.eslint.json` in the project root, you can change tsconfig name by modifying `ESLINT_TSCONFIG` env.

```js
// .eslintrc.js
Expand Down
6 changes: 6 additions & 0 deletions packages/basic/index.js
Expand Up @@ -147,6 +147,12 @@ module.exports = {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['*.ts', '*.tsx', '*.mts', '*.cts'],
rules: {
'no-void': ['error', { allowAsStatement: true }],
},
},
{
files: ['scripts/**/*.*', 'cli.*'],
rules: {
Expand Down
1 change: 0 additions & 1 deletion packages/typescript/index.js
Expand Up @@ -34,7 +34,6 @@ module.exports = {
'@typescript-eslint/no-implied-eval': 'error',
'dot-notation': 'off',
'@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
'no-void': ['error', { allowAsStatement: true }],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/await-thenable': 'error',
Expand Down

0 comments on commit 5d5b3c3

Please sign in to comment.