diff --git a/frontend/.eslintrc.json b/frontend/.eslintrc.json new file mode 100644 index 0000000..3610fa6 --- /dev/null +++ b/frontend/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": ["react-app", "react-app/jest", "prettier"], + "rules": { + "semi": "warn", + "no-unused-vars": "warn", + "no-duplicate-imports": "error" + } +} diff --git a/frontend/.prettierignore b/frontend/.prettierignore new file mode 100644 index 0000000..c93896f --- /dev/null +++ b/frontend/.prettierignore @@ -0,0 +1 @@ +/node_module \ No newline at end of file diff --git a/frontend/.prettierrc.json b/frontend/.prettierrc.json new file mode 100644 index 0000000..d32bd45 --- /dev/null +++ b/frontend/.prettierrc.json @@ -0,0 +1,6 @@ +{ + "singleQuote": true, + "trailingComma": "es5", + "tabWidth": 2, + "semi": false +} diff --git a/frontend/package.json b/frontend/package.json index 6f5c467..2927f99 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -30,7 +30,7 @@ "web-vitals": "^2.1.3" }, "scripts": { - "start": "cross-env REACT_APP_API=http://localhost:8080 react-scripts start", + "start": "npx prettier --write . && cross-env REACT_APP_API=http://localhost:8080 react-scripts start", "build:local": "cross-env REACT_APP_API=http://localhost:8080 react-scripts build", "build": "cross-env REACT_APP_API=https://gtgmn58dh9.execute-api.us-east-1.amazonaws.com/production react-scripts build", "test": "react-scripts test", @@ -38,12 +38,6 @@ "lint": "eslint \"*/**/*.{js,ts,tsx}\" --max-warnings=0", "lint-fix": "yarn lint --fix" }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, "browserslist": { "production": [ ">0.2%", @@ -61,6 +55,8 @@ "@types/react-router-dom": "^5.1.5", "@types/styled-components": "^5.1.1", "@uiw/react-textarea-code-editor": "v1.4.4", - "dotenv": "^11.0.0" + "dotenv": "^11.0.0", + "eslint-config-prettier": "^8.6.0", + "prettier": "2.8.4" } }