Skip to content

Commit

Permalink
Add eslint-plugin-react-compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 22, 2024
1 parent a140400 commit 4e14daa
Show file tree
Hide file tree
Showing 35 changed files with 667 additions and 235 deletions.
6 changes: 5 additions & 1 deletion backend/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ module.exports = {
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'vite.config.d.ts', 'vite.config.js'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
plugins: [
'react-refresh',
'react-compiler'
],
rules: {
'semi': [
'error',
Expand Down Expand Up @@ -68,5 +71,6 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'import/no-extraneous-dependencies': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'react-compiler/react-compiler': 'error',
},
}
195 changes: 195 additions & 0 deletions backend/package-lock.json

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

2 changes: 2 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.25.9",
"babel-plugin-react-compiler": "^19.0.0-beta-201e55d-20241215",
"eslint-config-airbnb": "^19.0.4",
"eslint-plugin-react-compiler": "^19.0.0-beta-201e55d-20241215",
"npm-check-updates": "^17.1.12",
"stylelint": "^16.12.0",
"stylelint-config-standard": "^36.0.1",
Expand Down
3 changes: 1 addition & 2 deletions backend/src/components/Accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ const Accordion = ({
const panel = accordionRef.current.nextElementSibling as HTMLDivElement
panel.style.maxHeight = `${panel.scrollHeight + offsetHeight}px`
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [offsetHeight])
}, [offsetHeight]) // eslint-disable-line react-hooks/exhaustive-deps

return (
<div className={`${className ? `${className} ` : ''}accordion-container`}>
Expand Down
39 changes: 4 additions & 35 deletions backend/src/components/CarList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,23 +224,8 @@ const CarList = ({
}
setInit(false)
}
} // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
page,
carSuppliers,
carKeyword,
_carSpecs,
_carType,
carGearbox,
carMileage,
_fuelPolicy,
carDeposit,
carAvailability,
range,
multimedia,
rating,
seats,
])
}
}, [page, carSuppliers, carKeyword, _carSpecs, _carType, carGearbox, carMileage, _fuelPolicy, carDeposit, carAvailability, range, multimedia, rating, seats]) // eslint-disable-line react-hooks/exhaustive-deps

useEffect(() => {
if (cars) {
Expand Down Expand Up @@ -291,23 +276,8 @@ const CarList = ({
rating,
seats,
)
} // eslint-disable-next-line react-hooks/exhaustive-deps
}, [
reload,
carSuppliers,
carKeyword,
_carSpecs,
_carType,
carGearbox,
carMileage,
_fuelPolicy,
carDeposit,
carAvailability,
range,
multimedia,
rating,
seats,
])
}
}, [reload, carSuppliers, carKeyword, _carSpecs, _carType, carGearbox, carMileage, _fuelPolicy, carDeposit, carAvailability, range, multimedia, rating, seats,]) // eslint-disable-line react-hooks/exhaustive-deps

useEffect(() => {
setUser(carUser)
Expand Down Expand Up @@ -427,7 +397,6 @@ const CarList = ({
</CardContent>
</Card>
)
// : rows.map((car, index) => {
: rows.map((car) => {
const edit = admin || car.supplier._id === user._id
return (
Expand Down
Loading

0 comments on commit 4e14daa

Please sign in to comment.