eslint-plugin-tachecker

0.0.10 • Public • Published

eslint-plugin-tachecker

"TA 埋点框架规则检验"

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-tachecker:

$ npm install eslint-plugin-tachecker --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-tachecker globally.

Configuration

You should also specify settings that will be shared across all the plugin rules. (More about eslint shared settings)

"settings": {
    "tachecker": {
        "pragmas": ["TA", "TAComponents"],
        "checkedComponents": ["Modal", {"name": "Switch", "funcName": "onValueChange"}],
        "taComponents": []  
    }
}

key 说明: pragmas 用于指定导入的 TA 组件源文件; checkedComponents 指定需要检测是否有taName属性的组件,数组元素可以是字符串,也可以是对象,如果是字符串则默认处理函数是onPresstaComponents 指定要检测taName的 TA 组件,格式和 checkedComponents 相同

Usage

Add tachecker to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "tachecker"
    ]
}

Then configure the rules you want to use under the rules section.

{
    "rules": {
        "tachecker/exist-taname-checker": 1,
        "tachecker/valid-taname-checker": 1,
        "tachecker/force-import-ta-component": 1,
        "tachecker/ref-checker": 1
    }
}

Supported Rule

Package Sidebar

Install

npm i eslint-plugin-tachecker

Weekly Downloads

1

Version

0.0.10

License

MIT

Unpacked Size

32.3 kB

Total Files

13

Last publish

Collaborators

  • linshaolie