From 33ad0430d32c4604b51812a3ec79ed2a0855873d Mon Sep 17 00:00:00 2001 From: cristhianzl Date: Thu, 2 May 2024 18:51:27 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20(.pre-commit-config.yaml):=20add?= =?UTF-8?q?=20eslint-plugin-react@latest=20as=20a=20dependency=20to=20impr?= =?UTF-8?q?ove=20linting=20for=20React=20components=20=F0=9F=94=A7=20(.esl?= =?UTF-8?q?intrc.json):=20update=20eslint=20configuration=20to=20include?= =?UTF-8?q?=20additional=20plugins,=20parser,=20parserOptions,=20and=20env?= =?UTF-8?q?=20settings=20to=20improve=20linting=20for=20React=20components?= =?UTF-8?q?=20and=20TypeScript=20files=20=E2=99=BB=EF=B8=8F=20(index.tsx):?= =?UTF-8?q?=20remove=20unnecessary=20empty=20line=20to=20improve=20code=20?= =?UTF-8?q?readability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 1 + src/frontend/.eslintrc.json | 13 ++++++++----- .../pages/MainPage/components/components/index.tsx | 1 - 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9bfb498e3..87e379282 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,6 +9,7 @@ repos: - eslint-plugin-prettier - eslint-config-prettier - prettier + - eslint-plugin-react@latest - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. rev: v0.4.2 diff --git a/src/frontend/.eslintrc.json b/src/frontend/.eslintrc.json index 50a471e83..1b09f8c18 100644 --- a/src/frontend/.eslintrc.json +++ b/src/frontend/.eslintrc.json @@ -2,15 +2,18 @@ "extends": [ "eslint:recommended", "plugin:react/recommended", - "plugin:prettier/recommended", - "standard" + "plugin:prettier/recommended" ], - "plugins": ["react"], + "plugins": ["react", "import-helpers", "prettier"], + "parser": "@typescript-eslint/parser", "parserOptions": { - "ecmaVersion": 2018 + "project": ["./tsconfig.node.json", "./tsconfig.json"], + "extraFileExtensions:": [".mdx"], + "extensions:": [".mdx"] }, "env": { - "browser": true + "browser": true, + "es2021": true }, "settings": { "react": { diff --git a/src/frontend/src/pages/MainPage/components/components/index.tsx b/src/frontend/src/pages/MainPage/components/components/index.tsx index 4f184377e..566872457 100644 --- a/src/frontend/src/pages/MainPage/components/components/index.tsx +++ b/src/frontend/src/pages/MainPage/components/components/index.tsx @@ -90,7 +90,6 @@ export default function ComponentsComponent({ setPageIndex(1); setPageSize(20); } - return (