I keep seeing red squiggly lines in Visual Studio Code, even when the variable is defined and I get an error message.
Disabling ESLint seems to make the problem disappear, but I feel like that's not the best solution as it would disable linting for the entire TypeScript/JavaScript files. (I have the ESLint extension installed)
I am running Visual Studio Code version 1.57.1 (Universal) on Mac OS Catalina.
If I right-click, I can go to the browser
definition.
https://i.sstatic.net/ow61t.png
beforeAll(async () => {
await browser.url('https://example.com/');
}
When I check the definition, it appears as shown below https://i.sstatic.net/06fjw.png
https://i.sstatic.net/AfU07.png
The piece of code causing these issues is in a .js file located at the bottom right corner of Visual Studio Code.
https://i.sstatic.net/I1iVC.png
How do I resolve this problem without disabling ESLint? I already attempted removing the .vs folder as suggested in one of the solutions mentioned here, but it didn't work: Visual Studio compiles fine, but it still shows red lines
I've also included these libraries in my code:
npm i
npm install @wdio/cli (https://webdriver.io/docs/gettingstarted/)
npx wdio config
I'm able to compile my project, but how can I eliminate those red lines without turning off ESLint?
Thank you for your assistance!
beforeAll(async () => {
await browser.url('https://example.com/');
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.2.3/jquery.min.js">
</script>
Note: I'm unsure about creating a minimal viable product from this code. However, beforeAll is defined from a node module. Relevant files are provided below. node_modules/@types/jest/index.d.ts
declare var beforeAll: jest.Lifecycle;
This is how my package.json file is structured:
{
"name": "test-app",
"version": "0.1.0",
"private": true,
...
}
This setup involves using Jest and Web Driver for UI automation in browsers.
The file node_modules/jest-playwright-preset/types/global.d.ts contains the code shown in the screenshots above.
import {
...
...
...
}