Skip to content

Commit f04bb15

Browse files
authored
Merge pull request #1823 from bkmorgan3/formatting]
Formatting Setup
2 parents e0105e8 + 332b90a commit f04bb15

File tree

8 files changed

+1529
-4
lines changed

8 files changed

+1529
-4
lines changed

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx lint-staged

.lintstagedrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"*.{js,jsx,ts,tsx,json,css,scss,md}": ["prettier --write", "eslint --fix"]
3+
}

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

eslint.config.mjs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import prettier from "eslint-config-prettier";
4+
import reactPlugin from "eslint-plugin-react";
5+
6+
/** @type {import('eslint').Linter.Config[]} */
7+
export default [
8+
js.configs.recommended,
9+
{
10+
...reactPlugin.configs.flat.recommended,
11+
settings: {
12+
react: {
13+
version: "detect",
14+
},
15+
},
16+
},
17+
reactPlugin.configs.flat["jsx-runtime"],
18+
{
19+
files: ["**/*.js", "**/*.jsx"],
20+
languageOptions: {
21+
globals: { ...globals.browser, ...globals.node },
22+
parserOptions: {
23+
ecmaFeatures: {
24+
jsx: true,
25+
},
26+
},
27+
},
28+
rules: {
29+
"react/no-unescaped-entities": "off",
30+
"react/prop-types": "off",
31+
},
32+
},
33+
prettier,
34+
];

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"scripts": {
66
"start": "concurrently \"cd backend && npm run start\" \"cd client && npm run start\"",
77
"mvp": "concurrently \"cd backend && npm run start\" \"cd client-mvp-04 && npm run start\"",
8+
"format": "prettier --write \"client/**/*.{js,jsx,css}\" \"backend/**/*.{js,jsx,css}\"",
9+
"lint": "eslint",
810
"dev:api": "cd backend && npm run dev",
911
"dev:client": "cd client && npm run start",
1012
"dev": "dotenv -e backend/.env -e client/.env concurrently \"npm run dev:api\" \"npm run dev:client\"",
@@ -26,6 +28,12 @@
2628
},
2729
"devDependencies": {
2830
"cypress": "^5.0.0",
31+
"eslint": "9.9.1",
32+
"eslint-config-prettier": "9.1.0",
33+
"eslint-plugin-react": "^7.37.3",
34+
"globals": "15.9.0",
35+
"husky": "^9.1.7",
36+
"prettier": "3.4.2",
2937
"start-server-and-test": "^1.11.3"
3038
}
3139
}

0 commit comments

Comments
 (0)