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.

Automatic detection of preconfigured eslint packages

See original GitHub issue

Feature Request: I would love to have automatic detection of the most common “packaged eslint” flavors, specifically standard and xo.

I often contribute to many packages which uses both Standard and XO. My current setup is just to have the StandardJS package installed in VS Code, since that is what I use for my own projects. But that makes basically every line being marked red when contributing to a package using the XO eslint package.

My idea of the ultimate setup would be if this module could detect whenever one of the preconfigured eslint packages is being used in a project, and then load up that config.

In practice, I think this would be easiest to achieve by maintaining a list of packages to look for in the devDependencies, and a corresponding eslint-config for that package.

const eslintPackages = new Map([
  ['happiness', 'eslint-config-happiness'],
  ['semistandard', 'eslint-config-semistandard'],
  ['standard', 'eslint-config-standard'],
  ['xo', 'eslint-config-xo']
])

If this is something that is wanted, I would be happy to help implement it. If you think that this is out of scope for this module, I would totally understand that.

Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
dbaeumercommented, Jul 4, 2018

Thanks for the nice explanation. I wasn’t aware of eslint -c standard. The ESLint extension however doesn’t spawn an eslint process on every linting run. It basically uses eslint as a library and programs against the Node API provided (https://eslint.org/docs/developer-guide/nodejs-api#cliengine). From reading through the documentation your approach should be doable using the configFile option. To test this you could set `“eslint.options.configFile”: “standard” and see what happens.

I am open to a PR that implements this be checking the content of the package.json file.

1reaction
vscodebot[bot]commented, Oct 17, 2019

This feature request will not be considered in the next 6-12 months and has been closed to keep the number of issues we have to maintain manageable. See also our issue reporting guidelines.

Thanks for your understanding and happy coding!

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
eslint-preset-essential - npm package - Snyk
The npm package eslint-preset-essential was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package ...
Read more >
eslint-plugin-react - npm
Start using eslint-plugin-react in your project by running `npm i ... "detect" automatically picks the version you have installed.
Read more >
Automatically lint & format your code on commit when using ...
Since Next.js comes with ESLint pre-installed and pre-configured, ... and detect which linting and formatting tools are already installed.
Read more >
Modern, faster alternatives to ESLint - LogRocket Blog
It primarily excels at doing two things: it finds problems with your code, and fixes them automatically. ESLint is either built in to...
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