在这里插入图片描述

ESLint+Typescript
1、安装 Typescript cnpm i typescript eslint --save-dev  
2、初始化ESlint 主要注意其中有一项是关于typescript的 需要选择Yes

ESLint配置如下

parser指定语法解析器 typescript比es6语法麻烦一些
  
parser: '@typescript-eslint/parser',

module.exports = {
  env: {
    browser: true,
    es2020: true
  },
  extends: [
    'standard'
  ],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 11
  },
  plugins: [
    '@typescript-eslint'
  ],
  rules: {
  }
}

谢谢观看,如有不足敬请指教

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐