-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ESLint 2.0.0 Wish List [$10] #2203
Comments
I should note: I'm not saying these are definitely in, just things that have been top of my mind and warrant some discussion. |
I would probably still want support for selectors in the core. Would make writing plugins quite a bit easier. |
This is probably better left to a separate project. |
Agree with @michaelficarra That could be a separate project under ESLint org. I would also add that I don't think ESLint should autofix the code. It could provide suggestions and enough information to some other tool to rewrite the code, (like modified AST), but I think it should be another tool that actually does code output. |
Agreed about just providing suggestions. In fact, I had assumed that's what @nzakas meant. |
Selectors are a good one! +1 for that. I was actually thinking that configuration detecting would be part of the core. The rain is that trying to keep two utilities in sync with regards to rules would be difficult. The way I'm thinking about it : the rules already can detect this information, we just flag the negation of an expectation. We could run the rules in a different mode and have them report what they found instead ( |
You could still do it as a separate tool, that just runs ESLint CLI and processes error messages. If we implement a way for rules to report all of their options, it can collect that and check error messages against rules schema. |
Yeah, it can be more complicated - but let's not debate implementation details here. Let's just focus on high-level things we'd like to consider. |
How about this: remove styling rules from ESLint and make JSCS a dependency and use their styling rules? Sort of like a special case plugin. I know it's a bit out there, but there are so many preferences for styling that keeping all of them available and up to date will probably take the biggest chunk of everyone's time. |
That's pretty out there. :) I'm not sure I can rationalize outsourcing a big chunk of our functionality to another utility. Plus, we'd still be stuck in a maintenance issue of keeping up with whatever changes are made. A somewhat less radical (but still radical) thought: what if we exported all of our rules into plugins so that the ESLint repo is just for the core and rules are always handled through plugins? (This thought has crossed my mind...still not sure I like the idea.) |
I think npm's peerDependencies needs to be improved before exporting all rules as plugins. I get a warning (and nonzero exit code) any time I npm install -g anything because two plugins are fighting about eslint's version. In addition, this might create a lot of verbosity or naming collisions. Which plugins get first class rule names and which need a prefix for example? |
This idea crossed my mind as well. Generally I like this approach, we could officially maintain those plugins in the eslint organization. The biggest advantage of this would be the release management, we could make breaking changes to rules without the need to release a new major version of eslint. |
@gcochard I thought that’s already on the roadmap of npm v3. |
There's definitely some nice effects from splitting all rules into plugins, but it also complicates releases. For instance, how do we account for rule documentation? There is overhead related to doing releases, so if we end up needing to do 7 releases instead of 1, do we have enough people who would want to manage those? (It would be way too much for me to manage on my own.) So, we can definitely explore that idea, we just need to be sure to really dig into the logistical issues it would open up. |
Another thing that I would like to tackle early on after 1.0.0 release (probably before 2.0.0) is refactoring eslint.js and extracting everything that has to do with configuration from it. There's a lot of code that just tweaks config based on comments and so on, and it really shouldn't be in the eslint.js. Not specifically a feature, mostly just cleanup, but I think it's necessary. |
@nzakas good point, maybe the eslint site should be able to display the documentation of any plugin (if there is any), but that would be beyond static site generation. Another feature I would like to see in eslint is to make it possible to apply a configuration based on a glob pattern. Sometimes I'm in the situation where I can’t organize my files in a way so that everything can be configured precisely with the directory hierarchy. For example given the following directory structure:
There is no way to apply specific rules only to |
I'm curious if #1637 would help that situation? |
As far as I understand #1637 it would not solve my problem, I would still need to create an |
Got it. |
How about a global concessions file, which would allow you to exclude based upon:
If a rule doesn't match then it should also cause an error itself; this gives application managers a centralised place to managing exceptions rather than allowing quick exceptions to a applications styles in comments or other methods. This is something I have used in work settings and it helps manage governance of coding issues especially if the file accepts comments and ordering. Advantages:
Disadvantages:
Alternatives:
|
@jonathanKingston I'm not familiar with this concept and I'm having trouble understanding what you're describing. Is there some place you can point me for more information? |
I would also like to see the ability to enable multiple formatters/reporters. This is useful when running eslint on a CI-system like jenkins. I would like to have the stylish report on the terminal AND a checkstyle report written to a file. |
That's interesting! Another thing I'd be interested in seeing is suffixed .eslintrc files, so you could do .eslintrc.json or .eslintrc.yml to get source code formatting in editors. We could basically look for all the filenames and just use the first one found. |
One thing we came across recently was trying to share Our issue is that some projects may want to tweak those rules very slightly, but still maintain the same shared style across a company. Based on the order of precedence, this is very difficult. I think if the |
@thefotios sorry, that's not something we are going to do. It took a lot of work to get the cascade working correctly, we aren't going to change it. Any changes need to in addition to what we already have. Please file a separate issue describing your problem and we can see if there's a way to solve it. Keep in mind, this issue is for significant changes to ESLint (see other suggestions on this issues). |
While we're talking about big changes, what about dogfooding ES6 support by using it in the main codebase? I don't know whether I like this idea since it would require adding a build step, but I'm curious what other people think. |
@ilyavolodin yeah, definitely! @willklein that would be great. The reason we said post-1.0.0 is due to the various rule changes (#1898) coming in 1.0.0. We'd want to ensure those are incorporated. |
Hi guys any plan to support globs and only operate on files that have changed since last run?
I have written a module eslinter that does both things but it would be nice to support that in eslint directly. |
@royriojas globs support is schedule after v1.0.0 Interesting idea about caching... I'm not 100% how often that would be used though. You would only get performance improvement if you run eslint on large repository often. I usually run it only once per push, and in between I just run ESLint through editor plugins on a single file. |
In the current project I run the tool over an average of 300 files. it takes 8 seconds to finish. With the cache the time is reduced to the order of milliseconds (depending on how many files are changed). As part of our workflow the process also beautifies the files (I'm using esformatter and configured it to match the format expected by eslint), that process also takes about 8 seconds without the cache, even when the files were already beautified. That's why I decided to try to find a solution for that and wrote esbeautifier which also only beautifies the files that changed. In both cases the cache really helps! I know 16 seconds doesn't seen that bad, but why wait? |
And what about passing arguments to the formatters? currently the cli parser will strip all the arguments that don't recognize. Maybe defining them in the would love to see a way to pass arguments ;) |
+1 for a watch option |
@royriojas We wouldn't be able to pass arguments through .eslintrc, as there might be many .eslintrc files, but there's always only one formatter. We might be able to do that through CLI options. |
@royriojas can you open a new issue about this? It sounds interesting, and I dont want to lose the discussion amongst everything else in this issue. |
@nzakas which one? the cache or the globs? |
globs are already on the tentative roadmap, so I'm guessing it's cache. |
Cache, yes |
thanks @ilyavolodin! @nzakas here it is: #2998 |
Is there the person who is interested in i18n? I'm interested in Japanese translations for warning messages and documents. |
Ooh, that would be interesting! |
i18n would be really cool. @ilyavolodin's work in #2861 to separate error messages from implementation would help with that. |
I may be able to help with i18n. |
I might be able to help as well with adding i18n to eslint. I'm interested in it mainly for educational purposes, specifically coding in Dutch middle school, where the students only have a very basic understanding of English. I've looked through PR #2861, and I understand there are some concerns about where the translations should live, and the need for a more thorough proposal for i18n in eslint. I'd need to familiarize myself with eslint's structure more before I'd be able to contribute. |
The path we chose at where I work was to treat translations as a dependency and use Transifex as our "translation manager" just like many projects use |
Thanks for all the brainstorming! I've consolidated this discussion into #3561, our official 2.0.0 roadmap. |
As we are getting closer and closer to v1.0.0, it's time to start thinking about what a v2.0.0 would look like. Here are the things that have either come up recently or have been on my mind:
What other ideas do you have about big things we could tackle for 2.0.0?
Did you help close this issue? Go claim the $10 bounty on Bountysource.
The text was updated successfully, but these errors were encountered: