From 81fbcc9281f652962aa46d8e54d64ee92cbde935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Kucharczyk?= Date: Wed, 25 Jan 2023 13:31:05 +0100 Subject: [PATCH] Add eslint and prettier --- frontend/.eslintrc.cjs | 17 +++++++++++++++++ frontend/.prettierrc | 9 +++++++++ frontend/package.json | 4 ++++ frontend/src/components/Nav.jsx | 7 +++++-- 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 frontend/.eslintrc.cjs create mode 100644 frontend/.prettierrc diff --git a/frontend/.eslintrc.cjs b/frontend/.eslintrc.cjs new file mode 100644 index 0000000..f1eb049 --- /dev/null +++ b/frontend/.eslintrc.cjs @@ -0,0 +1,17 @@ +module.exports = { + env: { + browser: true, + es2021: true + }, + extends: ["eslint/recommended", "plugin:react/recommended", "plugin:prettier/recommended"], + overrides: [], + parserOptions: { + ecmaVersion: "latest", + sourceType: "module" + }, + plugins: ["react"], + rules: {}, + parserOptions: { + ecmaFeatures: { jsx: true } + } +}; diff --git a/frontend/.prettierrc b/frontend/.prettierrc new file mode 100644 index 0000000..b518bea --- /dev/null +++ b/frontend/.prettierrc @@ -0,0 +1,9 @@ +{ + "semi": true, + "tabWidth": 2, + "printWidth": 100, + "singleQuote": true, + "trailingComma": "none", + "bracketSameLine": false, + "singleAttributePerLine": true +} \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index a99d4b3..2199022 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,6 +23,10 @@ "@types/react-dom": "^18.0.9", "@vitejs/plugin-react": "^3.0.0", "eslint": "^8.32.0", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.32.1", + "eslint-plugin-react-hooks": "^4.6.0", "vite": "^4.0.0" } } diff --git a/frontend/src/components/Nav.jsx b/frontend/src/components/Nav.jsx index 90fc858..b85921c 100644 --- a/frontend/src/components/Nav.jsx +++ b/frontend/src/components/Nav.jsx @@ -2,7 +2,10 @@ function Nav() { return (