该包提供 React 相关的 eslint 配置,内置包含 @utopia/eslint-config-base 中提供的配置,同时支持 React 插件以及 Hooks 等,也可根据个人(团队)规范增加或者重写相关 rules。
npm install --save-dev @utopia/eslint-config-react
# or
yarn add -D @utopia/eslint-config-react
在 .eslintrc.* 文件中配置:
module.exports = {
extends: ['@utopia/eslint-config-react']
};
如果需要支持 Hooks
module.exports = {
extends: ['@utopia/eslint-config-react', '@utopia/eslint-config-react/hooks']
};