Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upSuggestion: splitting core out #87
Comments
This comment has been minimized.
This comment has been minimized.
|
A nice command line wrapper around an .eslintrc file is an interesting idea. I don't know if letting a thousand standards bloom fits with the initial motivations of creating this tool. An all purpose wrapper may require some broader design decisions, such as bringing in additional linters. I guess all it takes is someone motivated enough to fork and work on it! |
This comment has been minimized.
This comment has been minimized.
|
I'm against this unless it somehow benefits Creating a
Totally understand your concern here. My suggestion would be to just create simple |
This comment has been minimized.
This comment has been minimized.
|
The benefits: separation of concerns, modularity and semantic versioning. e.g. A hypothetical Forking
I already have. The reason a tool like |
This comment has been minimized.
This comment has been minimized.
The way golang developers solved this is by having |
This comment has been minimized.
This comment has been minimized.
|
@mattdesl you've piqued my interest with this idea. Exploring it now... Will probably use semistandard as a test subject. |
This comment has been minimized.
This comment has been minimized.
|
OK so I did this: https://github.com/Flet/standard-engine (a bit rough still, be gentle So now making a cli linter is just creating a new module with a #!/usr/bin/env node
var path = require('path')
var pkg = require('./package.json')
require('standard-engine').cli({
// cmd, homepage, bugs all pulled from package.json
cmd: 'semistandard',
homepage: pkg.homepage,
bugs: pkg.bugs.url,
tagline: 'Semicolons For All!',
eslintConfig: {
configFile: path.join(__dirname, 'semistandard.eslintrc.json')
}
}) |
This comment has been minimized.
This comment has been minimized.
|
@Flet Lolol, that interface is ridiculously simple. Leaving in the middle if having multiple |
This comment has been minimized.
This comment has been minimized.
|
@Flet I was also thinking having a formalized JSON (or HJSON) export for (annoyingly ESLint uses different semantics for configFile, like "globals" as an object rather than array)
Ideally there would just be one, but realistically it will be a long while before I can convince a team of devs to change styles and adopt new editor tooling on the drop of a hat, and much longer before the entire community stops quipping about semicolons, tabs etc. Until that time, I'd still like to reap the benefits of standard (versioned and centralized rc files for many modules). Thinking long term, maybe the core engine should just be named |
This comment has been minimized.
This comment has been minimized.
pluma
commented
Mar 31, 2015
|
It's either this, or drop the anti-semicolon rules in standard so this module can actually become something of a standard convention. This module claims to represent a consensus of the JS community but seems to be at odds with what the majority of the community agrees on (e.g. semicolons, spaces after function names). We chided Crockford for how opinionated he made jslint, let's not repeat that with standard. There are already competing style guides, standard is not going to change that. If standard can improve the formalization of those style guides, it adds value. What's more, if standard's core can be used to make the specifics easily swappable (i.e. allow re-using the tooling that can be built around standard to work with other style guides too), it encourages users to switch to standard because the failure scenario (i.e. what if they don't like it and want to go back) is a lot less expensive. Having only one style guide for the entire language is not going to happen. Look at Python: the language itself is fairly unflexible, the core ethos is "write for the future maintainer, not yourself" and the style guide, PEP8, is as offically blessed as possible. Yet there is tons of software out there that doesn't use the same style guide for various reasons. PEP8 conformance is generally seen as a good thing, yes, but even open source codebases don't always adhere to it. The only example of a universally accepted style guide I can think of is Go and Go has the benefit of having it built right in the tooling (and not having any alternative language implementations like, say, JavaScript has by the dozen). |
This comment has been minimized.
This comment has been minimized.
In time, I believe this will become the predominant "standard" convention. I plan on using it in all of my modules (> 100). Heck, I've even thought about giving some talks about project and the impact that it will have.
While closely related,
Yep. But fortunately this isn't a "guide". This is more than a "guide". This is the "law" (for those that use and adopt it). That's precisely what all of the guides missed before.
Fortunately there's |
This comment has been minimized.
This comment has been minimized.
pluma
commented
Mar 31, 2015
|
Not to derail this conversation further, but @jprichardson, what makes you think this will become the predominant convention? A few years back comma-first was all the rage and now we all agree that wasn't as brilliant as we thought (although the @isaacs article linked in the README mentions it). Semicolon-free syntax has been a thing for at least as many years but doesn't seem to be going anywhere (according to various surveys and an analysis of actual code styles on GitHub). It also doesn't buy you much other than making the code look more like Ruby (having to prefix IIFEs and array literals with an unary operator or semicolon is a major nuisance). So far the only thing standard has going for it is that some people use it (so what?) and the tooling, which |
This comment has been minimized.
This comment has been minimized.
|
@pluma Please let's not derail this any further; this thread is not about semicolons. This is a proposal to split out the "guts" of standard so that other modules and tools (like semistandard) can reap the same benefits without having to maintain a fork. It is not an attempt to change the philosophy or eslint rules of |
This comment has been minimized.
This comment has been minimized.
|
@feross let me know what you would like to do here. Open to anything including transferring standard-engine to you or deferring to a new repo. I feel that abstracting the core fits the spirit of the ecosystem and allows others to iterate on their own nicely. |
This comment has been minimized.
This comment has been minimized.
|
FYI, updated |
This comment has been minimized.
This comment has been minimized.
|
This has been done! standard-engine is now used by Released as 5.0.1 by @feross! |
mattdesl commentedMar 26, 2015
Just flowing some thoughts here, let me know if you guys are interested or not.
What if the core was split into its own module to better facilitate forks like
semistandardand create an ecosystem likegoogle-standard,airbnb-standard, etc. The module would just handle ESLint reporting with a given config. Thenstandardwould be a thin wrapper around that module, using the current.eslintrc.Having everybody on the same page is great for npm as a whole, but also a difficult goal to attain given the diversity of JS devs and their work. For example; a lot of client work I do gets touched by many devs (freelancers, juniors, co-op students, etc) and runs on very tight deadlines. Rules like
newline at end of file,space after comments,single quotes onlyslow down our development and lead to distracting lint noise.However, it would still be beneficial for us to have a tool like
jam3-standardso that our modules can catch true syntax errors. It also means that we can releases changes to our code style using SemVer, which is (in my view) a huge innovation brought forward bystandard.