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: add prettier #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": [
"eslint:recommended",
"next/core-web-vitals",
"next/typescript"
"next/typescript",
"prettier"
]
}
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
57 changes: 57 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const path = require('path')

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

module.exports = {
// All js, jsx, ts, tsx files
'*.{js,jsx,ts,tsx}': [
buildEslintCommand,
"prettier --write",
],
// All files excluding js, jsx, ts, tsx
'*.!(js|jsx|ts|tsx)': [
"prettier --write --ignore-unknown",
],

}
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore artifacts:
.next
.cache
package-lock.json
public
node_modules
next-env.d.ts
next.config.ts
yarn.lock
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"local": "next build && next start"
"lint:fix": "next lint --fix",
"format": "prettier --check .",
"format:fix": "prettier --write .",
"local": "next build && next start",
"prepare": "husky"
},
"dependencies": {
"@heroicons/react": "^2.1.5",
Expand All @@ -28,7 +32,11 @@
"autoprefixer": "^10.4.20",
"eslint": "^9.14.0",
"eslint-config-next": "15.0.2",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"postcss": "^8",
"prettier": "3.3.3",
"tailwindcss": "^3.4.14",
"typescript": "^5"
},
Expand Down
Loading