错误 解决
error Unexpected tab character “no-tabs”: 0
Newline required at end of file but not found eol-last: 0
Missing space before function parentheses “space-before-function-paren”: 0,
Expected indentation of 2 spaces but found 1 tab “indent”: “off”
‘require’ and ‘process’ is not defined node: true
upgrade es version ecmaVersion: 2020
warning Delete ␍ ‘prettier/prettier’: [
‘error’,
{
endOfLine:’auto’,
},
],
  1. env: {
  2. browser: true,
  3. es6: true,
  4. node: true
  5. },
  6. rules: {
  7. 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  8. 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  9. "no-tabs": 0,
  10. "eol-last":0,
  11. "space-before-function-paren": 0,
  12. "indent": "off"
  13. },
  14. parserOptions: {
  15. ecmaVersion: 2020,
  16. sourceType: 'module'
  17. },

同时废除多个规则

,号隔开

  1. // eslint-disable-next-line no-multi-assign,new-cap
  2. const widget = new (window as any).TradingView.widget({ ...config, datafeed })

禁用 min.js 报错

  1. 禁入导入报错
  2. 禁用文件报错
    1. // eslint-disable-next-line import/extensions
    2. import 'lib/charting_library/charting_library.min.js'
    1. /* eslint-disable */

    Eslint-prettier

    在 eslint 中重写 prettier
    1. rules: {
    2. 'prettier/prettier': [
    3. 'error',
    4. {
    5. endOfLine: 'auto',
    6. quoteProps: 'as-needed',
    7. },
    8. ],
    9. }