question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't modify eslint path automatically, don't automatically change user settings

See original GitHub issue

Every time I open VSCode this extension automatically adds "eslint.nodePath": "/Users/myuser/.vscode/extensions/salesforce.salesforcedx-vscode-lwc-45.15.1/node_modules" to my settings.json file.

Please stop auto modifying config files, this affects any VSCode session I open regardless of it’s a Salesforce project. It happens without prompting. Your extensions have already fully deleted my local config settings in the past from trying to do things like this. Now you’re auto modifying them? Please don’t add behavior like this to plugins!

This breaks any project with custom ESLint plugins, because it tries to use a randomly installed one in the sfdx plugin, not the correct locally installed on per project.

For anyone else who has their config mangled by these bad actor plugins and starts seeing errors like this because it’s using a randomly installed eslint:

[Error - 11:43:40 AM] Cannot find module 'eslint-plugin-prettier' Referenced from: /Users/me/repo/.eslintrc.js

You can block the bad plugin by setting it manually:

  "eslint.nodePath": "./node_modules"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
AndrewRayCodecommented, Jun 20, 2019

yikes

this is a serious issue, please re-open

3reactions
rtmcommented, Sep 3, 2019

I am not a happy camper at the moment because the build and deploy is failing due to conflicts caused by jsconfig.json being randomly rewritten. To follow up on my previous post:

  1. Who/what exactly is rewriting jsconfig.json?
  2. Why are they doing so?
  3. Why does jsconfig.json seem to require a paths property which points each LWC in the tree to itself, more or less?
  4. How can we turn off rewriting jsconfig.json?
  5. If we are able to turn off the rewriting and do so, what is the impact? Will we need to manually update it each time we add a new LWC to the tree?
  6. What is the purpose of jsconfig.json? Who is consuming it?

If for some reason there is a need to rewrite jsconfig.json, then a better approach would be to provide a script or SFDX command that creates a new one that people could use when, and only when, they want to.

Appreciate your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuration Files - ESLint - Pluggable JavaScript Linter
ESLint supports adding shared settings into configuration files. Plugins use settings to specify the information that should be shared across all of its...
Read more >
Working with Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Ignoring Code - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Working with Plugins - ESLint - Pluggable JavaScript Linter
The generator will guide you through setting up the skeleton of a plugin. ... People don't need to specify the file extension-named processors...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found