Skip to content

Commit

Permalink
Fixing jsdoc for new APIs (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
scalvert authored Dec 3, 2021
1 parent dfb4521 commit 9a04fd7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 18 deletions.
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ hash to identify each.</p>
<p>Given a list of todo lint violations, this function will also delete existing files that no longer
have a todo lint violation.</p>
</dd>
<dt><a href="#readTodos">readTodos(baseDir)</a> ⇒</dt>
<dt><a href="#readTodos">readTodos(baseDir, shouldLock)</a> ⇒</dt>
<dd><p>Reads all todo files in the .lint-todo directory.</p>
</dd>
<dt><a href="#readTodosForFilePath">readTodosForFilePath(todoStorageDir, filePath)</a> ⇒</dt>
<dt><a href="#readTodosForFilePath">readTodosForFilePath(todoStorageDir, filePath, shouldLock)</a> ⇒</dt>
<dd><p>Reads todo files in the .lint-todo directory for a specific filePath.</p>
</dd>
<dt><a href="#readTodoData">readTodoData(baseDir)</a> ⇒</dt>
Expand All @@ -59,7 +59,7 @@ have a todo lint violation.</p>
<dt><a href="#getTodoBatches">getTodoBatches(maybeTodos, existing, options)</a> ⇒</dt>
<dd><p>Gets 4 maps containing todo items to add, remove, those that are expired, or those that are stable (not to be modified).</p>
</dd>
<dt><a href="#applyTodoChanges">applyTodoChanges(baseDir, add, remove, options)</a></dt>
<dt><a href="#applyTodoChanges">applyTodoChanges(baseDir, add, remove, shouldLock)</a></dt>
<dd><p>Applies todo changes, either adding or removing, based on batches from <code>getTodoBatches</code>.</p>
</dd>
<dt><a href="#ADD_OPERATIONS_ONLY">ADD_OPERATIONS_ONLY(operation)</a> ⇒</dt>
Expand All @@ -68,7 +68,7 @@ have a todo lint violation.</p>
<dt><a href="#EXCLUDE_EXPIRED">EXCLUDE_EXPIRED(operation)</a> ⇒</dt>
<dd><p>Compact strategy to remove all expired operations from the todo storage file.</p>
</dd>
<dt><a href="#compactTodoStorageFile">compactTodoStorageFile(baseDir, compactStrategy)</a></dt>
<dt><a href="#compactTodoStorageFile">compactTodoStorageFile(baseDir, compactStrategy)</a></dt>
<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>
Expand Down Expand Up @@ -214,19 +214,20 @@ have a todo lint violation.

<a name="readTodos"></a>

## readTodos(baseDir) ⇒
## readTodos(baseDir, shouldLock) ⇒
Reads all todo files in the .lint-todo directory.

**Kind**: global function
**Returns**: - A [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) of [FilePath](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L25)/[TodoMatcher](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4).

| Param | Description |
| --- | --- |
| baseDir | The base directory that contains the .lint-todo storage directory. |
| Param | Default | Description |
| --- | --- | --- |
| baseDir | | The base directory that contains the .lint-todo storage directory. |
| shouldLock | <code>true</code> | True if the .lint-todo storage file should be locked, otherwise false. Default: true. |

<a name="readTodosForFilePath"></a>

## readTodosForFilePath(todoStorageDir, filePath) ⇒
## readTodosForFilePath(todoStorageDir, filePath, shouldLock) ⇒
Reads todo files in the .lint-todo directory for a specific filePath.

**Kind**: global function
Expand All @@ -236,6 +237,7 @@ Reads todo files in the .lint-todo directory for a specific filePath.
| --- | --- |
| todoStorageDir | The .lint-todo storage directory. |
| filePath | The relative file path of the file to return todo items for. |
| shouldLock | True if the .lint-todo storage file should be locked, otherwise false. Default: true. |

<a name="readTodoData"></a>

Expand Down Expand Up @@ -265,17 +267,17 @@ Gets 4 maps containing todo items to add, remove, those that are expired, or tho

<a name="applyTodoChanges"></a>

## applyTodoChanges(baseDir, add, remove, options)
## applyTodoChanges(baseDir, add, remove, shouldLock)
Applies todo changes, either adding or removing, based on batches from `getTodoBatches`.

**Kind**: global function

| Param | Description |
| --- | --- |
| baseDir | The base directory that contains the .lint-todo storage directory. |
| add | Batch of todos to add. |
| remove | Batch of todos to remove. |
| options | An object containing write options. |
| Param | Default | Description |
| --- | --- | --- |
| baseDir | | The base directory that contains the .lint-todo storage directory. |
| add | | Batch of todos to add. |
| remove | | Batch of todos to remove. |
| shouldLock | <code>true</code> | True if the .lint-todo storage file should be locked, otherwise false. Default: true. |

<a name="ADD_OPERATIONS_ONLY"></a>

Expand Down Expand Up @@ -303,10 +305,11 @@ Compact strategy to remove all expired operations from the todo storage file.

<a name="compactTodoStorageFile"></a>

## compactTodoStorageFile(baseDir, compactStrategy)
## compactTodoStorageFile(baseDir, compactStrategy)
Compacts the .lint-todo storage file based on the compact strategy.

**Kind**: global function
**Returns**: The count of compacted todos.

| Param | Description |
| --- | --- |
Expand Down
4 changes: 3 additions & 1 deletion src/io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export function writeTodos(
* Reads all todo files in the .lint-todo directory.
*
* @param baseDir - The base directory that contains the .lint-todo storage directory.
* @param shouldLock - True if the .lint-todo storage file should be locked, otherwise false. Default: true.
* @returns - A {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map|Map} of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L25|FilePath}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}.
*/
export function readTodos(baseDir: string, shouldLock = true): Map<FilePath, TodoMatcher> {
Expand All @@ -181,6 +182,7 @@ export function readTodos(baseDir: string, shouldLock = true): Map<FilePath, Tod
*
* @param todoStorageDir - The .lint-todo storage directory.
* @param filePath - The relative file path of the file to return todo items for.
* @param shouldLock - True if the .lint-todo storage file should be locked, otherwise false. Default: true.
* @returns - A {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map|Map} of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L25|FilePath}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}.
*/
export function readTodosForFilePath(
Expand Down Expand Up @@ -232,7 +234,7 @@ export function getTodoBatches(
* @param baseDir - The base directory that contains the .lint-todo storage directory.
* @param add - Batch of todos to add.
* @param remove - Batch of todos to remove.
* @param options - An object containing write options.
* @param shouldLock - True if the .lint-todo storage file should be locked, otherwise false. Default: true.
*/
export function applyTodoChanges(
baseDir: string,
Expand Down

0 comments on commit 9a04fd7

Please sign in to comment.