{"_id":"@carrotwu/check-conflict-babel-plugin","_rev":"4-555527b366309c42afc26a91dc50fe86","name":"@carrotwu/check-conflict-babel-plugin","dist-tags":{"next":"1.0.2","latest":"1.0.3"},"versions":{"1.0.0":{"name":"@carrotwu/check-conflict-babel-plugin","version":"1.0.0","description":"用于检测react render模板中是否存在未处理的合并冲突遗留代码","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish:next":"npm publish --access public --tag next"},"publishConfig":{"access":"public"},"author":{"name":"carrotwu"},"license":"ISC","devDependencies":{"@babel/core":"^7.11.4","@babel/plugin-transform-runtime":"^7.11.0","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.10.4","@types/babel__core":"^7.1.12","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","eslint":"^7.7.0","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.22.0","eslint-plugin-prettier":"^3.1.4","prettier":"^2.1.1","rollup":"^2.26.5","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-inject":"^3.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-terser":"^7.0.0","rollup-plugin-typescript2":"^0.27.2","typescript":"^4.0.2"},"dependencies":{"@babel/types":"^7.12.11"},"gitHead":"b582aa111eab9c43d8cb900376cc6a44b4255487","_id":"@carrotwu/check-conflict-babel-plugin@1.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-dA5TzfMyx6bgEvsfkVxZgfosSW1ckI4wQyinLu34qriaLL7PncNYhmnkwthZmNJDIcDnfrScNfBzFwPyYZoBWg==","shasum":"1cbb841105011932a2b4e47369f77415de6ab0d1","tarball":"https://registry.npmjs.org/@carrotwu/check-conflict-babel-plugin/-/check-conflict-babel-plugin-1.0.0.tgz","fileCount":8,"unpackedSize":9101,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf89czCRA9TVsSAnZWagAAFmsQAJqt+FfiVUk7KAYW/sK1\na37dl04YjQgGDWPeF3uhjv6HMLCIBh7wwcf14aMetkMxCY9v6TWjysrfuybi\nkiDvRJU3EOSa05oKVE2tJvoouAaNOEb2DdvsJcbbREYjlJuOfcqE+s/mqXbh\n0UED8m59cbppG2RRpYxxYLrx1BKJwPWZobR4wBaO16EKK5E/XA29lE0stKyf\nlG1xPSD2ez022/Tx5kGZDSgbGCKu86071ILMb8PNaLTFoRKmfbe9BOGEaVk1\n7GOSzY4dR+fyLmo7uib9byqas1hhhdzgzF9NbkFEVPkAzlM2kR8gPD58rY+u\nBU15cPgRhsqrfN3LoHYCu2kUjokxeJOD0YNoc5BDzOrpgJgybqBOGQJpsgGm\nRaCr6TndzLjuPCE5mRfaoPRnhrpLWcaX+DBSMhLGk/jHvzM7RslBvJZ+ozRJ\nUS/pc0+tGLbSkJ8bNvQBErz/x/6LJGaHb1+iZa8IPS8BmmY0Em1SnY+4Hnoh\nc5mYJsBS+8sDorFF8JR/wsG27OCZyFoncuox8HFNvV57P4Dh/X+Dv/FwN11v\ngtvryYGl1aLYS/v3AeoNU+RTOVc3OMPu4Qxa4CSnAWR8nIMPR4lKKVt5yC5g\nGA0FMBdrFTzAg0yzulH8pUK23tsNR9wkg++rNg+FW1R+TT7fuF87AryN0+u/\nCGsl\r\n=Rd7W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF32bYTpXq86DvkQHOFzAgmv2YqoDQT1YRGWVKOXn1r3AiEA8UqXox/K+kyX7hyFk69+siau86xt3Ds6xjNtWtXncfA="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/check-conflict-babel-plugin_1.0.0_1609815858730_0.8533743696871936"},"_hasShrinkwrap":false},"1.0.1":{"name":"@carrotwu/check-conflict-babel-plugin","version":"1.0.1","description":"用于检测react render模板中是否存在未处理的合并冲突遗留代码","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish:next":"npm publish --access public --tag next"},"publishConfig":{"access":"public"},"author":{"name":"carrotwu"},"license":"ISC","devDependencies":{"@babel/core":"^7.11.4","@babel/plugin-transform-runtime":"^7.11.0","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.10.4","@types/babel__core":"^7.1.12","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","eslint":"^7.7.0","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.22.0","eslint-plugin-prettier":"^3.1.4","prettier":"^2.1.1","rollup":"^2.26.5","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-inject":"^3.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-terser":"^7.0.0","rollup-plugin-typescript2":"^0.27.2","typescript":"^4.0.2"},"dependencies":{"@babel/types":"^7.12.11"},"readme":"# check-conflict-babel-plugin\n[![NPM Version][npm-image]][npm-url]\n\n一个能够检测react渲染函数中(render)是否有合并冲突遗留代码的babel插件\n\n## 安装\n\n```\nnpm install @carrotwu/check-conflict-babel-plugin -D\nor\nyarn add @carrotwu/check-conflict-babel-plugin -D\n```\n\n## 使用\n\n使用的方式十分简单，只需要在babel配置中的babel插件配置中引入当前插件即可。\n\n### cra中使用\n\n> 下面展示在create-react-app中如何使用当前插件\n\n因为create-react-app需要自定义配置的话有两种方式：\n1. 通过eject的方式把配置暴露出来\n2. 通过社区的`customize-cra`库进行配置覆盖\n\n这里仅仅展示第二种方式的插件安装,`customize-cra`的具体安装方式可以查看具体的官网即可。\n\n\n`config-overrides.js`相关配置如下:\n\n```js\nconst { override, addBabelPlugins } = require('customize-cra');\nconst checkReactConflictBabelPlugin = require('@carrotwu/check-conflict-babel-plugin')\n\nconst isProduction = process.env.NODE_ENV === 'production'\nmodule.exports = {\n  webpack: override(\n    // 生产模式才启用当前插件\n    isProduction && addBabelPlugins(checkReactConflictBabelPlugin)\n  )\n};\n\n```\n\n## 插件是如何检测冲突代码的呢\n\n我们都知道的是在react中，所有的jsx代码最终都会被react转移成`react.createElement`的代码形式，所以我们只需要通过babel对生成的语法树做语法分析即可。这样子我们就能获取到渲染函数中的合并冲突代码。如果想更加深入的了解插件的内在原理，可以查看我之前写的一篇[`博客文章`](https://github.com/timarney/react-app-rewired/)","readmeFilename":"README.md","gitHead":"e287b6e55729dc18d001f30b954d9f2c60225357","_id":"@carrotwu/check-conflict-babel-plugin@1.0.1","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-Pho5StZYkpZhEY6hT0gGW5dOId5jgyD+fUvQFMXkx9CMrrAaNSbZ9nLBPD3ts46LESvjXkkzsQoGs3bhRDt9oQ==","shasum":"338f977804feab47548c36d87dc69ac6b8e364cc","tarball":"https://registry.npmjs.org/@carrotwu/check-conflict-babel-plugin/-/check-conflict-babel-plugin-1.0.1.tgz","fileCount":9,"unpackedSize":10764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9Aw7CRA9TVsSAnZWagAAlsIP/R5X2TkDmeVQu7d0BGNU\n/LSD8Nmg0MfSA/2HuZ70AMjNSXSbaVWypHp//jKKyNTWFSKGJ5YknNBOtDz2\nkF978FRmlwf/f1ilKOzIqR4gYfAdcSWE/v3tJy1Y1t9OGR2Z66yj0/nYK/hA\n3AC5Fu38kGzm7gX+QSPvWp9jHDUrNoH4MDanJikQekuPboQbsbFn0NsC66nw\nScMy/JeCLUo/KOiCZlHlnTysrjx0MYOWmT0Fco086HQz/+oxmXEG5pXS96kk\ndHWpz1jp3wHX6Ffuu8zHIlQ/v1BO/205t+j34bWGJ80RzxLqjV/C87IFXXma\nToYWdWGeX3LTczvnT7WWW9UgEuVIOyXt4sYrgiNXYoDt23ZhNd804nCOnCtf\nVZtVN2dfMwAyk8QQBlSIZ0Cze5Qcwt3HfJSZiHsKc7wPlNOX+90XHCVVhBLf\nJc4SbWemTi/hdHKYIj4sRj+bM9FbxxtMgnsavf8876/398ueUEWi9fBsd0eb\nDfWthRYhU9miV68PyQpJSxMHahF5K9LmAIzUkKVSRPbdh6F1dgA0vpwKJulj\n+kYApIVk79/8RyNwMidL3csAmsnf0rp6WiJ02elZkM+R8pICPW2BVixxoaRh\nUZZ+xjI5rNZG9XhHwZf2yJc0uE0acXLh4DPPGnVoXM2T/cL9RdJqkiqY3AnE\nLFBc\r\n=OJBP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDLHYAxo9pdos2w4uiwwTYk4tU4WR/Y8RS64LiRy70AsAiEA8hfsyf8ACnGrzrjTw6tka+VmW+fxAG2ypJg0vCrwbQU="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/check-conflict-babel-plugin_1.0.1_1609829435571_0.8989223604383529"},"_hasShrinkwrap":false},"1.0.2":{"name":"@carrotwu/check-conflict-babel-plugin","version":"1.0.2","description":"用于检测react render模板中是否存在未处理的合并冲突遗留代码","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish:next":"npm publish --access public --tag next"},"publishConfig":{"access":"public"},"author":{"name":"carrotwu"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/carrot-wu/check-react-conflict-babel-plugin.git"},"homepage":"https://github.com/carrot-wu/check-react-conflict-babel-plugin#README","devDependencies":{"@babel/core":"^7.11.4","@babel/plugin-transform-runtime":"^7.11.0","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.10.4","@types/babel__core":"^7.1.12","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","eslint":"^7.7.0","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.22.0","eslint-plugin-prettier":"^3.1.4","prettier":"^2.1.1","rollup":"^2.26.5","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-inject":"^3.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-terser":"^7.0.0","rollup-plugin-typescript2":"^0.27.2","typescript":"^4.0.2"},"dependencies":{"@babel/types":"^7.12.11"},"readme":"# check-conflict-babel-plugin\n[![NPM Version][npm-image]][npm-url]\n\n一个能够检测react渲染函数中(render)是否有合并冲突遗留代码的babel插件\n\n## 安装\n\n```\nnpm install @carrotwu/check-conflict-babel-plugin -D\nor\nyarn add @carrotwu/check-conflict-babel-plugin -D\n```\n\n## 使用\n\n使用的方式十分简单，只需要在babel配置中的babel插件配置中引入当前插件即可。\n\n### cra中使用\n\n> 下面展示在create-react-app中如何使用当前插件\n\n因为create-react-app需要自定义配置的话有两种方式：\n1. 通过eject的方式把配置暴露出来\n2. 通过社区的`customize-cra`库进行配置覆盖\n\n这里仅仅展示第二种方式的插件安装,`customize-cra`的具体安装方式可以查看具体的官网即可。\n\n\n`config-overrides.js`相关配置如下:\n\n```js\nconst { override, addBabelPlugins } = require('customize-cra');\nconst checkReactConflictBabelPlugin = require('@carrotwu/check-conflict-babel-plugin')\n\nconst isProduction = process.env.NODE_ENV === 'production'\nmodule.exports = {\n  webpack: override(\n    // 生产模式才启用当前插件\n    isProduction && addBabelPlugins(checkReactConflictBabelPlugin)\n  )\n};\n\n```\n\n## 插件是如何检测冲突代码的呢\n\n我们都知道的是在react中，所有的jsx代码最终都会被react转移成`react.createElement`的代码形式，所以我们只需要通过babel对生成的语法树做语法分析即可。这样子我们就能获取到渲染函数中的合并冲突代码。如果想更加深入的了解插件的内在原理，可以查看我之前写的一篇[`博客文章`](https://github.com/timarney/react-app-rewired/)","readmeFilename":"README.md","gitHead":"3ed0fef54a9aea1ded03df9ca13e71fc9872740e","bugs":{"url":"https://github.com/carrot-wu/check-react-conflict-babel-plugin/issues"},"_id":"@carrotwu/check-conflict-babel-plugin@1.0.2","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-fZAj1HCeOeifneh1y3XcPuYCC01/kPEm6ixBFPzFmAsiZIKoPB6Q/qNf/ph8xVQdCpcsuCK51J4+z07fHZueBQ==","shasum":"ea24d40b5d8f7bd6a85acff66c5ee3489557d563","tarball":"https://registry.npmjs.org/@carrotwu/check-conflict-babel-plugin/-/check-conflict-babel-plugin-1.0.2.tgz","fileCount":9,"unpackedSize":10977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9A25CRA9TVsSAnZWagAAPOUQAIdG80nr2CJZEYrKgSLo\nCTrLmIE4Jq/dq6B4ph+/TM/uST8sctYsgEyiCO8Rrogh4GSWWnvXB3TVUpnG\nuWFsH0pEjmh2gIv+VmZyf15yLLoEh2xGeFniWv7URq/FUrGD4j+GDp01uTXm\ncbTzlmg1oYHk4d2GgbmyjxZAj7OTgCqUMtSzwm5olo7n1WyMJcqwQr+5Rqmt\nh73z/qA5cMxPYgj7NLG2wmAUl2Zr25eAZUHq2AJenaeEl9vDeIcSlFWt7kSc\ntyGmv8qrccK5UG5uMwv1FHqh2+VytbOcCXkF23LH28xzpODV+Pani+bqjA98\nz7KO5eKWrA93RZ3vUrRE07h2w+N5ribh3S/9YxwAgNTx4+NtJaeBA6COr0qH\nuSpbumDJCaudKAj7Tocy0qFGvPVun1VMKL+ymKpum1J3f5OsJKGMvraF7ObU\n067l/YKoMbu+fdnsXcfk2zSXS95bHWQ4SORuaR3R35q2HenR8JKrEzwapJg0\nDwfnBtP/2L15p0gXdlonrocRmGzzZS5FjM+3HdcSdJDe8X5lDQKMgCsMf76d\nAK/ASLfYnR7Q1VpQiO2z3p84t32WZPDwvrpfmiodgx4UsyN7zJ3tyaUo5ROO\nM6XclvoE7MLdDu5bO5NL6Xv54B7z+kwxRbxwW8+KeNr4oOcVCbXgQMYvzizf\niCYB\r\n=r84n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHeyfAcCvDZVygQ3RTdW+X+JYEXmr3o6CA8SYlcg2HZLAiB4tg/IN2NmYjOdLIlQUNoTFZSyGGMvKqwpm+4xaqUkrA=="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/check-conflict-babel-plugin_1.0.2_1609829817518_0.7699831532665935"},"_hasShrinkwrap":false},"1.0.3":{"name":"@carrotwu/check-conflict-babel-plugin","version":"1.0.3","description":"用于检测react render模板中是否存在未处理的合并冲突遗留代码","main":"dist/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish:next":"npm publish --access public"},"publishConfig":{"access":"public"},"author":{"name":"carrotwu"},"license":"ISC","repository":{"type":"git","url":"git+https://github.com/carrot-wu/check-react-conflict-babel-plugin.git"},"homepage":"https://github.com/carrot-wu/check-react-conflict-babel-plugin#README","devDependencies":{"@babel/core":"^7.11.4","@babel/plugin-transform-runtime":"^7.11.0","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.10.4","@types/babel__core":"^7.1.12","@typescript-eslint/eslint-plugin":"^3.10.1","@typescript-eslint/parser":"^3.10.1","eslint":"^7.7.0","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.11.0","eslint-plugin-import":"^2.22.0","eslint-plugin-prettier":"^3.1.4","prettier":"^2.1.1","rollup":"^2.26.5","rollup-plugin-babel":"^4.4.0","rollup-plugin-commonjs":"^10.1.0","rollup-plugin-inject":"^3.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-terser":"^7.0.0","rollup-plugin-typescript2":"^0.27.2","typescript":"^4.0.2"},"dependencies":{"@babel/types":"^7.12.11"},"gitHead":"b81b3a7c1a9471befe8be9d0ec5f776721c4a1c7","bugs":{"url":"https://github.com/carrot-wu/check-react-conflict-babel-plugin/issues"},"_id":"@carrotwu/check-conflict-babel-plugin@1.0.3","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-Swgv5fdMSNUPsy5DNeFHh3IMHze1P53ZD2P/518PA327/goQ2Bl+RPc+rXmhSXd4FHlsuKIkwIFUhpzmGBMGGA==","shasum":"cd8a0d5a0ea04e170fcaa89da139cb3ea46f2141","tarball":"https://registry.npmjs.org/@carrotwu/check-conflict-babel-plugin/-/check-conflict-babel-plugin-1.0.3.tgz","fileCount":9,"unpackedSize":10966,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf9BPMCRA9TVsSAnZWagAAK5AP/1cbxHwzreZd4aufbuQo\nAy7aZBQN2R9KPFjseo+/ccu9cGa8jQAkyQo3yIBw6EaeBhZEWicq1ZYQkQCo\nZ5vXzl9jYuRBU5cERDh9XMjkQg8XM5iRiSfr8nuJ63EU2RVseMrWd0GG6eyd\nD2dO/NecBZzcTsX2gbxVZPx8x4xd15HIvPCMJRi+neax9JH3AqO6OIuzeoYE\n0unN4/meZd9K6E2ZB2Ngdve8YTeX6IXaTyQWac7nJs69t78n/rSzPmdwmWL+\nzeBL7CoDBUaqrSvA00hb1dQ/I4/ym+cED9QVBsuyLwx5Th8gyuGnL4hFISaD\nL93Yl9pDE5ARBj8QnAk0Wlra2PcGmpFbPEisdDy0lRxW8Or/QXsEI8MqJj4w\nsWYbmCRvRmDcqlcQ+D4H6XlpzgUri+RPUr6RMkBgaUAQSCtkwsifGos8jYLN\n1jKLHchtQdAP0hKRPZPRfsFHO8C2d7OHLSCvSGlPe1o5sqsbQujytALFVXro\nhbteCxb0d1AWPl61bDFbs53JozKtqbUSFdWGl6jxM7cdW91G+bhf8E+lSMVI\nX/ApoKViwzuv5vChQ7n8u1H43zFoKQGHkD8uzt1oKXKLvWj99YQc7bjedOmn\nxy5Ta25RnD1NMOm1ZYIYZoE/mH4DyUSeyb+BakTypXyR877zBDPhrSOEFO50\nO2oW\r\n=FHev\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWvNX63CXH+/K9wGKCkqaKx0rZFc83hKTIKCd6z9A/cgIgUCP/nw2m/KFtPd6OeZypqYW7PvaXXgU0oCErtYwxNNs="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/check-conflict-babel-plugin_1.0.3_1609831371751_0.41162489386448353"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-05T03:04:18.673Z","1.0.0":"2021-01-05T03:04:18.863Z","modified":"2022-04-04T21:59:06.524Z","1.0.1":"2021-01-05T06:50:35.718Z","1.0.2":"2021-01-05T06:56:57.649Z","1.0.3":"2021-01-05T07:22:51.888Z"},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"description":"用于检测react render模板中是否存在未处理的合并冲突遗留代码","author":{"name":"carrotwu"},"license":"ISC","readme":"# check-conflict-babel-plugin\n[![NPM Version][npm-image]][npm-url]\n\n一个能够检测react渲染函数中(render)是否有合并冲突遗留代码的babel插件\n\n## 安装\n\n```\nnpm install @carrotwu/check-conflict-babel-plugin -D\nor\nyarn add @carrotwu/check-conflict-babel-plugin -D\n```\n\n## 使用\n\n使用的方式十分简单，只需要在babel配置中的babel插件配置中引入当前插件即可。\n\n### cra中使用\n\n> 下面展示在create-react-app中如何使用当前插件\n\n因为create-react-app需要自定义配置的话有两种方式：\n1. 通过eject的方式把配置暴露出来\n2. 通过社区的`customize-cra`库进行配置覆盖\n\n这里仅仅展示第二种方式的插件安装,`customize-cra`的具体安装方式可以查看具体的官网即可。\n\n\n`config-overrides.js`相关配置如下:\n\n```js\nconst { override, addBabelPlugins } = require('customize-cra');\nconst checkReactConflictBabelPlugin = require('@carrotwu/check-conflict-babel-plugin')\n\nconst isProduction = process.env.NODE_ENV === 'production'\nmodule.exports = {\n  webpack: override(\n    // 生产模式才启用当前插件\n    isProduction && addBabelPlugins(checkReactConflictBabelPlugin)\n  )\n};\n\n```\n\n## 插件是如何检测冲突代码的呢\n\n我们都知道的是在react中，所有的jsx代码最终都会被react转移成`react.createElement`的代码形式，所以我们只需要通过babel对生成的语法树做语法分析即可。这样子我们就能获取到渲染函数中的合并冲突代码。如果想更加深入的了解插件的内在原理，可以查看我之前写的一篇[`博客文章`](https://github.com/timarney/react-app-rewired/)","readmeFilename":"README.md","homepage":"https://github.com/carrot-wu/check-react-conflict-babel-plugin#README","repository":{"type":"git","url":"git+https://github.com/carrot-wu/check-react-conflict-babel-plugin.git"},"bugs":{"url":"https://github.com/carrot-wu/check-react-conflict-babel-plugin/issues"}}