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

introduce .prettierrc #3034

Merged
merged 2 commits into from
Oct 17, 2023
Merged

introduce .prettierrc #3034

merged 2 commits into from
Oct 17, 2023

Conversation

jaschaurbach
Copy link
Member

This fixes #3032

The produced is in fact correct (see MDN).
I do not know why prettier suddenly enforces this rule, I could not find it out.

To tell prettier to NOT enforce this rule I introduced .prettierrc wit one rule:
'trailingComma': 'none'

By enforcing this rule, prettier changes some long used .js which used trailing commas bringing inconsistency to the code.

Now it is all consistent.

With this pullrequest I introduce .prettierrc with one rule:
'trailingComma': 'none'
@dato
Copy link
Contributor

dato commented Oct 14, 2023

Thanks for investigating this!

The produced code is in fact correct

Indeed, as of some recent JS version, I think?

Since the trailing commas are correct, I believe this could also fixed on the ESLint side, by issuing:

    "parserOptions": {
        "ecmaVersion": 2017,
     },

in .eslintrc.js (or some more recent version).

I do not know why prettier suddenly enforces this rule

This, I could not figure out either. :(
See a comment below about making the diff smaller.

.prettierrc Show resolved Hide resolved
@jaschaurbach jaschaurbach removed the request for review from hughrun October 17, 2023 09:06
@jaschaurbach jaschaurbach reopened this Oct 17, 2023
@jaschaurbach jaschaurbach merged commit b97dafc into main Oct 17, 2023
@jaschaurbach jaschaurbach deleted the prettier-trailing-comma branch October 17, 2023 17:32
@jaschaurbach jaschaurbach restored the prettier-trailing-comma branch October 17, 2023 17:47
@jaschaurbach jaschaurbach deleted the prettier-trailing-comma branch October 17, 2023 17:50
@dato dato mentioned this pull request Oct 17, 2023
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

Successfully merging this pull request may close these issues.

bw-dev prettier produces incorrect js
2 participants