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

Add prettier and eslint #14

Merged
merged 5 commits into from
Jan 17, 2022
Merged

Conversation

MichaelBuessemeyer
Copy link
Contributor

This PR adds prettier as a formatter and eslint as a linter.

We use eslint as a linter and not prettier as eslint is more capable & has more features as far as I know.

Happy to hear / read your suggestions :)

Copy link
Owner

@cmfcmf cmfcmf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MichaelBuessemeyer,

thanks a lot for this PR! One thing that I would like to discuss is the addition of eslint. I think it is slightly overkill for this project and I am slightly in favor of not adding it (but you can definitely convince me otherwise).

Also, I would prefer if you added just two new scripts to package.json: format and lint, that run prettier (and possibly eslint), where format is a combination of the current pretty and lint-fix scripts and lint is a combination of am-i-pretty and lint.

run.js Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
getElements.js Show resolved Hide resolved
combine yarn commands; remove unused dependecies; adjust eslint rules
@MichaelBuessemeyer
Copy link
Contributor Author

thanks a lot for this PR!

Your welcome :)

One thing that I would like to discuss is the addition of eslint. I think it is slightly overkill for this project and I am slightly in favor of not adding it (but you can definitely convince me otherwise).

I understand that you think that eslint is overkill. But it has the advantage that it lints the code 😅 . This prevent some errors that might not be obvious at first sight. I only found the error in element.js (see above) thanks to eslint. Therefore using eslint can prevent these errors.

I am fine if you do not want it as a dependency. But i'll use it in #13 anyway to prevent myself from writing error that the linter can catch easily.

Also, I would prefer if you added just two new scripts to package.json: format and lint, that run prettier (and possibly eslint), where format is a combination of the current pretty and lint-fix scripts and lint is a combination of am-i-pretty and lint.

Alrighty 🐈

@cmfcmf
Copy link
Owner

cmfcmf commented Jan 17, 2022

Alright, thank you! I re-added eslint-config-prettier to avoid any potential conflicts between Prettier and ESLint, and added yarn lint to the GitHub action.

@cmfcmf cmfcmf merged commit b42c84b into cmfcmf:main Jan 17, 2022
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.

2 participants