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
Identify gaps between ESLint rules and JSCS rules #5856
Comments
As for the first rules added, these were the versions used by Polyjuice:
JSCS has added many rules after that release until
I will need to take a look at those to enable Polyjuice to translate them and be compliant with the latest release of both ESLint and JSCS. As for JSHint, no rules were added. |
Thanks @brenolf ! Some of these we definitely already support. Here are the ones I can think of off the top of my head:
|
JSCS uses require/disallow so those are probably combined in eslint (for example requireSpacesInGenerator and disallowSpacesInGenerator) |
Ah right. |
Polyjuice |
@brenolf awesome! Pasted here for easy reference with some notes:
@eslint/eslint-team any other thoughts here? |
There are also configuration value mappings that are missing. For example, the no empty block rule in eslint didn't allow empty catch statements (so it's now optional) where as the default in JSCS allows empty catch statements. That's just one example, but we need to account for this better. |
Agreed. Any idea how best to track that info? |
What I did when I first ported all JSHint options to JSCS was create a master ticket with checkboxes. First set of checkboxes should be missing rules, second set is missing rule options. IIRC, @nzakas you even went a step further and made a google doc. That might be in order for this. |
A long time ago, I'm not sure it would be relevant now. Maybe as a first step it would make sense to create a spreadsheet of every JSCS rule and option, and then we can collaboratively fill in compat info? |
Sorry, I meant spreadsheet and not doc. We're on same page. |
Do you have an easy way to generate a list of each JSCS rule and its options? I can send you my original spreadsheet, though I think we might want to start fresh with a new list to make sure we aren't relying on old data. |
@nzakas I'm afraid to map such rules like |
object-curly-spacing and SpacesInsideImportedObjectBraces are both misnomers. Named imports are not objects. I'd suggest that the rule be renamed or aliased: object-or-import-curly-spacing |
@brenolf, IMO, what should happen here is we should map the two and see if anyone complains about wanting two different styles between objects and named imports. My guess is it's effectively zero people. In general, JSCS was overly specific about customization. I honestly doubt there would be users who want two different styles here. |
@mikesherov agreed. There are already some rules in Polyjuice which are "loosely" mapped; One I recall is |
@mikesherov renaming rules is a breaking change, and we generally don't do that unless absolutely necessary. We can definitely investigate aliasing rules, though I'm a bit worried about how confusing that would be users. My original question stands: is there a way to easily generate a complete list of JSCS rules and options for each? It seems like jscs.info is generated, so maybe this is possible? @hzoo |
Rule names yes, rule options I don't think so. Thankfully though the setting of config options is isolated in the configure method of each rule, so not totally terrible to do manually. |
@nzakas Right like Mike mentioned, it was only for the rule names since we didn't end up implementing a declarative rule option syntax. |
Done, but not completely. I'm not familiar with JSCS, so mistakes probably exist. |
Awesome - does look like it covers all the rules, I guess for options we'll have to go through those rather manually |
@mysticatea Long ago I started a list like that, but it's very raw. I believe most of that was what I used in Polyjuice as for JSCS PS: If it's interesting somehow here is a similar list with JSHint rules. |
I made proposals for red cells in my spreadsheet. |
Wow, nice work @mysticatea! |
Hi everyone, as I'm migrating from jscs to eslint I thought I'd mention some rules I come across that I see are missing and don't seem to be mentioned on this page. I'll edit this comment as I find more. Apologies if you are aware of any of these already.
|
@adambuczynski Thanks for calling that out! Does issue #3229 cover this? |
@platinumazure yep it seems to indeed! |
@adambuczynski Awesome! I see that the issue is already in our JSCS Compatibility milestone, so I believe there's nothing we need to do here (besides actually implementing the change 😄). Thanks again for calling it out! |
@mysticatea I'm making the transition from JSCS right now and I found this spreadsheet to be essential. As a fairly new user to both JSCS and ESLint, I found myself trying to wade through the What would be most excellent is if this mapping from JSCS was at least tagged within their corresponding ESLint rule docs, so that when I search for 'SpacesInFunctionExpression', or 'function spaces' or something, I'm can find what I'm looking for; |
I actually did it the hard way, and sort of tried to find the rules one by one at first, until I realized it's easier to just go over the ESLInt rules instead and apply what you want from that. I found most rules that I use are already implemented, so I've been able to make a fairly smooth transition. 👍 |
Hi, |
Is there anything left to do for this issue? I'm aware that there are still a few JSCS compatibility issues left (see the project), but it seems like this issue can be closed because we've finished identifying gaps between ESLint rules and JSCS rules. |
I think you're correct. The work for this has been done. Most of the remaining issues are accepted - I'm going to try and take some time to knock them out over the next few weeks. |
As a first step in improving compatibility between JSCS and ESLint, we need to identify the gaps between JSCS rules and ESLint rules. Polyjuice had done some initial analysis that can be found here: https://github.com/brenolf/polyjuice/blob/master/doc/JSCS.md (this is a list of rules and options that ESLint doesn't cover).
I'm not sure what other changes have happened or what version Polyjuice was referring to, so we probably need to double-check that information and see if there are any other gaps.
Let's use this issue to build up a list of missing rules and missing rule options, and then we can file separate issues to implement each of the missing things.
The text was updated successfully, but these errors were encountered: