Skip to content

Commit

Permalink
add react plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
SKairinos committed Aug 16, 2024
1 parent 6af5dfa commit 2c95aa0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
14 changes: 12 additions & 2 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
import js from "@eslint/js"
import globals from "globals"
import react from "eslint-plugin-react"
import reactHooks from "eslint-plugin-react-hooks"
import reactRefresh from "eslint-plugin-react-refresh"
import prettier from "eslint-plugin-prettier"
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"
import tseslint from "typescript-eslint"

// https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts
export default tseslint.config(
{ ignores: ["dist"] },
{
settings: { react: { version: "18.3" } },
extends: [
js.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginPrettierRecommended,
],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
prettier: prettier,
react,
prettier,
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
},
rules: {
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
"sort-imports": ["error", { allowSeparatedGroups: true }],
"@typescript-eslint/no-empty-object-type": "off",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-react-refresh": "^0.4.9",
"globals": "^15.9.0",
Expand Down
2 changes: 1 addition & 1 deletion src/pages/fruitDetail/FruitDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const FruitDetail: FC<FruitDetailProps> = () => {
</pages.Page>
)),
onValidationSuccess: params => {
retrieveFruit(params.id, true)
void retrieveFruit(params.id, true)
},
onValidationError: navigate => {
navigate(paths.fruits._, {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/fruitList/FruitList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const FruitList: FC<FruitListProps> = () => {
</LinkIconButton>
<IconButton
onClick={() => {
destroyFruit(fruit.id)
void destroyFruit(fruit.id)
}}
>
<DeleteIcon />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Home: FC<HomeProps> = () => {
<Typography variant="h1">Example web page</Typography>
<Typography>
This is an example of how you can create a web page. This example
consumes the backend-template's API.
consumes the backend-template&apos;s API.
</Typography>
<Link to={paths.fruits._}>Fruit list</Link>
</pages.Section>
Expand Down

0 comments on commit 2c95aa0

Please sign in to comment.