简体   繁体   中英

ESLint: ignore warning rules

The typescript files are filled with warning symbols and I am trying to ignore the following rules inside the .eslintrc.json file:

  1. I want to allow the any type
  2. I want to ignore setting void behind functions that are not returning anything.

These are the corresponding warnings:

  1. Argument 'myArgument' should be typed.eslint@typescript-eslint/explicit-module- boundary-types
  2. Missing return type on function.eslint@typescript-eslint/explicit-module-boundary-types

Is there a way to ignore these rules and make the warning disappear?

For any , you can use "no-explicit-any":false

For void , you can use "no-void": false

For your other warnings, the eslint rule is explicit-module-boundary-types

You probably need

 "@typescript-eslint/explicit-module-boundary-types": "off"

see

Stop typescript-eslint/explicit-module-boundary-types to be applied on vue component not using Typescript

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM