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.

Option to opt-out of eslint-plugin-react

See original GitHub issue

Current Behavior

tsdx supports eslint-plugin-react outof the box. If React is not used this warning pops up:

Warning: React version was set to "detect" in eslint-plugin-react settings, but the "react" package is not installed. Assuming latest React version for linting.

Desired Behavior

Opt-out of eslint plugins that are not in used. For example, I’m using tsdx to build a logger plugin for a specific library. I don’t need .eslintrc extendingreact-app, because my work is only node related.

Suggested Solution

My suggestion is to remove any dedicated eslint plugin except the ones that are typescript and prettier related. User would manually add additional rules to the project if needed, for example eslint-plugin-vue, and configure it in the local .eslintrc. This way tsdx remains decoupled from any specific library.

Who does this impact? Who is this for?

TypeScript users that develop plugins, libraries for NodeJS.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
sw-yxcommented, Nov 4, 2019

@arthurdenner i’d be happy to accept a PR for this

1reaction
arthurdennercommented, Oct 30, 2019

@zcuric, as I said, it definitely can be done. If you want to work on it, you just have to change the ESLint config that is created on the lint command. My point was that we are currently using a tool that handles more than just React, so removing it requires more changes and I’ll wait for some input from maintainers to suggest some changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

eslint-plugin-react - npm
Start using eslint-plugin-react in your project by running `npm i eslint-plugin-react`. ... Automatically fixable by the --fix CLI option.
Read more >
12 essential ESLint rules for React - LogRocket Blog
ESLint has a comprehensive set of rules for JavaScript code that cover stylistic choices and prevent common bugs. Using ESLint alone will give ......
Read more >
How To Customize ESLint Rules with an Ejected Create React ...
Ejecting a Create React App Project · eslint is the core JavaScript linter. · eslint-loader tells webpack that you want to use eslint...
Read more >
Rules - ESLint - Pluggable JavaScript Linter
Rules from Plugins ... To configure a rule that is defined within a plugin, prefix the rule ID with the plugin name and...
Read more >
Setup ESLINT and PRETTIER in React app
In React - 17.0.0 , importing react to a file is optional, To fix this, we will add a rule to our .eslintrc...
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