1.1.1 • Published 5 years ago

eslint-plugin-todo-ddl v1.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

eslint-plugin-todo-ddl

检查代码中的TODO注释是否到期或者将要到期

show

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-todo-ddl:

$ npm install eslint-plugin-todo-ddl --save-dev

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

Usage

Add todo-ddl to the plugins section of your .eslintrc configuration file or package.json. You can omit the eslint-plugin- prefix:

package.json demo

"eslintConfig": {
    "plugins": [
      "todo-ddl"
    ],
    "rules": {
      "todo-ddl/diy":1
    }
}

After the configuration is complete, you can see the prompts when coding and building

Formats that can be detected

// TODO: DDL 2020-4-28 提示自己的内容
// fixme: DDL 2020/4/28 提示自己的内容
// TODO: deadline 20200428 提示自己的内容
// fixme: deadline 20-4-28 提示自己的内容

or

/**
* TODO
* DDL 2020-5-19
* 提示自己的内容
*/

support date formats

For example, June 1, 2020 --- 2020-06-01

format1demoformat2demoformat3demo
yyyy-mm-dd2020-06-01yyyy/mm/dd2020/06/01yyyymmdd20200601
2020-06-12020/06/1200601
2020-6-012020/6/01
20-06-0120/06/01
20-6-120/6/1
20-6-0120/6/01

customize

You can customize the detected keywords

keytypecomment
flagstring[]The beginning of the detected comment
ddlstring[]The effective time of the detected comment
warnlinestringwarnline

default value

"rules": {
    "todo-ddl/diy":[1,{
      "flag": ["todo","fixme"],
      "ddl":  ["ddl","deadline"],
      "warnline": "7"
    }]
}