Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vscode react auto import

Create the file jsconfig.json at your project root and make sure to set checkJs to true:

Creating a JS Config file, allows Visual Studio to treat the folder as an Explicit Project. Without it, JS files opened in VS Code are treated as independent units, and there is no common project context between any two files.

Example:
{
  "compilerOptions": {
    "baseUrl": "./src",
    "checkJs": true,
    "jsx": "react"
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vscode #react #auto #import
ADD COMMENT
Topic
Name
2+4 =