首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    代码规范之-理解ESLint、Prettier、EditorConfig

    配置包扩展支持React语法; 通过@typescript-eslint/parser解析器支持typeScript语法及校验等; 三、ESLint 使用 Node.js 编写 在前端项目中便于安装且有一个快速的运行环境...安装: yarn add --save-dev eslint 复制代码 安装插件和解析器 假如项目中使用了TypeScript和React,则安装: // 我们需要安装 @typescript-eslint...yarn add --save-dev typescript @typescript-eslint/parser // 安装eslint-plugin-react配置包扩展支持React语法;安装@typescript-eslint.../eslint-plugin提供额外的ts 语法的规则 yarn add --save-dev eslint-plugin-react @typescript-eslint/eslint-plugin...plugins: ['react','@typescript-eslint'], rules: { // 禁止使用 var 'no-var': "error

    3.9K30
    领券