Skip to content

Commit

Permalink
Feature/dot 293 fix eslint (#262)
Browse files Browse the repository at this point in the history
* Added linting

* Added browser environment to eslint

* Fixed linting problems

* Fixed typescript issues
  • Loading branch information
jotjern authored Oct 25, 2023
1 parent 0ac161c commit 685184b
Show file tree
Hide file tree
Showing 60 changed files with 1,944 additions and 999 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,8 @@ repos:
types: [python]
pass_filenames: false
language: system
- id: lint-staged
name: lint-staged
entry: bash -c "cd frontend && pnpm run lint-staged"
language: system
always_run: true
20 changes: 20 additions & 0 deletions frontend/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
env: {
browser: true,
},
extends: [
"prettier",
"eslint:recommended",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
},
ignorePatterns: ["**/dist/**/*", "**/node_modules/**/*"],
}
4 changes: 4 additions & 0 deletions frontend/.lintstagedrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
"*.tsx": "eslint --fix",
"*.ts": "eslint --fix",
}
8 changes: 8 additions & 0 deletions frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": false,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 120,
"endOfLine": "auto",
"arrowParens": "always"
}
12 changes: 9 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
"preview": "vite preview",
"lint-staged": "lint-staged"
},
"dependencies": {
"@headlessui/react": "^1.7.10",
Expand All @@ -18,9 +19,8 @@
"D": "^1.0.0",
"axios": "^1.3.0",
"dayjs": "^1.11.7",
"eslint-plugin-prettier": "^5.0.1",
"oidc-client-ts": "^2.2.1",
"prettier": "^2.8.4",
"prettier-plugin-tailwindcss": "^0.2.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-feather": "^2.0.10",
Expand All @@ -33,9 +33,15 @@
"@tailwindcss/forms": "^0.5.3",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@vitejs/plugin-react-swc": "^3.0.0",
"autoprefixer": "^10.4.13",
"eslint": "^8.51.0",
"eslint-config-prettier": "^9.0.0",
"lint-staged": "^15.0.2",
"postcss": "^8.4.31",
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.6",
"tailwindcss": "^3.2.4",
"typescript": "^4.9.3",
"vite": "^4.0.5"
Expand Down
Loading

0 comments on commit 685184b

Please sign in to comment.