Add linting, formatting and precommit

This commit is contained in:
E 2024-04-29 13:01:33 +01:00
parent 4129e034b3
commit 224929828a
No known key found for this signature in database
GPG Key ID: 9D57A2D583601371
7 changed files with 1200 additions and 18 deletions

15
.editorconfig Normal file
View File

@ -0,0 +1,15 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false
[pug.ts]
indent_size = 4

3
.eslintrc.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": ["prettier"]
}

1
.husky/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_

4
.husky/pre-commit Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged

8
.prettierrc.json Normal file
View File

@ -0,0 +1,8 @@
{
"trailingComma": "es5",
"semi": true,
"tabWidth": 2,
"singleQuote": true,
"jsxSingleQuote": true,
"plugins": ["prettier-plugin-tailwindcss"]
}

1173
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,13 @@
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npx nodemon ./bin/www -e js,pug,sass",
"dev": "npx nodemon ./bin/www -e js,pug,sass",
"start": "npx ./bin/www -e js,pug,sass",
"watch-tailwind": "npx npm-watch",
"build-tailwind": "npx postcss src/tailwind.css -o public/stylesheets/style.css"
"build-tailwind": "npx postcss src/tailwind.css -o public/stylesheets/style.css",
"lint": "prettier --check . && eslint .",
"format": "prettier --write --ignore-path .gitignore .",
"prepare": "husky install"
},
"dependencies": {
"@sendgrid/mail": "^8.1.3",
@ -39,7 +43,13 @@
"devDependencies": {
"eslint": "^9.1.1",
"eslint-config-prettier": "^9.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14"
},
"lint-staged": {
"*.js": "eslint --cache --fix",
"*.{js,css,md,pug}": "prettier --write"
}
}