diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js index 68c3eac..ed3ce6e 100644 --- a/frontend/eslint.config.js +++ b/frontend/eslint.config.js @@ -29,14 +29,8 @@ export default defineConfig([ }, parser: tsParser, - ecmaVersion: "latest", - sourceType: "module", parserOptions: { - ecmaVersion: "latest", - sourceType: "module", - ecmaFeatures: { jsx: true }, - project: "./tsconfig.json", - tsconfigRootDir: __dirname, + projectService: true, }, }, diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 2f8cc11..fa9123f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -42,6 +42,7 @@ "@typescript-eslint/parser": "^8.48.0", "@vitejs/plugin-react": "^5.1.1", "autoprefixer": "^10.4.22", + "babel-plugin-react-compiler": "^1.0.0", "cypress": "^13.3.0", "eslint": "^9.39.1", "eslint-config-enpitech": "^1.0.17", @@ -4199,6 +4200,16 @@ "npm": ">=6" } }, + "node_modules/babel-plugin-react-compiler": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz", + "integrity": "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.26.0" + } + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", diff --git a/frontend/package.json b/frontend/package.json index 9f64aea..09fedfa 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -38,6 +38,7 @@ "@typescript-eslint/parser": "^8.48.0", "@vitejs/plugin-react": "^5.1.1", "autoprefixer": "^10.4.22", + "babel-plugin-react-compiler": "^1.0.0", "cypress": "^13.3.0", "eslint": "^9.39.1", "eslint-config-enpitech": "^1.0.17", diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 9448efc..679cc82 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -9,7 +9,7 @@ export default defineConfig(({ mode }) => { const port = env.VITE_SERVER_PORT || 8080; return { plugins: [ - react(), + react({ babel: { plugins: ["babel-plugin-react-compiler"] } }), // React and "babel-plugin-react-compiler" plugins should be first tailwindcss(), flowbiteReact(), viteStaticCopy({ @@ -51,4 +51,4 @@ export default defineConfig(({ mode }) => { }, }, }; -}); \ No newline at end of file +}); diff --git a/frontend/yarn.lock b/frontend/yarn.lock index 33f70c3..809258a 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -179,7 +179,7 @@ "@babel/types" "^7.28.5" debug "^4.3.1" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.28.4", "@babel/types@^7.28.5": +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.26.0", "@babel/types@^7.27.1", "@babel/types@^7.28.2", "@babel/types@^7.28.4", "@babel/types@^7.28.5": version "7.28.5" resolved "https://registry.npmjs.org/@babel/types/-/types-7.28.5.tgz" integrity sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA== @@ -2304,6 +2304,13 @@ babel-plugin-macros@^3.1.0: cosmiconfig "^7.0.0" resolve "^1.19.0" +babel-plugin-react-compiler@^1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz" + integrity sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw== + dependencies: + "@babel/types" "^7.26.0" + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz"