I created a new NestJS project which is a very popular NodeJS framework. But I have this error (see title) on my IDE (PhpStorm 2020.2-Beta) and ESLint doesn't work at all.
I've used the NestJS CLI :
nest new nestjs-micro
I don't seem to be the only one with this problem, so it would be nice to find the cause of this problem and fix it once and for all.
I already have an open issue but I haven't had an answer, this is really very problematic.
If anyone has an idea on how to fix the problem and keeping an ESLint / Prettier integration with PhpStorm, thanks.
Repro
// .eslintrc.js
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'prettier/@typescript-eslint',
],
root: true,
env: {
node: true,
jest: true,
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
};
// tsconfig.json
{
"compilerOptions": {
"module": "commonjs",
"declaration": true,
"removeComments": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"target": "es2017",
"sourceMap": true,
"outDir": "./dist",
"baseUrl": "./",
"incremental": true
}
}
Versions
Typescript: 3.7.4
Node: 14.3.0
ESLint: 7.1.0
@typescript-eslint/parser: 3.0.2
Yarn: 1.22.4