caroundsky / QA

0 stars 0 forks source link

eslint/tslint 相关 #9

Open caroundsky opened 1 year ago

caroundsky commented 1 year ago

Eslint

忽略检查

/* eslint-disable */
/* eslint-disable-next-line */

报错 xxx cr xxx

// .prettierrc
endOfLine: 'auto'

// .eslintrc.js
rules: {
  "prettier/prettier": [
    "error",
    {
      "endOfLine": "auto"
    },
  ],
}

解决未定义报错

'no-unused-vars': 'off'

Warning about Missing Return Type of function

// .eslintrc.js
rules: {
  "@typescript-eslint/explicit-module-boundary-types": "off"
}

warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any

// .eslintrc.js
rules: {
  '"@typescript-eslint/no-explicit-any": "off"
}

Ts

parameter implicitly has an 'any' type

// tsconfig.json
"noImplicitAny": false