Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: React 19 compiler lint plugin #7236

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
import stylistic from "@stylistic/eslint-plugin-ts";
import reactCompiler from "eslint-plugin-react-compiler";
console.log('reactCompiler', reactCompiler);

import rulesDirPlugin from "eslint-plugin-rulesdir";
rulesDirPlugin.RULES_DIR = './bin';
Expand Down Expand Up @@ -63,6 +65,7 @@ export default [{
jest,
monorepo,
"rsp-rules": rspRules,
"react-compiler": reactCompiler
},

languageOptions: {
Expand Down Expand Up @@ -182,6 +185,7 @@ export default [{
"no-multiple-empty-lines": ERROR,
"no-unneeded-ternary": ERROR,
"no-duplicate-imports": ERROR,
"react-compiler/react-compiler": "error",
"react/display-name": OFF,
"react/jsx-curly-spacing": [ERROR, "never"],
"react/jsx-indent-props": [ERROR, ERROR],
Expand Down Expand Up @@ -223,7 +227,6 @@ export default [{
"rsp-rules/sort-imports": [ERROR],
"rulesdir/imports": [ERROR],
"rulesdir/useLayoutEffectRule": [ERROR],
"rulesdir/pure-render": [ERROR],
"jsx-a11y/accessible-emoji": ERROR,
"jsx-a11y/alt-text": ERROR,
"jsx-a11y/anchor-has-content": ERROR,
Expand Down Expand Up @@ -329,6 +332,7 @@ export default [{
monorepo,
jsdoc,
"@stylistic": stylistic,
"react-compiler": reactCompiler
},

languageOptions: {
Expand Down
8 changes: 1 addition & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
"eslint-plugin-jsdoc": "^50.4.1",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-compiler": "beta",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-rulesdir": "^0.2.2",
"fast-check": "^2.19.0",
Expand Down Expand Up @@ -214,13 +215,6 @@
"yargs": "^17.2.1"
},
"resolutions": {
"@babel/cli": "7.24.1",
"@babel/core": "7.24.3",
"@babel/parser": "7.24.4",
"@babel/runtime": "7.24.4",
"@babel/preset-env": "7.24.4",
"@babel/traverse": "7.24.1",
"@babel/types": "7.24.0",
"postcss": "8.4.24",
"postcss-custom-properties": "13.2.0",
"postcss-import": "15.1.0",
Expand Down
1 change: 0 additions & 1 deletion packages/react-aria-components/src/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@ function useAnimation(ref: RefObject<HTMLElement | null>, isActive: boolean, onE
// This is ok because we only read it in the layout effect below, immediately after the commit phase.
// We could move this to another effect that runs every render, but this would be unnecessarily slow.
// We only need the computed style right before the animation becomes active.
// eslint-disable-next-line rulesdir/pure-render
prevAnimation.current = window.getComputedStyle(ref.current).animation;
}

Expand Down
Loading