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 lint-staged, husky for formatting during commits #324

Merged
merged 5 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged ui/
13 changes: 13 additions & 0 deletions ui/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// lint-staged configuration for next 12
// from https://nextjs.org/docs/basic-features/eslint#lint-staged
skanderm marked this conversation as resolved.
Show resolved Hide resolved
const path = require('path')

const buildEslintCommand = (filenames) =>
`next lint --fix --file ${filenames
.map((f) => path.relative(process.cwd(), f))
.join(' --file ')}`

module.exports = {
'*.{js,jsx,ts,tsx}': [buildEslintCommand], // eslint
'*': 'prettier --ignore-unknown --write', // prettier
skanderm marked this conversation as resolved.
Show resolved Hide resolved
}
Loading
Loading