Skip to content

Commit

Permalink
Add Linting / formatting rules for code uniformity. komodorio#41
Browse files Browse the repository at this point in the history
  • Loading branch information
shantanujumde committed Mar 5, 2023
1 parent 7f07d47 commit 5767271
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
8 changes: 8 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": ["react-app", "react-app/jest", "prettier"],
"rules": {
"semi": "warn",
"no-unused-vars": "warn",
"no-duplicate-imports": "error"
}
}
1 change: 1 addition & 0 deletions frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/node_module
6 changes: 6 additions & 0 deletions frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"singleQuote": true,
"trailingComma": "es5",
"tabWidth": 2,
"semi": false
}
12 changes: 4 additions & 8 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,14 @@
"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",
"eject": "react-scripts eject",
"lint": "eslint \"*/**/*.{js,ts,tsx}\" --max-warnings=0",
"lint-fix": "yarn lint --fix"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
Expand All @@ -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"
}
}

0 comments on commit 5767271

Please sign in to comment.