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

chore: improve interop between prettier and eslint #29

Merged
merged 9 commits into from
Dec 19, 2024

Conversation

delatrie
Copy link
Collaborator

  • Set quoteProps to "consistent" to match ESLint's quote-props rule.
  • Set avoidEscape to true for ESLint's @stylistic/quotes rule to match Prettier's formatting behavior when dealing with strings with double quote characters inside (e.g., '"foo"="bar"').

Other changes:

  • Set ignoreRestSiblings to true for ESLint's @typescript-eslint/no-unused-vars rule to prevent false positives in situations like this:
    const { foo, ...rest } = obj; // foo is unused
    We used to put the eslint-disable comments in such cases earlier because removing foo would affect the behavior.
  • Some unneeded eslint-disable comments were removed or loosened.
  • Swap the eslint-config-preact and ../../.eslintrc.cjs extend entries in the ESLint config of web-awesome to prioritize the project settings over the ones in the preact preset. Otherwise, the plain no-unused-vars rule would be used instead of the TypeScript version. Some other rules like @stylistic/quotes would also be misconfigured with regard to the project scope.

@baev baev merged commit 8b41665 into main Dec 19, 2024
4 checks passed
@baev baev deleted the prettier-eslint-interop branch December 19, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants