2

Below is the process I am doing in VSCode to setup for every project I create:

  1. run command npm init from project folder and this is creating package.json file.
  2. Run the command eslint --init and it asks bunch of questions about modules, framwork etc and it creates eslintrc.json file.

If I don't do these steps, every time I open a js(helper.js or controller.js files) file, it shows error message at the bottom right corner saying ESLint configuration not found.

Is there a easy way of doing this so that it works with every project that I create in VSCode?

EDIT:

  • VSCode version: 1.35.0
  • Salesforce Extension Pack: 45.15.1
  • Output of command sfdx --version

sfdx-cli/7.8.1-8f830784cc darwin-x64 node-v10.15.3

  • 1
    Is this specifically in regards to DX, or VS Code in general? – sfdcfox Jun 11 at 18:41
  • I have Salesforce DX extension installed and creating project using the option Create project with manifest. – javanoob Jun 11 at 18:43
  • 1
    Are you on the latest version of VS Code, the Salesforce DX Bundle, and SFDX? Try updating all of them and see if that makes a difference. I know that older versions of the bundle didn't seem to work right, but I haven't had an eslint error in a while. – sfdcfox Jun 11 at 18:45
  • @sfdcfox I think I am using everything latest. Updated question with version details. – javanoob Jun 11 at 18:49
  • 1
    Hmm, okay, I think I'm out of ideas. Sorry 😢. All I know is that it works for me, when I load a project it creates a .vscode/settings.json, and eslint is already configured there. In fact, it's a custom lwc version in c:\\Users\\brian\\.vscode\\extensions\\salesforce.salesforcedx-vscode-lwc-45.15.1\\node_modules. I presume if everything is working correctly, the file should already be there. The only other suggestion I have would be to uninstall and reinstall VS Code and/or all your extensions to see if that fixes it. – sfdcfox Jun 11 at 19:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.