Skip to content

Add ESLint and Prettier as linter and formatter#74

Closed
JakubSchwenkbeck wants to merge 12 commits intomasterfrom
dev/linter-formatter
Closed

Add ESLint and Prettier as linter and formatter#74
JakubSchwenkbeck wants to merge 12 commits intomasterfrom
dev/linter-formatter

Conversation

@JakubSchwenkbeck
Copy link
Copy Markdown
Contributor

@JakubSchwenkbeck JakubSchwenkbeck commented May 14, 2025

This PR introduces

  • ESLint as a linter (npx eslint . or npm run lint and npm run lint:fix to lint or lint&fix all files at once)
  • Prettier as a formatter (npm run format and npm run format:check)

The CI performs npm run lint and npm run format:check
resolves #73

@JakubSchwenkbeck JakubSchwenkbeck requested review from jiribenes and timsueberkrueb and removed request for jiribenes May 14, 2025 13:14
Comment thread .prettierrc
@@ -0,0 +1,6 @@
{
"semi": true,
"trailingComma": "none",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm personally in favor of trailing commas as they reduce diffs.

Comment thread eslint.config.mjs
@@ -0,0 +1,48 @@
/**
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Tabs -> Spaces

@jiribenes
Copy link
Copy Markdown
Contributor

Once you agree on the formatting changes, please squash the formatting changes (and those only) into a single commit and then use https://docs.github.com/en/repositories/working-with-files/using-files/viewing-and-understanding-files#ignore-commits-in-the-blame-view to ignore that reformatting commit in blame.

Comment thread eslint.config.mjs
},
rules: {
'prettier/prettier': 'error', // Treat Prettier issues as ESLint errors
'curly': 'warn',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know what all of these are for, are these some defaults or did you deliberately change them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@JakubSchwenkbeck
Copy link
Copy Markdown
Contributor Author

I guess just start going from a clean branch seems the easiest:)

@JakubSchwenkbeck
Copy link
Copy Markdown
Contributor Author

closed via #75

@JakubSchwenkbeck JakubSchwenkbeck deleted the dev/linter-formatter branch July 9, 2025 11:40
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.

Add a typescript formatter and linter

3 participants