{"id":13793585,"url":"https://github.com/bubucuo/DebugReact","last_synced_at":"2025-05-12T20:31:06.494Z","repository":{"id":38473376,"uuid":"222418208","full_name":"bubucuo/DebugReact","owner":"bubucuo","description":"调试react源码","archived":false,"fork":false,"pushed_at":"2025-05-07T04:48:18.000Z","size":46395,"stargazers_count":318,"open_issues_count":38,"forks_count":143,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-07T05:28:42.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bubucuo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-11-18T10:06:29.000Z","updated_at":"2025-05-07T04:48:22.000Z","dependencies_parsed_at":"2025-02-05T00:28:18.819Z","dependency_job_id":null,"html_url":"https://github.com/bubucuo/DebugReact","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubucuo%2FDebugReact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubucuo%2FDebugReact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubucuo%2FDebugReact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bubucuo%2FDebugReact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bubucuo","download_url":"https://codeload.github.com/bubucuo/DebugReact/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253816704,"owners_count":21968869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T23:00:25.298Z","updated_at":"2025-05-12T20:31:06.453Z","avatar_url":"https://github.com/bubucuo.png","language":"JavaScript","funding_links":[],"categories":["目录"],"sub_categories":["\u003ca id=\"article\"\u003e文章\u003c/a\u003e"],"readme":"# React 源码学习指南\n\n1. 本项目属于课程资源，已购买课程学员可以联系我「微信: bubucuo_sy」，获取完整版~\n\n2. 更多资源，关注公众号：bubucuo\n\n## 前言\n\n本项目用于调试源码，即修改配置使得项目中引用的 react 包来自 src/react，使得我们可以在 src/react 下 debug 和打 log 调试。\n\n## 资源\n\n1. [源码文件指引地址]([React 源码文件指引 | ProcessOn 免费在线作图,在线流程图,在线思维导图](https://www.processon.com/view/link/60b206c2e0b34d3841931a88))\n\n## 使用步骤\n\n1. 在根目录下安装： yarn add\n2. 下载 react 包到 src 下，并按照下面的修改配置步骤修改 react 中的文件。\n3. 在根目录下启动： yarn start\n\n## 自己从 github 下载 react 包并修改配置\n\n1. /src/react/packages/scheduler/index.js\n\n```jsx\n\"use strict\";\n\nexport * from \"./src/forks/Scheduler\";\n\n// sy- 添加以下\nexport {\n  log,\n  unstable_flushAllWithoutAsserting,\n  unstable_flushNumberOfYields,\n  unstable_flushExpired,\n  unstable_flushUntilNextPaint,\n  unstable_flushAll,\n  unstable_advanceTime,\n  unstable_setDisableYieldValue,\n} from \"./src/forks/SchedulerMock\";\n```\n\n2. /src/react/packages/react-reconciler/src/ReactFiberConfig.js\n\n```jsx\n// throw new Error('This module must be shimmed by a specific renderer.');\n\n// sy-\nexport * from \"./forks/ReactFiberConfig.dom\";\nexport { bindToConsole } from \"../../react-client/src/ReactClientConsoleConfigBrowser\";\n```\n\n3. /src/react/packages/shared/ReactSharedInternals.js\n\n```jsx\n// import * as React from 'react';\n\n// const ReactSharedInternals =\n//   React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n\n// sy\nimport ReactSharedInternals from \"../react/src/ReactSharedInternalsClient\";\n\nexport default ReactSharedInternals;\n```\n\n4. src/react/packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js\n\n   ```js\n   // 在export type ViewTransitionInstance = { 前面增加以下代码\n   // sy-\n   type Animatable = any;\n   type Keyframe = any;\n   type PropertyIndexedKeyframes = any;\n   type KeyframeAnimationOptions = any;\n   type GetAnimationsOptions = any;\n   type EventListenerOptionsOrUseCapture = any;\n   type FocusOptions = any;\n   ```\n\n5. src/react/packages/react-reconciler/src/ReactFiberDevToolsHook.js\n\n   ```js\n   // declare const __REACT_DEVTOOLS_GLOBAL_HOOK__: Object | void;\n   // sy-\n   var __REACT_DEVTOOLS_GLOBAL_HOOK__: Object | void;\n   ```\n\n6. src/react/.eslintrc.js\n\n我修改后的文件如下：\n\n```js\n\"use strict\";\n\nconst {\n  es5Paths,\n  esNextPaths,\n} = require(\"./scripts/shared/pathsByLanguageVersion\");\n\nconst restrictedGlobals = require(\"confusing-browser-globals\");\n\nconst OFF = 0;\nconst WARNING = 1;\nconst ERROR = 2;\n\nmodule.exports = {\n  extends: [\"plugin:jest/recommended\"], // sy-['prettier', 'plugin:jest/recommended'],\n\n  // Stop ESLint from looking for a configuration file in parent folders\n  root: true,\n\n  // reportUnusedDisableDirectives: true,\n  reportUnusedDisableDirectives: false,\n\n  plugins: [\n    // 'babel',\n    \"ft-flow\",\n    \"jest\",\n    \"es\",\n    \"no-for-of-loops\",\n    \"no-function-declare-after-return\",\n    \"react\",\n    \"react-internal\",\n  ],\n\n  parser: \"hermes-eslint\",\n  parserOptions: {\n    ecmaVersion: 9,\n    sourceType: \"script\",\n  },\n\n  // We're stricter than the default config, mostly. We'll override a few rules\n  // and then enable some React specific ones.\n  rules: {\n    \"ft-flow/array-style-complex-type\": [OFF, \"verbose\"],\n    \"ft-flow/array-style-simple-type\": [OFF, \"verbose\"], // TODO should be WARNING\n    \"ft-flow/boolean-style\": ERROR,\n    \"ft-flow/no-dupe-keys\": ERROR,\n    \"ft-flow/no-primitive-constructor-types\": ERROR,\n    \"ft-flow/no-types-missing-file-annotation\": OFF, // TODO should be ERROR\n    \"ft-flow/no-unused-expressions\": OFF, // ERROR,\n    // 'ft-flow/no-weak-types': WARNING,\n    // 'ft-flow/require-valid-file-annotation': ERROR,\n    \"es/no-optional-chaining\": ERROR,\n    \"no-cond-assign\": OFF,\n    \"no-constant-condition\": OFF,\n    \"no-control-regex\": OFF,\n    \"no-debugger\": ERROR,\n    \"no-dupe-args\": ERROR,\n    \"no-dupe-keys\": ERROR,\n    \"no-duplicate-case\": WARNING,\n    \"no-empty-character-class\": WARNING,\n    \"no-empty\": OFF,\n    \"no-ex-assign\": WARNING,\n    \"no-extra-boolean-cast\": WARNING,\n    \"no-func-assign\": ERROR,\n    \"no-invalid-regexp\": WARNING,\n    \"no-irregular-whitespace\": WARNING,\n    \"no-negated-in-lhs\": ERROR,\n    \"no-obj-calls\": ERROR,\n    \"no-regex-spaces\": WARNING,\n    \"no-sparse-arrays\": ERROR,\n    \"no-unreachable\": ERROR,\n    \"use-isnan\": ERROR,\n    \"valid-jsdoc\": OFF,\n    \"block-scoped-var\": OFF,\n    complexity: OFF,\n    \"default-case\": OFF,\n    \"guard-for-in\": OFF,\n    \"no-alert\": OFF,\n    \"no-caller\": ERROR,\n    \"no-case-declarations\": OFF,\n    \"no-div-regex\": OFF,\n    \"no-else-return\": OFF,\n    \"no-empty-pattern\": WARNING,\n    \"no-eq-null\": OFF,\n    \"no-eval\": ERROR,\n    \"no-extend-native\": WARNING,\n    \"no-extra-bind\": WARNING,\n    \"no-fallthrough\": WARNING,\n    \"no-implicit-coercion\": OFF,\n    \"no-implied-eval\": ERROR,\n    \"no-invalid-this\": OFF,\n    \"no-iterator\": OFF,\n    \"no-labels\": [ERROR, { allowLoop: true, allowSwitch: true }],\n    \"no-lone-blocks\": WARNING,\n    \"no-loop-func\": OFF,\n    \"no-magic-numbers\": OFF,\n    \"no-multi-str\": ERROR,\n    \"no-native-reassign\": [ERROR, { exceptions: [\"Map\", \"Set\"] }],\n    \"no-new-func\": ERROR,\n    \"no-new\": WARNING,\n    \"no-new-wrappers\": WARNING,\n    \"no-octal-escape\": WARNING,\n    \"no-octal\": WARNING,\n    \"no-param-reassign\": OFF,\n    \"no-process-env\": OFF,\n    \"no-proto\": ERROR,\n    \"no-redeclare\": OFF, // TODO should be WARNING?\n    \"no-return-assign\": OFF,\n    \"no-script-url\": ERROR,\n    \"no-self-compare\": WARNING,\n    \"no-sequences\": WARNING,\n    \"no-throw-literal\": ERROR,\n    \"no-useless-call\": WARNING,\n    \"no-void\": OFF,\n    \"no-warning-comments\": OFF,\n    \"no-with\": OFF,\n    radix: WARNING,\n    \"vars-on-top\": OFF,\n    yoda: OFF,\n    \"init-declarations\": OFF,\n    \"no-catch-shadow\": ERROR,\n    \"no-delete-var\": OFF, // ERROR,\n    \"no-label-var\": OFF, // WARNING,\n    \"no-shadow-restricted-names\": WARNING,\n    \"no-undef-init\": OFF,\n    \"no-undef\": ERROR,\n    \"no-undefined\": OFF,\n    \"callback-return\": OFF,\n    \"global-require\": OFF,\n    \"handle-callback-err\": OFF,\n    \"no-mixed-requires\": OFF,\n    \"no-new-require\": OFF,\n    \"no-path-concat\": OFF,\n    \"no-process-exit\": OFF,\n    \"no-restricted-modules\": OFF,\n    \"no-sync\": OFF,\n    camelcase: [OFF, { properties: \"always\" }],\n    \"consistent-this\": [OFF, \"self\"],\n    \"func-names\": OFF,\n    \"func-style\": [OFF, \"declaration\"],\n    \"id-length\": OFF,\n    \"id-match\": OFF,\n    \"max-depth\": OFF,\n    \"max-nested-callbacks\": OFF,\n    \"max-params\": OFF,\n    \"max-statements\": OFF,\n    \"new-cap\": OFF,\n    \"newline-after-var\": OFF,\n    \"no-array-constructor\": ERROR,\n    \"no-continue\": OFF,\n    \"no-inline-comments\": OFF,\n    \"no-lonely-if\": OFF,\n    \"no-negated-condition\": OFF,\n    \"no-nested-ternary\": OFF,\n    \"no-new-object\": WARNING,\n    \"no-plusplus\": OFF,\n    \"no-ternary\": OFF,\n    \"no-underscore-dangle\": OFF,\n    \"no-unneeded-ternary\": WARNING,\n    \"one-var\": [WARNING, { initialized: \"never\" }],\n    \"operator-assignment\": [WARNING, \"always\"],\n    \"require-jsdoc\": OFF,\n    \"sort-vars\": OFF,\n    \"spaced-comment\": [\n      OFF,\n      \"always\",\n      { exceptions: [\"jshint\", \"jslint\", \"eslint\", \"global\"] },\n    ],\n    \"constructor-super\": ERROR,\n    \"no-class-assign\": WARNING,\n    \"no-const-assign\": ERROR,\n    \"no-dupe-class-members\": ERROR,\n    \"no-this-before-super\": ERROR,\n    \"object-shorthand\": OFF,\n    \"prefer-const\": OFF,\n    \"prefer-spread\": OFF,\n    \"prefer-reflect\": OFF,\n    \"prefer-template\": OFF,\n    \"require-yield\": OFF,\n    \"babel/generator-star-spacing\": OFF,\n    \"babel/new-cap\": OFF,\n    \"babel/array-bracket-spacing\": OFF,\n    \"babel/object-curly-spacing\": OFF,\n    \"babel/object-shorthand\": OFF,\n    \"babel/arrow-parens\": OFF,\n    \"babel/no-await-in-loop\": OFF,\n    \"babel/flow-object-type\": OFF,\n    \"react/display-name\": OFF,\n    \"react/forbid-prop-types\": OFF,\n    \"react/jsx-closing-bracket-location\": OFF,\n    \"react/jsx-curly-spacing\": OFF,\n    \"react/jsx-equals-spacing\": WARNING,\n    \"react/jsx-filename-extension\": OFF,\n    \"react/jsx-first-prop-new-line\": OFF,\n    \"react/jsx-handler-names\": OFF,\n    \"react/jsx-indent\": OFF,\n    \"react/jsx-indent-props\": OFF,\n    \"react/jsx-key\": OFF,\n    \"react/jsx-max-props-per-line\": OFF,\n    \"react/jsx-no-bind\": OFF,\n    \"react/jsx-no-duplicate-props\": ERROR,\n    \"react/jsx-no-literals\": OFF,\n    \"react/jsx-no-target-blank\": OFF,\n    \"react/jsx-pascal-case\": OFF,\n    \"react/jsx-sort-props\": OFF,\n    \"react/jsx-uses-vars\": ERROR,\n    \"react/no-comment-textnodes\": OFF,\n    \"react/no-danger\": OFF,\n    \"react/no-deprecated\": OFF,\n    \"react/no-did-mount-set-state\": OFF,\n    \"react/no-did-update-set-state\": OFF,\n    \"react/no-direct-mutation-state\": OFF,\n    \"react/no-multi-comp\": OFF,\n    \"react/no-render-return-value\": OFF,\n    \"react/no-set-state\": OFF,\n    \"react/no-string-refs\": OFF,\n    \"react/no-unknown-property\": OFF,\n    \"react/prefer-es6-class\": OFF,\n    \"react/prefer-stateless-function\": OFF,\n    \"react/prop-types\": OFF,\n    \"react/require-extension\": OFF,\n    \"react/require-optimization\": OFF,\n    \"react/require-render-return\": OFF,\n    \"react/sort-comp\": OFF,\n    \"react/sort-prop-types\": OFF,\n\n    \"accessor-pairs\": OFF,\n    \"brace-style\": [ERROR, \"1tbs\"],\n    \"consistent-return\": OFF,\n    \"dot-location\": [ERROR, \"property\"],\n    // We use console['error']() as a signal to not transform it:\n    \"dot-notation\": [ERROR, { allowPattern: \"^(error|warn)$\" }],\n    \"eol-last\": ERROR,\n    eqeqeq: [ERROR, \"allow-null\"],\n    indent: OFF,\n    \"jsx-quotes\": OFF, //[ERROR, 'prefer-double'],\n    \"keyword-spacing\": [ERROR, { after: true, before: true }],\n    \"no-bitwise\": OFF,\n    \"no-console\": OFF,\n    \"no-inner-declarations\": [ERROR, \"functions\"],\n    \"no-multi-spaces\": ERROR,\n    \"no-restricted-globals\": [ERROR].concat(restrictedGlobals),\n    \"no-restricted-syntax\": [\n      ERROR,\n      \"WithStatement\",\n      {\n        selector: \"MemberExpression[property.name=/^(?:substring|substr)$/]\",\n        message: \"Prefer string.slice() over .substring() and .substr().\",\n      },\n    ],\n    \"no-shadow\": ERROR,\n    \"no-unused-vars\": OFF, // [ERROR, {args: 'none', ignoreRestSiblings: true}],\n    \"no-use-before-define\": OFF,\n    \"no-useless-concat\": OFF,\n    quotes: OFF, //[ERROR, 'single', {avoidEscape: true, allowTemplateLiterals: true}],\n    \"space-before-blocks\": ERROR,\n    \"space-before-function-paren\": OFF,\n    \"valid-typeof\": [ERROR, { requireStringLiterals: true }],\n    // Flow fails with non-string literal keys\n    \"no-useless-computed-key\": OFF,\n\n    // We apply these settings to files that should run on Node.\n    // They can't use JSX or ES6 modules, and must be in strict mode.\n    // They can, however, use other ES6 features.\n    // (Note these rules are overridden later for source files.)\n    \"no-var\": OFF, // ERROR,\n    strict: ERROR,\n\n    // Enforced by Prettier\n    // TODO: Prettier doesn't handle long strings or long comments. Not a big\n    // deal. But I turned it off because loading the plugin causes some obscure\n    // syntax error and it didn't seem worth investigating.\n    \"max-len\": OFF,\n\n    // React \u0026 JSX\n    // Our transforms set this automatically\n    \"react/jsx-boolean-value\": [ERROR, \"always\"],\n    \"react/jsx-no-undef\": ERROR,\n    // We don't care to do this\n    \"react/jsx-sort-prop-types\": OFF,\n    \"react/jsx-space-before-closing\": ERROR,\n    \"react/jsx-uses-react\": ERROR,\n    \"react/no-is-mounted\": OFF,\n    // This isn't useful in our test code\n    \"react/react-in-jsx-scope\": ERROR,\n    \"react/self-closing-comp\": ERROR,\n    // We don't care to do this\n    \"react/jsx-wrap-multilines\": OFF,\n\n    // Prevent for...of loops because they require a Symbol polyfill.\n    // You can disable this rule for code that isn't shipped (e.g. build scripts and tests).\n    \"no-for-of-loops/no-for-of-loops\": OFF,\n\n    // Prevent function declarations after return statements\n    \"no-function-declare-after-return/no-function-declare-after-return\": OFF,\n\n    // CUSTOM RULES\n    // the second argument of warning/invariant should be a literal string\n    // 'react-internal/no-primitive-constructors': ERROR,\n    \"react-internal/safe-string-coercion\": OFF,\n    // [\n    //   ERROR,\n    //   {isProductionUserAppCode: true},\n    // ],\n    // 'react-internal/no-to-warn-dev-within-to-throw': ERROR,\n    // 'react-internal/warning-args': ERROR,\n    // 'react-internal/no-production-logging': ERROR,\n  },\n\n  overrides: [\n    // {\n    //   // By default, anything error message that appears the packages directory\n    //   // must have a corresponding error code. The exceptions are defined\n    //   // in the next override entry.\n    //   files: ['packages/**/*.js'],\n    //   // rules: {\n    //   //   'react-internal/prod-error-codes': ERROR,\n    //   // },\n    // },\n    // {\n    //   // These are files where it's OK to have unminified error messages. These\n    //   // are environments where bundle size isn't a concern, like tests\n    //   // or Node.\n    //   files: [\n    //     'packages/react-dom/src/test-utils/**/*.js',\n    //     'packages/react-devtools-shared/**/*.js',\n    //     'packages/react-noop-renderer/**/*.js',\n    //     'packages/react-refresh/**/*.js',\n    //     'packages/react-server-dom-esm/**/*.js',\n    //     'packages/react-server-dom-webpack/**/*.js',\n    //     'packages/react-server-dom-turbopack/**/*.js',\n    //     'packages/react-server-dom-fb/**/*.js',\n    //     'packages/react-test-renderer/**/*.js',\n    //     'packages/react-debug-tools/**/*.js',\n    //     'packages/react-devtools-extensions/**/*.js',\n    //     'packages/react-devtools-timeline/**/*.js',\n    //     'packages/react-native-renderer/**/*.js',\n    //     'packages/eslint-plugin-react-hooks/**/*.js',\n    //     'packages/jest-react/**/*.js',\n    //     'packages/internal-test-utils/**/*.js',\n    //     'packages/**/__tests__/*.js',\n    //     'packages/**/npm/*.js',\n    //   ],\n    //   rules: {\n    //     'react-internal/prod-error-codes': OFF,\n    //   },\n    // },\n    {\n      // We apply these settings to files that we ship through npm.\n      // They must be ES5.\n      files: es5Paths,\n      parser: \"espree\",\n      parserOptions: {\n        ecmaVersion: 5,\n        sourceType: \"script\",\n      },\n      rules: {\n        \"no-var\": OFF,\n        strict: OFF,\n      },\n    },\n    {\n      // We apply these settings to the source files that get compiled.\n      // They can use all features including JSX (but shouldn't use `var`).\n      files: esNextPaths,\n      parser: \"hermes-eslint\",\n      parserOptions: {\n        ecmaVersion: 8,\n        sourceType: \"module\",\n      },\n      rules: {\n        \"no-var\": OFF, //ERROR,\n        \"prefer-const\": OFF, // ERROR,\n        strict: OFF,\n      },\n    },\n    {\n      files: [\"**/__tests__/*.js\"],\n      rules: {\n        // https://github.com/jest-community/eslint-plugin-jest\n        // Meh, who cares.\n        \"jest/consistent-test-it\": OFF,\n        // Meh, we have a lot of these, who cares.\n        \"jest/no-alias-methods\": OFF,\n        // We do conditions based on feature flags.\n        \"jest/no-conditional-expect\": OFF,\n        // We have our own assertion helpers.\n        \"jest/expect-expect\": OFF,\n        // Lame rule that fires in itRender helpers or in render methods.\n        \"jest/no-standalone-expect\": OFF,\n      },\n    },\n    {\n      // Rules specific to test setup helper files.\n      files: [\n        \"**/setupTests.js\",\n        \"**/setupEnv.js\",\n        \"**/jest/TestFlags.js\",\n        \"**/dom-event-testing-library/testHelpers.js\",\n        \"**/utils/ReactDOMServerIntegrationTestUtils.js\",\n        \"**/babel/transform-react-version-pragma.js\",\n        \"**/babel/transform-test-gate-pragma.js\",\n      ],\n      rules: {\n        // Some helpers intentionally focus tests.\n        \"jest/no-focused-tests\": OFF,\n        // Test fn helpers don't use static text names.\n        \"jest/valid-title\": OFF,\n        // We have our own assertion helpers.\n        \"jest/expect-expect\": OFF,\n        // Some helpers intentionally disable tests.\n        \"jest/no-disabled-tests\": OFF,\n        // Helpers export text function helpers.\n        \"jest/no-export\": OFF,\n        // The examples in comments trigger false errors.\n        \"jest/no-commented-out-tests\": OFF,\n      },\n    },\n    {\n      files: [\"**/jest/TestFlags.js\"],\n      rules: {\n        // The examples in comments trigger false errors.\n        \"jest/no-commented-out-tests\": OFF,\n      },\n    },\n    // {\n    //   files: [\n    //     '**/__tests__/**/*.js',\n    //     'scripts/**/*.js',\n    //     'packages/*/npm/**/*.js',\n    //     'packages/dom-event-testing-library/**/*.js',\n    //     'packages/react-devtools*/**/*.js',\n    //     'dangerfile.js',\n    //     'fixtures',\n    //     'packages/react-dom/src/test-utils/*.js',\n    //   ],\n    //   rules: {\n    //     'es/no-optional-chaining': OFF,\n    //     'react-internal/no-production-logging': OFF,\n    //     'react-internal/warning-args': OFF,\n    //     'react-internal/safe-string-coercion': [\n    //       ERROR,\n    //       {isProductionUserAppCode: false},\n    //     ],\n    //   },\n    // },\n    {\n      files: [\n        \"scripts/eslint-rules/*.js\",\n        \"packages/eslint-plugin-react-hooks/src/*.js\",\n      ],\n      plugins: [\"eslint-plugin\"],\n      rules: {\n        \"eslint-plugin/prefer-object-rule\": ERROR,\n        \"eslint-plugin/require-meta-fixable\": [\n          ERROR,\n          { catchNoFixerButFixableProperty: true },\n        ],\n        \"eslint-plugin/require-meta-has-suggestions\": ERROR,\n      },\n    },\n    {\n      files: [\"packages/react-native-renderer/**/*.js\"],\n      globals: {\n        nativeFabricUIManager: \"readonly\",\n        RN$enableMicrotasksInReact: \"readonly\",\n      },\n    },\n    {\n      files: [\"packages/react-server-dom-webpack/**/*.js\"],\n      globals: {\n        __webpack_chunk_load__: \"readonly\",\n        __webpack_require__: \"readonly\",\n      },\n    },\n    {\n      files: [\"packages/react-server-dom-turbopack/**/*.js\"],\n      globals: {\n        __turbopack_load__: \"readonly\",\n        __turbopack_require__: \"readonly\",\n      },\n    },\n    {\n      files: [\"packages/scheduler/**/*.js\"],\n      globals: {\n        TaskController: \"readonly\",\n      },\n    },\n    {\n      files: [\n        \"packages/react-devtools-extensions/**/*.js\",\n        \"packages/react-devtools-shared/src/hook.js\",\n        \"packages/react-devtools-shared/src/backend/console.js\",\n        \"packages/react-devtools-shared/src/backend/shared/DevToolsComponentStackFrame.js\",\n      ],\n      globals: {\n        __IS_CHROME__: \"readonly\",\n        __IS_FIREFOX__: \"readonly\",\n        __IS_EDGE__: \"readonly\",\n        __IS_NATIVE__: \"readonly\",\n        __IS_INTERNAL_VERSION__: \"readonly\",\n      },\n    },\n    {\n      files: [\"packages/react-devtools-shared/**/*.js\"],\n      globals: {\n        __IS_INTERNAL_VERSION__: \"readonly\",\n      },\n    },\n  ],\n\n  env: {\n    browser: true,\n    es6: true,\n    node: true,\n    jest: true,\n  },\n\n  globals: {\n    $Call: \"readonly\",\n    $ElementType: \"readonly\",\n    $Flow$ModuleRef: \"readonly\",\n    $FlowFixMe: \"readonly\",\n    $Keys: \"readonly\",\n    $NonMaybeType: \"readonly\",\n    $PropertyType: \"readonly\",\n    $ReadOnly: \"readonly\",\n    $ReadOnlyArray: \"readonly\",\n    $ArrayBufferView: \"readonly\",\n    $Shape: \"readonly\",\n    CallSite: \"readonly\",\n    ConsoleTask: \"readonly\", // TOOD: Figure out what the official name of this will be.\n    ReturnType: \"readonly\",\n    AnimationFrameID: \"readonly\",\n    // For Flow type annotation. Only `BigInt` is valid at runtime.\n    bigint: \"readonly\",\n    BigInt: \"readonly\",\n    BigInt64Array: \"readonly\",\n    BigUint64Array: \"readonly\",\n    Class: \"readonly\",\n    ClientRect: \"readonly\",\n    CopyInspectedElementPath: \"readonly\",\n    DOMHighResTimeStamp: \"readonly\",\n    EventListener: \"readonly\",\n    Iterable: \"readonly\",\n    AsyncIterable: \"readonly\",\n    $AsyncIterable: \"readonly\",\n    $AsyncIterator: \"readonly\",\n    Iterator: \"readonly\",\n    AsyncIterator: \"readonly\",\n    IteratorResult: \"readonly\",\n    JSONValue: \"readonly\",\n    JSResourceReference: \"readonly\",\n    MouseEventHandler: \"readonly\",\n    PropagationPhases: \"readonly\",\n    PropertyDescriptor: \"readonly\",\n    React$AbstractComponent: \"readonly\",\n    React$Component: \"readonly\",\n    React$ComponentType: \"readonly\",\n    React$Config: \"readonly\",\n    React$Context: \"readonly\",\n    React$Element: \"readonly\",\n    React$ElementConfig: \"readonly\",\n    React$ElementProps: \"readonly\",\n    React$ElementRef: \"readonly\",\n    React$ElementType: \"readonly\",\n    React$Key: \"readonly\",\n    React$Node: \"readonly\",\n    React$Portal: \"readonly\",\n    React$Ref: \"readonly\",\n    React$RefSetter: \"readonly\",\n    ReadableStreamController: \"readonly\",\n    ReadableStreamReader: \"readonly\",\n    RequestInfo: \"readonly\",\n    RequestOptions: \"readonly\",\n    StoreAsGlobal: \"readonly\",\n    symbol: \"readonly\",\n    SyntheticEvent: \"readonly\",\n    SyntheticMouseEvent: \"readonly\",\n    Thenable: \"readonly\",\n    TimeoutID: \"readonly\",\n    WheelEventHandler: \"readonly\",\n    FinalizationRegistry: \"readonly\",\n    Omit: \"readonly\",\n\n    spyOnDev: \"readonly\",\n    spyOnDevAndProd: \"readonly\",\n    spyOnProd: \"readonly\",\n    __DEV__: \"readonly\",\n    __EXPERIMENTAL__: \"readonly\",\n    __EXTENSION__: \"readonly\",\n    __PROFILE__: \"readonly\",\n    __TEST__: \"readonly\",\n    __VARIANT__: \"readonly\",\n    __unmockReact: \"readonly\",\n    gate: \"readonly\",\n    trustedTypes: \"readonly\",\n    IS_REACT_ACT_ENVIRONMENT: \"readonly\",\n    AsyncLocalStorage: \"readonly\",\n    async_hooks: \"readonly\",\n    globalThis: \"readonly\",\n  },\n};\n```\n\n5. `yarn start`启动项目，此时可能依然有报错，这时候可以根据控制台此时的错误提示，再酌情修改。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubucuo%2FDebugReact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbubucuo%2FDebugReact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbubucuo%2FDebugReact/lists"}