This repository contains lint rules tailored for use with TodoHub, a GitHub Action designed to help you manage todos in your codebase by linking them to GitHub issues.
The lint rules provided here are run standalone - linking todos to issues without tracking them tent to be error prone so. This is where todohub comes into place. You can find detailed instructions on how to set up TodoHub in the TodoHub GitHub repository.
Once TodoHub is set up in your project, you can integrate these lint rules by adding them to your linting configuration.
Currently, the lint rules in this repository are supported by the following linters:
- ESLint
- TSLint
To integrate these lint rules with ESLint, follow these steps:
-
Install the
eslint-plugin-todohub
package:npm install eslint-plugin-todohub --save-dev
-
Update your ESLint configuration (
.eslintrc.js
or.eslintrc.json
) to include thetodohub/no-todos-without-issue-ref
rule:{ "plugins": ["todohub"], "rules": { "todohub/no-todos-without-issue-ref": "error" } }
To integrate these lint rules with TSLint, follow these steps:
-
Install the
tslint-plugin-todohub
package:npm install tslint-plugin-todohub --save-dev
-
Update your TSLint configuration (
tslint.json
) to include thetodohub/no-todos-without-issue-ref
rule:{ "rulesDirectory": ["tslint-plugin-todohub"], "rules": { "no-todos-without-issue-ref": true } }
This rule checks the codebase for todos that do not have an associated issue marker.
This rule, if your branches are named in the format {issue_number}-issue-title
, warns for todos referencing the todos of the branch you have currently checked out.
Contributions to improve or extend these lint rules are welcome! Please follow the Contribution Guidelines when submitting pull requests.
This project is licensed under the MIT License.