Webstorm is not finding a tsconfig.base.json from a test file

I'm working on the web3.js repo and I'm having problems getting a test file to recognize a tsconfig.base.json file that is located at the root of the project.

The test file I'm getting this error on is packages/web3/test/integration/web3RPCProviders.test.ts:
 

I think this has to do with the project structure and having multiple tsconfig files in other folders. Can I get some help fixing this issue?

0
7 comments

If the error only occurs when using ESLint integration in the IDE and doesn't occur when you run the linter in the terminal, it can be caused by the wrong working directory being used. With monorepos, the IDE can start multiple ESlint processes - by default, it starts a separate process for each package.json with eslint dependency and processes everything below it, using the .eslintrc.* configuration file nearest to the current file. Also, with Automatic configuration, the ESlint working folder is set to a folder where the nearest .eslintrc or eslintignore resides (as described in https://www.jetbrains.com/help/webstorm/eslint.html#ws_js_eslint_manual_configuration)
You can try changing the configuration to Manual and choosing the eslint package, configuration file and working directory explicitly to match the command you use when running the linter in terminal

0

@Elena Pogorelova Thank you for the help.

I'm still not sure how to fix the issue. I should've added the console outputs. In this test file I'm getting:

Error: File '../../tsconfig.base.json' not found.

Occurred while linting /Users/TheUser/Documents/web3.js/packages/web3/test/integration/web3RPCProviders.test.ts:18

Rule: "import/namespace"

In .eslintrc.test.js I'm getting:

Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
The file does not match your project config: .eslintrc.test.js.
The file must be included in at least one of the projects provided.

 

0

What command do you normally use to lint your project, in what directory do you run this command?

0

I run npm run lint from the root of the project.

0

And what does the lint script look like?

0

It runs lerna run lint --stream --parallel .

0

I'm not sure how to set up the integration in your case. I've tried you app and get a different error in packages/web3/test/integration/web3RPCProviders.test.ts:

Looks like the tsconfig.json is broken, it's not a valid JSON.

0

Please sign in to leave a comment.