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: format and lint with ESLint and Prettier #172

Merged
merged 19 commits into from
Dec 5, 2024
Merged

Conversation

erickzhao
Copy link
Member

@erickzhao erickzhao commented Nov 29, 2024

Stacks on top of #171 because that PR addresses some of the lint problems we have on main.

We previously added a Prettier configuration in 107661d but never configured it to run via NPM script nor in CI.

This PR addresses that and replaces the standard and standard-markdown packages with eslint and typescript-eslint. It also bumps up typescript to the latest stable version.

Update:

  • Added pre-commit hooks
  • Dropped Node 16 in CI because ESLint @ 9 requires Node 18 and we can be a bit looser in this repo I think?

@erickzhao erickzhao requested a review from a team as a code owner November 29, 2024 21:30
Base automatically changed from refactor/remove-test-logic-from-lib to main November 30, 2024 12:53
@@ -0,0 +1 @@
* text=auto eol=lf
Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

@dsanders11 dsanders11 left a comment

Choose a reason for hiding this comment

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

I'd prefer to limit prettier to the JS/TS files for now, to remain consistent with other repos. See the comment about semicolons in README.md, and generally I think it's nice to avoid unnecessary drift between boilerplate config and CI that we use across the ecosystem - makes it easier to find actual drift in the future.

README.md Outdated
Comment on lines 39 to 41
const { updateElectronApp } = require('update-electron-app')
updateElectronApp()
const { updateElectronApp } = require('update-electron-app');
updateElectronApp();
Copy link
Member

Choose a reason for hiding this comment

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

We don't include semicolons in examples in end user code, I'd prefer we didn't add these so that we remain consistent across our repos.

Copy link
Member Author

Choose a reason for hiding this comment

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

872445f

I think this used to be linted by standard-markdown. I've added prettier-ignore statements in accordance, but this is unlinted now. I can add the other dependency back in if needed.

Copy link
Member

Choose a reason for hiding this comment

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

If we want Markdown linting in the future, for consistency we should use @electron/lint-roller.

@erickzhao erickzhao requested a review from dsanders11 December 4, 2024 21:08
@erickzhao erickzhao merged commit 7d21dde into main Dec 5, 2024
12 checks passed
@erickzhao erickzhao deleted the format-and-lint-2 branch December 5, 2024 00:57
Copy link

🎉 This PR is included in version 3.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants