【Typescript】【eslint】安装,配置,报错的记录

    科技2022-07-16  112

    文章目录

    相关文档资料rules 安装报错no-this-alias

    相关文档资料

    rules

    https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin/docs/rules

    安装

    npm install typescript -D npm install eslint -D npx eslint --init

    报错

    no-this-alias

    .eslintrc.js rules新增

    '@typescript-eslint/no-this-alias': [ 'error', { allowDestructuring: true, // Allow `const { props, state } = this`; false by default allowedNames: ['self'], // Allow `const self = this`; `[]` by default }, ], ## CRLF/LF的linebreak错误 ```json rules: { //换行符问题 'linebreak-style': [0, 'error', 'windows'], },
    Processed: 0.012, SQL: 8