fix: allow void as statement in ts file (#142)
This commit is contained in:
parent
2ad3503022
commit
5d5b3c338a
@ -57,7 +57,7 @@ Install [VS Code ESLint extension](https://marketplace.visualstudio.com/items?it
|
|||||||
|
|
||||||
### TypeScript Aware Rules
|
### 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
|
```js
|
||||||
// .eslintrc.js
|
// .eslintrc.js
|
||||||
|
@ -147,6 +147,12 @@ module.exports = {
|
|||||||
'@typescript-eslint/no-var-requires': 'off',
|
'@typescript-eslint/no-var-requires': 'off',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
files: ['*.ts', '*.tsx', '*.mts', '*.cts'],
|
||||||
|
rules: {
|
||||||
|
'no-void': ['error', { allowAsStatement: true }],
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
files: ['scripts/**/*.*', 'cli.*'],
|
files: ['scripts/**/*.*', 'cli.*'],
|
||||||
rules: {
|
rules: {
|
||||||
|
@ -34,7 +34,6 @@ module.exports = {
|
|||||||
'@typescript-eslint/no-implied-eval': 'error',
|
'@typescript-eslint/no-implied-eval': 'error',
|
||||||
'dot-notation': 'off',
|
'dot-notation': 'off',
|
||||||
'@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
|
'@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
|
||||||
'no-void': ['error', { allowAsStatement: true }],
|
|
||||||
'@typescript-eslint/no-floating-promises': 'error',
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
'@typescript-eslint/no-misused-promises': 'error',
|
'@typescript-eslint/no-misused-promises': 'error',
|
||||||
'@typescript-eslint/await-thenable': 'error',
|
'@typescript-eslint/await-thenable': 'error',
|
||||||
|
Loading…
Reference in New Issue
Block a user