Skip to content

Commit 5d5b3c3

Browse files
authored
fix: allow void as statement in ts file (#142)
1 parent 2ad3503 commit 5d5b3c3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?it
5757

5858
### TypeScript Aware Rules
5959

60-
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.
60+
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.
6161

6262
```js
6363
// .eslintrc.js

packages/basic/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ module.exports = {
147147
'@typescript-eslint/no-var-requires': 'off',
148148
},
149149
},
150+
{
151+
files: ['*.ts', '*.tsx', '*.mts', '*.cts'],
152+
rules: {
153+
'no-void': ['error', { allowAsStatement: true }],
154+
},
155+
},
150156
{
151157
files: ['scripts/**/*.*', 'cli.*'],
152158
rules: {

packages/typescript/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module.exports = {
3434
'@typescript-eslint/no-implied-eval': 'error',
3535
'dot-notation': 'off',
3636
'@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
37-
'no-void': ['error', { allowAsStatement: true }],
3837
'@typescript-eslint/no-floating-promises': 'error',
3938
'@typescript-eslint/no-misused-promises': 'error',
4039
'@typescript-eslint/await-thenable': 'error',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy