eslint-config
eslint-config copied to clipboard
An error occurred when using single quote.
"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 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" 🙏
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.
@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?