setData时,对传入参数进行有无可选链用法判断
You'll first need to install ESLint:
$ npm i eslint --save-dev
Next, install eslint-plugin-null
:
$ npm install eslint-plugin-optional-chaining-check --save-dev
Add optional-chaining-check
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"optional-chaining-check"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"optional-chaining-check/rule-name": 2
}
}
- Fill in provided rules here