Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous script in usage guidelines #20

Closed
ghost opened this issue Apr 13, 2017 · 5 comments
Closed

Ambiguous script in usage guidelines #20

ghost opened this issue Apr 13, 2017 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 13, 2017

https://github.com/feross/eslint-config-standard-jsx#usage

Here's how to install everything you need:

npm install --save-dev eslint-config-standard eslint-config-standard-jsx eslint-plugin-promise eslint-plugin-react eslint-plugin-standard

What does that even mean? It makes me feel like I should just grab stuff and run it without fully understanding it.

@feross
Copy link
Member

feross commented Apr 13, 2017

Sorry that this isn't very clear. This package is intended for experienced ESLint users, so the docs don't go into very much detail.

Basically, you're creating an ESLint config file that references two configurations:

{
  "extends": ["standard", "standard-jsx"]
}

Those are shorthands for eslint-config-standard and eslint-config-standard-jsx. The first provides most of the rules that make up standard, and the second provides a few additional JSX-specific rules. They're split up so users who don't use JSX can omit the latter.

These configuration files reference rules that are part of ESLint itself, as well as rules that didn't make it into ESLint core, but that are still really useful to have. These rules live in third-party plugins. You can see a few of these rules here, for example.

eslint-config-standard uses several plugins:

  • eslint-plugin-standard
  • eslint-plugin-promise
  • eslint-plugin-import
  • eslint-plugin-node

eslint-config-standard-jsx uses only one:

  • eslint-plugin-react

I know that's a lot of things to install, but unfortunately, that's how ESLint shareable configs work. It would be great if we could include the above plugins as dependencies of the shareable configs since they really are an implementation detail, IMO. But unfortunately, the ESLint team was against this idea. Full issue with context here: eslint/eslint#3458 Maybe this will happen in a future version and we can simplify the install instructions.

@feross
Copy link
Member

feross commented Apr 13, 2017

In the future, I expect to deprecate this package (eslint-config-standard-jsx) and just put the JSX rules into the main eslint-config-standard file, so there's only one config to install to get the complete standard rule-set.

The main reason that we split these JSX rules out was because it felt weird to have everyone install eslint-plugin-react when they didn't necessarily even use React. We don't actually enforce any rules that are React-specific, but the plugin name implies otherwise. We thought this was less confusing.

However, we now bundle several plugins for Node, import, promises, etc. in the main config and not all users necessarily use Node, import statements, or promises. So, that bridge has already been crossed and there's not much reason for this package to continue to exist.

@rstacruz
Copy link
Member

rstacruz commented Apr 14, 2017

<aside> would it be easier to understand if we formatted it this way?

npm install --save-dev \
  eslint-config-standard \
  eslint-config-standard-jsx \
  eslint-plugin-promise \
  eslint-plugin-react \
  eslint-plugin-standard

@feross
Copy link
Member

feross commented Apr 14, 2017

@rstacruz Yeah, I think so :)

@prateekrastogi
Copy link

@feross Any further progress in the plan to include it in standard package for having a singular style for both client and backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants