-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: disable prettier conflicts, change lint-staged to just lint-all #119
Conversation
Signed-off-by: Regina Wang <rrreggginnna@gmail.com>
✔️ Deploy Preview for teach-la-ts-react-starter ready! 🔨 Explore the source changes: e11e7a3 🔍 Inspect the deploy log: https://app.netlify.com/sites/teach-la-ts-react-starter/deploys/61f0782b7b655500071921a0 😎 Browse the preview: https://deploy-preview-119--teach-la-ts-react-starter.netlify.app |
Signed-off-by: Regina Wang <rrreggginnna@gmail.com>
Signed-off-by: Regina Wang <rrreggginnna@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oki i read through this all, seems like half the changes are just changes made by prettier itself, and the other half is code that implements prettier + its settings and then gets rid of stuff that prettier takes care of. i think it looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the idea of changing lint-staged
to just fix all the linting progress overall as it would streamline the development process of fixing small errors on its own! However, I think in its current state, some es-lint and prettier rules are clashing, and could be solved with the es-lint prettier plugin as specified here and as specified in the review comment.
.eslintrc.js
Outdated
// ensures clean diffs, see https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8 | ||
'comma-dangle': ['error', 'always-multiline'], | ||
// Covered by prettier | ||
'comma-dangle': 'off', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically adding in the 'comma-dangle': off
clashes with prettier when linting and does not enforce that dangling commas should be there.
When using eslint with prettier, I think it would be better to add in the prettier plugin to our .eslintrc.js
as specified here, and adding it at the end of our array of plugins.
And for things that are already covered by prettier like comma-dangle, instead of specifying off, we can just not mention the comma-dangle
property at all, as comma-dangle off doesn't enforce dangling commas when linting within our pre-commit hook or yarn lint-fix
command, but commenting it out does enforce it (when used in conjunction with the prettier es-lint plugin).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kk sounds good, ty for the review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a +1 to Matt’s comment. Some of the linting decisions were made w/ the editor’s situation In mind so it makes sense that some should be changed
Signed-off-by: Regina Wang <rrreggginnna@gmail.com>
Signed-off-by: Regina Wang <rrreggginnna@gmail.com>
Signed-off-by: Regina Wang <rrreggginnna@gmail.com>
nice, looks like they don't conflict anymore! |
Summary
prettier
rules fromeslint
andstylelint
since there areprettier
andeslint
/stylelint
conflictslint-staged
and replace with simplelint-fix
on all filesyarn lint
closes #113
closes #114
Test Plan
yarn lint-fix