Skip to content

Commit

Permalink
docs: Updating docs for todo config
Browse files Browse the repository at this point in the history
  • Loading branch information
scalvert committed Dec 14, 2021
1 parent e34aca0 commit 32f08d9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ have a todo lint violation.</p>
<dd><p>Compacts the .lint-todo storage file based on the compact strategy.</p>
</dd>
<dt><a href="#getTodoConfig">getTodoConfig(baseDir, engine, customDaysToDecay)</a> ⇒</dt>
<dd><p>Gets the todo configuration.
Config values can be present in</p>
<p>The package.json</p>
<dd><p>Gets the todo configuration from one of a number of locations.</p>
</dd>
<dt><a href="#validateConfig">validateConfig(baseDir)</a> ⇒</dt>
<dd><p>Validates whether we have a unique config in a single location.</p>
Expand Down Expand Up @@ -338,10 +336,7 @@ Compacts the .lint-todo storage file based on the compact strategy.
<a name="getTodoConfig"></a>

## getTodoConfig(baseDir, engine, customDaysToDecay) ⇒
Gets the todo configuration.
Config values can be present in

The package.json
Gets the todo configuration from one of a number of locations.

**Kind**: global function
**Returns**: - The todo config object.
Expand All @@ -353,6 +348,7 @@ The package.json
| customDaysToDecay | The optional custom days to decay configuration. |

**Example**
Using the package.json
```json
{
"lintTodo": {
Expand All @@ -368,9 +364,8 @@ The package.json
}
}
```

A .lint-todorc.js file
**Example**
Using the .lint-todorc.js file
```js
module.exports = {
"some-engine": {
Expand All @@ -384,12 +379,16 @@ module.exports = {
}
}
```

Environment variables (`TODO_DAYS_TO_WARN` or `TODO_DAYS_TO_ERROR`)
**Example**
```js
Using environment variables (`TODO_DAYS_TO_WARN` or `TODO_DAYS_TO_ERROR`)
- Env vars override package.json config

```
**Example**
```js
Passed in directly, such as from command line options.
- Passed in options override both env vars and package.json config
```
<a name="validateConfig"></a>

## validateConfig(baseDir) ⇒
Expand Down
13 changes: 6 additions & 7 deletions src/todo-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ type ConfigValidationResult = {
};

/**
* Gets the todo configuration.
* Config values can be present in
*
* The package.json
* Gets the todo configuration from one of a number of locations.
*
* @example
* Using the package.json
* ```json
* {
* "lintTodo": {
Expand All @@ -31,9 +29,8 @@ type ConfigValidationResult = {
* }
* ```
*
* A .lint-todorc.js file
*
* @example
* Using the .lint-todorc.js file
* ```js
* module.exports = {
* "some-engine": {
Expand All @@ -48,9 +45,11 @@ type ConfigValidationResult = {
* }
* ```
*
* Environment variables (`TODO_DAYS_TO_WARN` or `TODO_DAYS_TO_ERROR`)
* @example
* Using environment variables (`TODO_DAYS_TO_WARN` or `TODO_DAYS_TO_ERROR`)
* - Env vars override package.json config
*
* @example
* Passed in directly, such as from command line options.
* - Passed in options override both env vars and package.json config
*
Expand Down

0 comments on commit 32f08d9

Please sign in to comment.