Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow void as statement in ts file #142

Merged
merged 2 commits into from Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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