diff --git a/.eslintrc.js b/.eslintrc.js index 8ba8636d8c8a6582f49c51f598ae62894fdad521..f899dd418de6f58d241b17dcc55db8e890b43c88 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,6 +17,7 @@ module.exports = { rules: { // Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs '@typescript-eslint/explicit-function-return-type': 'off', + 'react/react-in-jsx-scope': 'off', 'react/prop-types': 'warn', }, settings: { diff --git a/src/components/Consents/Consents.tsx b/src/components/Consents/Consents.tsx index 5f7f81d51e04b9ba214af5715ba405d9d64336e5..9d459daa8b93f02de713462233ae26febb21a692 100644 --- a/src/components/Consents/Consents.tsx +++ b/src/components/Consents/Consents.tsx @@ -245,7 +245,9 @@ const Consents: React.FC = () => { } } getConsentsData() - }, [user, consentService, rowsPerPage, page, checkSelectedNodes]) + // /!\ Do not add checkSelected in dependencies or effect will trigger on each selection + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [user, consentService, rowsPerPage, page]) return ( <> diff --git a/src/components/DateSelector/DateSelector.tsx b/src/components/DateSelector/DateSelector.tsx index 8a3e4bc728fcf92231cd8c0570ba4bbe52db4b31..0b501077fc401d01037d32c650ea37309fd3c3da 100644 --- a/src/components/DateSelector/DateSelector.tsx +++ b/src/components/DateSelector/DateSelector.tsx @@ -63,8 +63,9 @@ const DateSelector: React.FC<DateSelectorProps> = ({ <Modal> <> <div className="modal-text"> - Attention, vous n'avez pas enregistré vos modifications. Celles-ci - seront annulées en changeant de mois. Voulez-vous continuer ? + Attention, vous n'avez pas enregistré vos modifications. + Celles-ci seront annulées en changeant de mois. Voulez-vous + continuer ? </div> <div className="buttons"> <button className="btnCancel" onClick={() => setopenModal(false)}> diff --git a/src/components/ImagePicker/ImagePicker.tsx b/src/components/ImagePicker/ImagePicker.tsx index df90034f1f06e5509851612036e74ef0d6b7968d..c3625b96c00879676eece3126c4054fe91e9310f 100644 --- a/src/components/ImagePicker/ImagePicker.tsx +++ b/src/components/ImagePicker/ImagePicker.tsx @@ -33,7 +33,7 @@ const ImagePicker: React.FC<ImagePickerProps> = ({ const [currentPage, setCurrentPage] = useState(1) const [pageCount, setpageCount] = useState<number>(1) const [preSelectImage, setPreSelectImage] = useState<string>('') - let imagePerPage = 10 + const imagePerPage = 10 const toggleModal = () => { setOpenModal((prev) => !prev) @@ -76,7 +76,7 @@ const ImagePicker: React.FC<ImagePickerProps> = ({ <> {selectedImageURL === '' || !selectedImageURL ? ( <> - <p>Pas d'image sélectionnée</p> + <p>Pas d'image sélectionnée</p> <button className="btnValid" onClick={toggleModal}> Choisir une image </button> @@ -91,7 +91,7 @@ const ImagePicker: React.FC<ImagePickerProps> = ({ alt="selected" /> <button className="btnDelete" onClick={toggleModal}> - Modifier l'image + Modifier l'image </button> </> )} @@ -103,10 +103,10 @@ const ImagePicker: React.FC<ImagePickerProps> = ({ {imageNames && imageNames !== [] && imageNames[currentPage - 1] !== [] && - imageNames[currentPage - 1].map((imageURL) => ( + imageNames[currentPage - 1].map((imageName) => ( <SingleImage - imageURL={imageURL} - key={imageURL} + imageURL={imageName} + key={imageName} selectedImage={preSelectImage} setSelectedImageURL={setPreSelectImage} /> @@ -116,7 +116,7 @@ const ImagePicker: React.FC<ImagePickerProps> = ({ <Pagination count={pageCount} siblingCount={0} - onChange={(e, page) => handleChangePage(page)} + onChange={(_e, page) => handleChangePage(page)} /> <div className="buttons"> <button diff --git a/src/components/Login/Login.tsx b/src/components/Login/Login.tsx index 9bb9f893bc8c04f465826acbb32134e227590351..1f20b820b0daabb90e23d18cdd77f0a46a5bfbf6 100644 --- a/src/components/Login/Login.tsx +++ b/src/components/Login/Login.tsx @@ -8,7 +8,7 @@ const Login: React.FC = () => { return ( <div className="login"> <div className="container"> - <h1>Bienvenue sur le Backoffice d'Ecolyo !</h1> + <h1>Bienvenue sur le Backoffice d'Ecolyo !</h1> <button className="btnValid" onClick={loginUser}> Login </button> diff --git a/src/components/Prices/PriceSection.tsx b/src/components/Prices/PriceSection.tsx index 20e70cb972cef633d27f0e3fa8b580ea719a8cbc..51aee446ba0f63f104866e7e90a2bbae3276853d 100644 --- a/src/components/Prices/PriceSection.tsx +++ b/src/components/Prices/PriceSection.tsx @@ -156,7 +156,7 @@ const PriceSection: React.FC<PriceSectionProps> = ({ </button> <div className="history"> <button onClick={toggleHistory} className={showHistory ? 'active' : ''}> - <span>Voir l'historique</span> + <span>Voir l'historique</span> <img src={arrowDown} className={showHistory ? 'icon-active' : ''} diff --git a/src/components/Settings/Settings.tsx b/src/components/Settings/Settings.tsx index 444d3842e42251c5dce59589252026ddcbfeb168..e7aaaa50a843cd9a3149dce1c607254c80183825 100644 --- a/src/components/Settings/Settings.tsx +++ b/src/components/Settings/Settings.tsx @@ -5,7 +5,7 @@ const Settings: React.FC = () => { return ( <> <div className="header"> - <p className="title pagetitle">Paramètres de l'appli</p> + <p className="title pagetitle">Paramètres de l'appli</p> </div> <div className="content"> diff --git a/src/reportWebVitals.ts b/src/reportWebVitals.ts index 49a2a16e0fbc7636ee16bf907257a5282b856493..57a24a21eae1de4e00842390a8e04a76e7c68bad 100644 --- a/src/reportWebVitals.ts +++ b/src/reportWebVitals.ts @@ -1,15 +1,15 @@ -import { ReportHandler } from 'web-vitals'; +import { ReportHandler } from 'web-vitals' const reportWebVitals = (onPerfEntry?: ReportHandler) => { if (onPerfEntry && onPerfEntry instanceof Function) { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); + getCLS(onPerfEntry) + getFID(onPerfEntry) + getFCP(onPerfEntry) + getLCP(onPerfEntry) + getTTFB(onPerfEntry) + }) } -}; +} -export default reportWebVitals; +export default reportWebVitals