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

Automatic conversion of .jscsrc files to .eslintrc files #5857

Closed
nzakas opened this Issue Apr 14, 2016 · 14 comments

Comments

7 participants
@nzakas
Member

nzakas commented Apr 14, 2016

For people coming over from JSCS, it would be nice to have a way to automatically convert their .jscsrc files into equivalent .eslintrc files.

What I have in mind is adding an additional option to --init that is "Convert JSCS configuration file":

  • We could use Polyjuice to do this, and contribute back to Polyjuice to help make it more feature-complete.
  • We'd need to figure out what to do about style presets from JSCS. Some of them already have ESLint shareable config equivalents, but I'm guessing a lot of them do not. We might need to do this manually.

Another option would be to instruct people on how to do the conversion themselves using Polyjuice or some other tool, though it seems like the better user experience would be to have this capability as part of ESLint.

Thoughts?

@ilyavolodin

This comment has been minimized.

Show comment
Hide comment
@ilyavolodin

ilyavolodin Apr 14, 2016

Member

I think using polyjuice inside --init is a better for end users, so I would vote for that approach.

Member

ilyavolodin commented Apr 14, 2016

I think using polyjuice inside --init is a better for end users, so I would vote for that approach.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Apr 14, 2016

Contributor

It might be worthwhile to be able to merge existing .jscsrc AND .eslintrc into a final .eslintrc as some people are already using ESLint in conjunction with JSCS. I know I have for some time, in times when JSCS had way more style-related rules than ESLint.

Contributor

mgol commented Apr 14, 2016

It might be worthwhile to be able to merge existing .jscsrc AND .eslintrc into a final .eslintrc as some people are already using ESLint in conjunction with JSCS. I know I have for some time, in times when JSCS had way more style-related rules than ESLint.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Apr 14, 2016

Member

That's an interesting point. The trouble we always run into when re-writing existing config files is that we end up losing all of the comments, so I'm not sure people would welcome that. We could definitely detect if there's an existing .eslintrc file and do something else (like output to the console instead of the file).

Member

nzakas commented Apr 14, 2016

That's an interesting point. The trouble we always run into when re-writing existing config files is that we end up losing all of the comments, so I'm not sure people would welcome that. We could definitely detect if there's an existing .eslintrc file and do something else (like output to the console instead of the file).

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Apr 14, 2016

Contributor

Hmm, right, I didn't think about comments. The main problem is what to do with converted rules that overlap with the already specified ones. If we had a way to resolve that, omitting the ones that are already present in the console output would help - people would just copy the output and append to the file.

But maybe it's impossible to resolve those conflicts properly.

Contributor

mgol commented Apr 14, 2016

Hmm, right, I didn't think about comments. The main problem is what to do with converted rules that overlap with the already specified ones. If we had a way to resolve that, omitting the ones that are already present in the console output would help - people would just copy the output and append to the file.

But maybe it's impossible to resolve those conflicts properly.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Apr 15, 2016

Member

I think, unfortunately, we may have to rely on people handling those conflicts manually.

Member

nzakas commented Apr 15, 2016

I think, unfortunately, we may have to rely on people handling those conflicts manually.

@alberto

This comment has been minimized.

Show comment
Hide comment
@alberto

alberto Aug 1, 2016

Member

Is there any benefit to do it in core vs a separate tool? Making it part of eslint would mean it'll stay there "forever".

Member

alberto commented Aug 1, 2016

Is there any benefit to do it in core vs a separate tool? Making it part of eslint would mean it'll stay there "forever".

@ndarville

This comment has been minimized.

Show comment
Hide comment
@ndarville

ndarville Aug 1, 2016

eslint/jscs-migrate? Would also make issue management easier, especially when you can add a bunch of specific disclaimers to CONTRIBUTING and ISSUE_TEMPLATE.

ndarville commented Aug 1, 2016

eslint/jscs-migrate? Would also make issue management easier, especially when you can add a bunch of specific disclaimers to CONTRIBUTING and ISSUE_TEMPLATE.

@platinumazure

This comment has been minimized.

Show comment
Hide comment
@platinumazure

platinumazure Aug 1, 2016

Member

I like @ndarville's idea. To me this is similar to how we have eslint-transforms for transforming old-style rules to new-style rules: We could have put that in ESLint, but we wanted to avoid scope creep there and instead created a separate small project. I believe the same thing should happen for this use case.

Member

platinumazure commented Aug 1, 2016

I like @ndarville's idea. To me this is similar to how we have eslint-transforms for transforming old-style rules to new-style rules: We could have put that in ESLint, but we wanted to avoid scope creep there and instead created a separate small project. I believe the same thing should happen for this use case.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Aug 2, 2016

Member

We are trying to make conversion as easy as possible for JSCS users. Asking them to download a second tool is another barrier that we were hoping to eliminate.

Member

nzakas commented Aug 2, 2016

We are trying to make conversion as easy as possible for JSCS users. Asking them to download a second tool is another barrier that we were hoping to eliminate.

@platinumazure

This comment has been minimized.

Show comment
Hide comment
@platinumazure

platinumazure Aug 2, 2016

Member

Hmm. Well, maybe it would be possible to have the logic in another package and ESLint can prod-depend on it. I'm just looking out for ESLint's health, I guess.

Member

platinumazure commented Aug 2, 2016

Hmm. Well, maybe it would be possible to have the logic in another package and ESLint can prod-depend on it. I'm just looking out for ESLint's health, I guess.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Aug 3, 2016

Member

@platinumazure the proposal is to use Polyjuice. (see original description)

Member

nzakas commented Aug 3, 2016

@platinumazure the proposal is to use Polyjuice. (see original description)

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Aug 19, 2016

Member

After thinking about this some more, I wonder if we can get away with just having people use Polyjuice directly. It would mean we don't have to add anything specifically to ESLint, avoiding another dependency. We would just have to make sure that the documentation called out this step.

Thoughts? @markelog

Member

nzakas commented Aug 19, 2016

After thinking about this some more, I wonder if we can get away with just having people use Polyjuice directly. It would mean we don't have to add anything specifically to ESLint, avoiding another dependency. We would just have to make sure that the documentation called out this step.

Thoughts? @markelog

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Aug 19, 2016

Member

Yeah! I think that works

Member

markelog commented Aug 19, 2016

Yeah! I think that works

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Aug 19, 2016

Member

Okay, closing this and will roll the work into #5859 (which I'm starting).

Member

nzakas commented Aug 19, 2016

Okay, closing this and will roll the work into #5859 (which I'm starting).

@nzakas nzakas closed this Aug 19, 2016

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.