Skip to content
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

An error occurred when using single quote. #129

Open
Naoto00 opened this issue Jun 3, 2019 · 3 comments
Open

An error occurred when using single quote. #129

Naoto00 opened this issue Jun 3, 2019 · 3 comments

Comments

@Naoto00
Copy link

Naoto00 commented Jun 3, 2019

"kintone-customize-es5" does not give an error when using single quote, but "kintone-customize-es5-prettier" gives an error with single quote.

Could you please unify the rules?
Thank you.

@Naoto00 Naoto00 changed the title Error when using single quote. An error occurred when using single quote. Jun 3, 2019
@koba04
Copy link
Contributor

koba04 commented Jun 3, 2019

@Naoto00
Thank you for reporting this!

Yeah, presets including -prettier suffix disable stylish rules including quotes.
Prettier adopts double-quote as its default rule, which is conflicting with the quote rule of cybozu/eslint-config.
The reason of the conflict is that we added Prettier support later.

When you change your lint rule from kintone-customize-es5 to kintone-customize-es5-prettier, you would have to need many diffs to pass the lint rule other than quotes, so I feel quotes isn't a special.

Personally, I'm ok to change the quotes rule of cybozu/eslint-config, but it's going to be a breaking change.
So we need a benefit for this breaking change.
Please tell me the reason why you'd like to unify the quotes rule between "kintone-customize-es5" and "kintone-customize-es5-prettier" 🙏

@Naoto00
Copy link
Author

Naoto00 commented Jun 4, 2019

I have two points.

I think the biggest problem is error or warning.
Double quotes are displayed as warnings in kintone-customize-es5.
However, single quotes are displayed as errors in kintone-customize-es5-prettier.
I do not feel that it is a problem if both are warning.

The default rule for eslint is double quote. https://eslint.org/docs/rules/quotes
However, kintone-customize-es5 has been changed to single quotes.
So I thought it is necessary to change even kintone-customize-es5-prettier.

I'm sorry, I didn't consider other rules.

@koba04
Copy link
Contributor

koba04 commented Jun 5, 2019

@Naoto00

I think the biggest problem is error or warning.
Double quotes are displayed as warnings in kintone-customize-es5.
However, single quotes are displayed as errors in kintone-customize-es5-prettier.
I do not feel that it is a problem if both are warning.

That's intentional.
-prettier presets are designed with Prettier so the error never happens as long as using with Prettier.

However, kintone-customize-es5 has been changed to single quotes.
So I thought it is necessary to change even kintone-customize-es5-prettier.

I prefer single-quote to double-quote because it's widely used in JavaScript ecosystem.
https://bytearcher.com/articles/single-or-double-quotes-strings-javascript/

(In addition to that, typing single-quote is easier than double-quote for US keyboard users)

But with Prettier, I recommend using Prettier with the default setting, which is important than consistency between kintone-customize-es5 and kintone-customize-es5-prettier because I don't want to force to customize Prettier setting for users.

Could you tell me what troubles you have by the inconsistency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@koba04 @Naoto00 and others