Skip to content

Commit

Permalink
Added prettier and eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Youllou committed May 16, 2024
1 parent 7b4fd6c commit 1dcd28d
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 33 deletions.
24 changes: 14 additions & 10 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
plugins: ["react-refresh", "@typescript-eslint", "prettier"],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
"react/prop-types": "off",
"react/react-in-jsx-scope": "off",
"prettier/prettier": [
"error",
{
endOfLine: "auto",
},
],
},
}
};
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

# FertiScan

## Overview Description

---

The FertiScan project, initiated by the AI-Lab, aims to streamline the process
of capturing and organizing information on fertilizer labels. By leveraging AI
technology, the mobile application will allow users to scan fertilizer labels,
Expand All @@ -24,6 +24,7 @@ bringing an advanced technological solution to the agricultural sector.
## Key Features

---

**Gemini Vertex API:** An application programming interface designed to
simulate human conversation, capable of answering questions and processing
a large number of images.
Expand All @@ -37,6 +38,7 @@ by inspectors.
## Potential Advantages

---

**Increased Efficiency:** By automating fertilizer bag inspection, the project
aims to increase the efficiency and accuracy of the inspection process.
**Advanced Analysis:** Through the integration of the Gemini Vertex API, the
Expand Down
8 changes: 4 additions & 4 deletions README.old.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ If you are developing a production application, we recommend updating the config
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
},
}
};
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Run:

```cmd
npm run test
```
```
112 changes: 112 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion 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",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint .",
"lint:fix": "eslint --fix .",
"preview": "vite preview"
},
"dependencies": {
Expand All @@ -20,8 +21,11 @@
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react-swc": "^3.5.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"prettier": "^3.2.5",
"typescript": "^5.2.2",
"vite": "^5.2.0"
}
Expand Down
14 changes: 7 additions & 7 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useState } from 'react'
import reactLogo from './assets/react.svg'
import viteLogo from '/vite.svg'
import './App.css'
import { useState } from "react";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import "./App.css";

function App() {
const [count, setCount] = useState(0)
const [count, setCount] = useState(0);

return (
<>
Expand All @@ -29,7 +29,7 @@ function App() {
Click on the Vite and React logos to learn more
</p>
</>
)
);
}

export default App
export default App;
12 changes: 6 additions & 6 deletions src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import React from "react";
import ReactDOM from "react-dom/client";
import App from "./App.tsx";
import "./index.css";

ReactDOM.createRoot(document.getElementById('root')!).render(
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)
);
6 changes: 3 additions & 3 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})
});

0 comments on commit 1dcd28d

Please sign in to comment.