-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Extensions proposal (not about making Standard "configurable") #703
base: master
Are you sure you want to change the base?
Conversation
> **Note: This is a curated, [white-list](https://en.wikipedia.org/wiki/Whitelist) set of extensions.** | ||
|
||
- [React](https://www.npmjs.com/package/standard-extension-react) | ||
- [AVA](https://www.npmjs.com/package/standard-extension-ava) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, these do not exist, yet.
IMHO NACK, extending the project is very easy by just using |
@dcousens true, but it won't be JavaScript Standard Style any more! This extensions proposal allows enjoying official Standard with official extensions. These extensions will be curated to be consistent with the values of Standard. |
And neither will this extended version. One JavaScript Style Guide to Rule Them All Extensions aren't compatible with that idea. The only exceptions I've seen related to this is in regards to things like how we handle JSX/React, and could handle Typescript etc. |
It is exactly for things like React, JSX and AVA, which should not be added by default to Standard (we had React and JSX and they were removed), yet, we should allow users to choose to use them. And still be able to state truthfully that they are using Standard. Because they are. Extensions are the de-facto concept for this situation, where subsets of users would like something which should not be in core. |
Any thoughts, @feross ? |
Another possible extension that I assume will be very highly used could be based on https://github.com/mysticatea/eslint-plugin-node. |
One of the main principles of standard is "No configuration". I feel like this goes against that principle, so I'm not in favor. Extending Sorry @mightyiam, this is a neat idea but it seems to deviate from the goal of |
The principle of "no configuration" serves purposes:
Further, standard provides:
Standard extensions, as I defined them, will not override any one of Standard's core rules. They are meant for specific popular libraries like Node.js, AVA, React, JSX, etc. Therefore, they are hardly "configuration" and will not infringe upon "I easily install and move on". Regarding "there's no discussion in the team regarding linting rules"; the only discussion that could be had is about whether to include an extension or not. Here's more about it: Without extensions:
With extensions:
In my heart, the latter wins big time. |
Yeah let's not make standard configurable. For me personally this would be
interesting as I'd love to disallow almost everything in ES{6,7}, but I
think that'd best be served as a separate package.
…On Tue, Nov 29, 2016 at 10:05 PM Shahar Or ***@***.***> wrote:
The principle of "no configuration" serves purposes:
- "I easily install and move on"
- "there's no discussion in the team regarding linting rules"
Further, standard provides:
- "I get excellent curated rules"
- "I'm hip"
Standard extensions, as I defined them, will not override *any* one of
Standard's core rules. They are meant for specific popular libraries like
Node.js, AVA, React, JSX, etc.
Therefore, they are hardly "configuration" and will not infringe upon "I
easily install and move on".
They will not violate "I get excellent curated rules".
They will certainly only contribute to "I'm hip".
Regarding "there's no discussion in the team regarding linting rules"; the
only discussion that could be had is about whether to include an extension
or not. Here's more about it:
Without extensions:
- no discussion
- one of
- no library-specific rules
- extending eslint-config-standard, which means: *open to
discussion regarding any possible eslint rule*
With extensions:
- discussion whether to include *official, curated*, Standard set of
rules for each relevant extension
In my heart, the latter wins big time.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#703 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACWleq6gaadEQsViyBZ1sNIzd2aGCoC_ks5rDJOmgaJpZM4K79qm>
.
|
This is not about making Standard configurable. On the contrary. The situation now is that anyone who wishes to use any library-specific rules goes ahead and uses Official and non-overriding extensions remedy that. They:
So extensions are not about configuration. They are about official extension and they in fact discourage configuration by providing a better alternative to using |
I'm not against the idea, provided the following was in place:
But, I'm not really phased either way. |
I actually think this is an interesting idea. I don't want to make However, I want to get |
For reference, Canonical is extensible: |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
No! This is a great idea! Don't stale it! |
That also should help with cases like Vue and Flow eslint plugins, which are right now impossible to use with Standard at all. Like, really, Vue is on top with React and Angular, and Standard does not support it... |
This would be awesome. |
This proposal has been sitting here for a while. Is an implementation PR welcome, please? |
Story time: The company I work for, Edge wallet, started using Standard.js very early on. It was easy to set up, and things were great! Soon after, we decided to adopt Flow typing as well. Now things got messy, since Standard.js only understands vanilla Javascript, not language dialects like Flow. So, we did what everyone in this thread is suggesting, and switched to ESLint + eslint-config-standard. This worked. Unfortunately, we have quite a few repositories at our company, including everything from little helper libraries to our giant React Native application. Each of these repositories now has some random ESLint configuration, depending on when we created it and what other repo we copied the configs from. I spend quite a bit of time going from repo to repo updating linting tools, which would be better spent fixing actual bugs. So, while Standard.js started off as a simple idea for us, downgrading to ESLint has turned it into a bit of a mess. To simplify things, I made an ESLint configuration tool to automate this process, as well as re-packaging the Standard.js rules in a simplified format, but the config files still get really ugly when you tick all the boxes. How can this be better? I don't know. Our ESLint configuration also includes things like Git integration, so extending Standard.js to support dialects like Flow wouldn't solve everything. I see three main options:
Of the three options, 1 and 3 seem the most long-term sustainable for Standard.js itself, while 3 would be the most sustainable for both the project and its users. |
Thank you so much for your input, @swansontec. |
Extensions proposal
Background
In the past we had a React and a JSX plugin. To avoid bloat, these were removed from standard. Were they dependencies? I've recently suggested an AVA plugin and it was refused to avoid bloat.
Avoiding bloat is great. Yet, as it is, feross/standard is not extensible. So, in order to use feross/standard and probably all other front-ends for Flet/standard-engine combined with some other set of rules, like for React or AVA, one would use ESLint directly, extending on feross/eslint-config-standard.
Use
What if all one had to do, is to install standard and some extensions and it would just work?
$ npm --save-dev install standard standard-extension-react standard-extension-ava
Zero configuration. Just like that.
Principals
No duplicate rules
There would have to be an assertion in standard-engine that none of the rules from plugins override any rule from eslint-config-standard and perhaps also that they do not override any of each other's rules. In short, no overrides at all. No duplicate rules.
Curation
Now, not just any package with the name standard-extension-* would work. The extensions will be curated/white-listed in feross/standard and possibly owned by the same team. Or perhaps we should make it an organization (but that's a tangent).
Going forward
Please provide feedback:
Candidate extensions
typescript
Would be based off of the existing eslint-config-standard-with-typescript.
end-project
A project that is not imported and used as a library / package in another project.
The only issue with enabling this in core is described here.
react
Rules that are specific to React. Perhaps includes JSX? I'm not familiar with the ecosystem.