Skip to content
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
17 changes: 17 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import githubPlugin from 'eslint-plugin-github'
import storybook from 'eslint-plugin-storybook'
import react from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import reactCompiler from 'eslint-plugin-react-compiler'
import {unsupportedPatterns as reactCompilerUnsupported} from './packages/react/script/react-compiler.mjs'
import playwright from 'eslint-plugin-playwright'
import prettierRecommended from 'eslint-plugin-prettier/recommended'
import primerReact from 'eslint-plugin-primer-react'
Expand Down Expand Up @@ -62,6 +64,21 @@ const config = defineConfig([
react.configs.flat['jsx-runtime'],
reactHooks.configs.flat['recommended-latest'],

// React Compiler
{
plugins: {'react-compiler': reactCompiler},
rules: {
'react-compiler/react-compiler': 'warn',
},
},
// Disable react-compiler rule for files not yet migrated
{
files: reactCompilerUnsupported.map(p => `packages/react/${p}`),
rules: {
'react-compiler/react-compiler': 'off',
},
},

github.browser,
github.recommended,
github.react,
Expand Down
58 changes: 54 additions & 4 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
"@eslint/compat": "^2.0.1",
"@eslint/eslintrc": "^3.3.3",
"@eslint/js": "^9.39.2",
"@github-ui/storybook-addon-performance-panel": "0.1.2",
"@github/axe-github": "0.7.0",
"@github/markdownlint-github": "^0.8.0",
"@github/mini-throttle": "2.1.1",
"@github/prettier-config": "0.0.6",
"@github-ui/storybook-addon-performance-panel": "0.1.2",
"@mdx-js/react": "1.6.22",
"@playwright/test": "^1.56.1",
"@prettier/sync": "0.5.5",
Expand All @@ -77,6 +77,7 @@
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-primer-react": "^8.5.1",
"eslint-plugin-react": "^7.35.5",
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-ssr-friendly": "1.3.0",
"eslint-plugin-storybook": "^10.2.0",
Expand Down
30 changes: 16 additions & 14 deletions packages/react/script/react-compiler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,22 @@ const files = glob
.map(match => {
return path.join(PACKAGE_DIR, match)
})
const unsupportedPatterns = [
'src/ActionList/**/*.tsx',
Copy link

Copilot AI Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description states "Ran npx eslint on all ActionList source files — zero react-compiler/react-compiler warnings, confirming the source is compiler-compatible." However, ActionList is still included in the unsupportedPatterns array at line 15, which means the react-compiler rule is disabled for ActionList files. If ActionList is truly compiler-compatible with zero warnings, it should be removed from this exclusion list to enable both build-time compilation and lint-time validation for those files.

Copilot uses AI. Check for mistakes.
'src/ActionMenu/**/*.tsx',
'src/AvatarStack/**/*.tsx',
'src/Button/**/*.tsx',
'src/ConfirmationDialog/**/*.tsx',
'src/Pagehead/**/*.tsx',
'src/Pagination/**/*.tsx',
'src/SelectPanel/**/*.tsx',
'src/SideNav.tsx',
'src/internal/components/CheckboxOrRadioGroup/**/*.tsx',
'src/TooltipV2/**/*.tsx',
]

const unsupported = new Set(
[
'src/ActionList/**/*.tsx',
'src/ActionMenu/**/*.tsx',
'src/AvatarStack/**/*.tsx',
'src/Button/**/*.tsx',
'src/ConfirmationDialog/**/*.tsx',
'src/Pagehead/**/*.tsx',
'src/Pagination/**/*.tsx',
'src/SelectPanel/**/*.tsx',
'src/SideNav.tsx',
'src/internal/components/CheckboxOrRadioGroup/**/*.tsx',
'src/TooltipV2/**/*.tsx',
].flatMap(pattern => {
unsupportedPatterns.flatMap(pattern => {
if (glob.isDynamicPattern(pattern)) {
const matches = glob.sync(pattern, {cwd: PACKAGE_DIR})
if (matches) {
Expand All @@ -43,4 +45,4 @@ function isSupported(filepath) {

const notMigrated = Array.from(unsupported)

export {files, notMigrated, isSupported}
export {files, notMigrated, isSupported, unsupportedPatterns}
Loading