@ember-template-lint/todo-utils
Advanced tools
Comparing version 10.0.0-beta.2 to 10.0.0-beta.3
@@ -0,1 +1,10 @@ | ||
## v10.0.0-beta.3 (2021-07-26) | ||
#### :rocket: Enhancement | ||
* [#270](https://github.com/ember-template-lint/ember-template-lint-todo-utils/pull/270) Adds new readTodoData API for convenience reading of TodoDataV2 ([@scalvert](https://github.com/scalvert)) | ||
#### Committers: 1 | ||
- Steve Calvert ([@scalvert](https://github.com/scalvert)) | ||
## v10.0.0-beta.2 (2021-07-23) | ||
@@ -2,0 +11,0 @@ |
import { LintMessage, LintResult, TodoConfig, TodoData, TodoDataV2 } from './types'; | ||
/** | ||
* Adapts a list of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32|LintResult} to a map of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L35|TodoFileHash}, {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. | ||
* Adapts an array of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31|LintResult} to a set of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2}. | ||
* | ||
* @param baseDir - The base directory that contains the .lint-todo storage directory. | ||
* @param lintResults - A list of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32|LintResult} objects to convert to {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} objects. | ||
* @param lintResults - An array of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31|LintResult} objects to convert to {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} objects. | ||
* @param todoConfig - An object containing the warn or error days, in integers. | ||
* @returns - A Promise resolving to a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set|Set} of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. | ||
* @returns - A Promise resolving to a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set|Set} of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2}. | ||
*/ | ||
export declare function buildTodoData(baseDir: string, lintResults: LintResult[], todoConfig?: TodoConfig): Set<TodoDataV2>; | ||
/** | ||
* Adapts an {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32|LintResult} to a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. FilePaths are absolute | ||
* Adapts a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31|LintResult} to a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2}. FilePaths are absolute | ||
* when received from a lint result, so they're converted to relative paths for stability in | ||
@@ -19,3 +19,3 @@ * serializing the contents to disc. | ||
* @param todoConfig - An object containing the warn or error days, in integers. | ||
* @returns - A {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* @returns - A {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
*/ | ||
@@ -22,0 +22,0 @@ export declare function buildTodoDatum(baseDir: string, lintResult: LintResult, lintMessage: LintMessage, todoConfig?: TodoConfig): TodoDataV2; |
@@ -11,8 +11,8 @@ "use strict"; | ||
/** | ||
* Adapts a list of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32|LintResult} to a map of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L35|TodoFileHash}, {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. | ||
* Adapts an array of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31|LintResult} to a set of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2}. | ||
* | ||
* @param baseDir - The base directory that contains the .lint-todo storage directory. | ||
* @param lintResults - A list of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32|LintResult} objects to convert to {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} objects. | ||
* @param lintResults - An array of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31|LintResult} objects to convert to {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} objects. | ||
* @param todoConfig - An object containing the warn or error days, in integers. | ||
* @returns - A Promise resolving to a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set|Set} of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. | ||
* @returns - A Promise resolving to a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set|Set} of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2}. | ||
*/ | ||
@@ -34,3 +34,3 @@ function buildTodoData(baseDir, lintResults, todoConfig) { | ||
/** | ||
* Adapts an {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32|LintResult} to a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. FilePaths are absolute | ||
* Adapts a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31|LintResult} to a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2}. FilePaths are absolute | ||
* when received from a lint result, so they're converted to relative paths for stability in | ||
@@ -42,3 +42,3 @@ * serializing the contents to disc. | ||
* @param todoConfig - An object containing the warn or error days, in integers. | ||
* @returns - A {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* @returns - A {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
*/ | ||
@@ -45,0 +45,0 @@ function buildTodoDatum(baseDir, lintResult, lintMessage, todoConfig) { |
export { buildTodoData, buildTodoDatum } from './builders'; | ||
export { applyTodoChanges, ensureTodoStorageDir, getTodoBatches, getTodoStorageDirPath, readTodos, readTodosForFilePath, todoStorageDirExists, todoDirFor, todoFileNameFor, todoFilePathFor, writeTodos, } from './io'; | ||
export { applyTodoChanges, ensureTodoStorageDir, getTodoBatches, getTodoStorageDirPath, readTodos, readTodosForFilePath, readTodoData, todoStorageDirExists, todoDirFor, todoFileNameFor, todoFilePathFor, writeTodos, } from './io'; | ||
export { getTodoConfig, validateConfig } from './todo-config'; | ||
@@ -4,0 +4,0 @@ export { getSeverity } from './get-severity'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isExpired = exports.getDatePart = exports.format = exports.differenceInDays = exports.getSeverity = exports.validateConfig = exports.getTodoConfig = exports.writeTodos = exports.todoFilePathFor = exports.todoFileNameFor = exports.todoDirFor = exports.todoStorageDirExists = exports.readTodosForFilePath = exports.readTodos = exports.getTodoStorageDirPath = exports.getTodoBatches = exports.ensureTodoStorageDir = exports.applyTodoChanges = exports.buildTodoDatum = exports.buildTodoData = void 0; | ||
exports.isExpired = exports.getDatePart = exports.format = exports.differenceInDays = exports.getSeverity = exports.validateConfig = exports.getTodoConfig = exports.writeTodos = exports.todoFilePathFor = exports.todoFileNameFor = exports.todoDirFor = exports.todoStorageDirExists = exports.readTodoData = exports.readTodosForFilePath = exports.readTodos = exports.getTodoStorageDirPath = exports.getTodoBatches = exports.ensureTodoStorageDir = exports.applyTodoChanges = exports.buildTodoDatum = exports.buildTodoData = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -15,2 +15,3 @@ var builders_1 = require("./builders"); | ||
Object.defineProperty(exports, "readTodosForFilePath", { enumerable: true, get: function () { return io_1.readTodosForFilePath; } }); | ||
Object.defineProperty(exports, "readTodoData", { enumerable: true, get: function () { return io_1.readTodoData; } }); | ||
Object.defineProperty(exports, "todoStorageDirExists", { enumerable: true, get: function () { return io_1.todoStorageDirExists; } }); | ||
@@ -17,0 +18,0 @@ Object.defineProperty(exports, "todoDirFor", { enumerable: true, get: function () { return io_1.todoDirFor; } }); |
@@ -30,3 +30,3 @@ import { TodoFileHash, LintResult, TodoDataV2, TodoBatchCounts, WriteTodoOptions, TodoFilePathHash, TodoBatches } from './types'; | ||
* @param todoData - The linting data for an individual violation. | ||
* @returns - The todo file path for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* @returns - The todo file path for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
*/ | ||
@@ -45,3 +45,3 @@ export declare function todoFilePathFor(todoData: TodoDataV2): string; | ||
* @param todoData - The linting data for an individual violation. | ||
* @returns - The todo file name for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* @returns - The todo file name for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
*/ | ||
@@ -66,3 +66,3 @@ export declare function todoFileNameFor(todoData: TodoDataV2): string; | ||
* @param baseDir - The base directory that contains the .lint-todo storage directory. | ||
* @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/index.ts#L51|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
* @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#L26|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
*/ | ||
@@ -75,6 +75,13 @@ export declare function readTodos(baseDir: string): Map<TodoFilePathHash, TodoMatcher>; | ||
* @param filePath - The relative file path of the file to return todo items for. | ||
* @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/index.ts#L51|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
* @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#L26|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
*/ | ||
export declare function readTodosForFilePath(baseDir: string, filePath: string): Map<TodoFilePathHash, TodoMatcher>; | ||
/** | ||
* Reads todo files in the .lint-todo directory and returns Todo data in an array. | ||
* | ||
* @param baseDir - The base directory that contains the .lint-todo storage directory. | ||
* @returns An array of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} | ||
*/ | ||
export declare function readTodoData(baseDir: string): TodoDataV2[]; | ||
/** | ||
* Gets 4 maps containing todo items to add, remove, those that are expired, or those that are stable (not to be modified). | ||
@@ -84,3 +91,3 @@ * | ||
* @param existing - Existing todo lint data. | ||
* @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/index.ts#L35|TodoFileHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. | ||
* @returns - An object of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L36|TodoBatches}. | ||
*/ | ||
@@ -87,0 +94,0 @@ export declare function getTodoBatches(baseDir: string, lintResults: LintResult[], existing: Map<TodoFilePathHash, TodoMatcher>, options: Partial<WriteTodoOptions>): TodoBatches; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.applyTodoChanges = exports.getTodoBatches = exports.readTodosForFilePath = exports.readTodos = exports.writeTodos = exports.todoFileNameFor = exports.todoDirFor = exports.todoFilePathFor = exports.getTodoStorageDirPath = exports.ensureTodoStorageDir = exports.todoStorageDirExists = void 0; | ||
exports.applyTodoChanges = exports.getTodoBatches = exports.readTodoData = exports.readTodosForFilePath = exports.readTodos = exports.writeTodos = exports.todoFileNameFor = exports.todoDirFor = exports.todoFilePathFor = exports.getTodoStorageDirPath = exports.ensureTodoStorageDir = exports.todoStorageDirExists = void 0; | ||
const tslib_1 = require("tslib"); | ||
@@ -49,3 +49,3 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ | ||
* @param todoData - The linting data for an individual violation. | ||
* @returns - The todo file path for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* @returns - The todo file path for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
*/ | ||
@@ -70,3 +70,3 @@ function todoFilePathFor(todoData) { | ||
* @param todoData - The linting data for an individual violation. | ||
* @returns - The todo file name for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* @returns - The todo file name for a {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
*/ | ||
@@ -105,3 +105,3 @@ function todoFileNameFor(todoData) { | ||
* @param baseDir - The base directory that contains the .lint-todo storage directory. | ||
* @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/index.ts#L51|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
* @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#L26|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
*/ | ||
@@ -131,3 +131,3 @@ function readTodos(baseDir) { | ||
* @param filePath - The relative file path of the file to return todo items for. | ||
* @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/index.ts#L51|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
* @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#L26|TodoFilePathHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4|TodoMatcher}. | ||
*/ | ||
@@ -160,2 +160,14 @@ function readTodosForFilePath(baseDir, filePath) { | ||
/** | ||
* Reads todo files in the .lint-todo directory and returns Todo data in an array. | ||
* | ||
* @param baseDir - The base directory that contains the .lint-todo storage directory. | ||
* @returns An array of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} | ||
*/ | ||
function readTodoData(baseDir) { | ||
return [...readTodos(baseDir).values()].reduce((matcherResults, matcher) => { | ||
return [...matcherResults, ...matcher.unprocessed]; | ||
}, []); | ||
} | ||
exports.readTodoData = readTodoData; | ||
/** | ||
* Gets 4 maps containing todo items to add, remove, those that are expired, or those that are stable (not to be modified). | ||
@@ -165,3 +177,3 @@ * | ||
* @param existing - Existing todo lint data. | ||
* @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/index.ts#L35|TodoFileHash}/{@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData}. | ||
* @returns - An object of {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L36|TodoBatches}. | ||
*/ | ||
@@ -168,0 +180,0 @@ function getTodoBatches(baseDir, lintResults, existing, options) { |
@@ -17,3 +17,3 @@ import TodoMatcher from './todo-matcher'; | ||
/** | ||
* Matches todos to their associated {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* Matches todos to their associated {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
* | ||
@@ -20,0 +20,0 @@ * The matching algorithm uses the following logic: |
@@ -21,3 +21,3 @@ "use strict"; | ||
/** | ||
* Matches todos to their associated {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36|TodoData} object. | ||
* Matches todos to their associated {@link https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61|TodoDataV2} object. | ||
* | ||
@@ -24,0 +24,0 @@ * The matching algorithm uses the following logic: |
import { TodoDataV2, TodoFilePathHash } from './types'; | ||
export default class TodoMatcher { | ||
private unprocessed; | ||
unprocessed: Set<TodoDataV2>; | ||
constructor(); | ||
@@ -5,0 +5,0 @@ unmatched(predicate?: (todoDatum: TodoDataV2) => boolean): Map<TodoFilePathHash, TodoDataV2>; |
{ | ||
"name": "@ember-template-lint/todo-utils", | ||
"version": "10.0.0-beta.2", | ||
"version": "10.0.0-beta.3", | ||
"repository": "https://github.com/ember-template-lint/ember-template-lint-todo-utils.git", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -21,6 +21,6 @@ # @ember-template-lint/todo-utils | ||
<dt><a href="#buildTodoData">buildTodoData(baseDir, lintResults, todoConfig)</a> ⇒</dt> | ||
<dd><p>Adapts a list of <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32">LintResult</a> to a map of <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L35">TodoFileHash</a>, <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36">TodoData</a>.</p> | ||
<dd><p>Adapts an array of <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31">LintResult</a> to a set of <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61">TodoDataV2</a>.</p> | ||
</dd> | ||
<dt><a href="#buildTodoDatum">buildTodoDatum(lintResult, lintMessage, todoConfig)</a> ⇒</dt> | ||
<dd><p>Adapts an <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32">LintResult</a> to a <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36">TodoData</a>. FilePaths are absolute | ||
<dd><p>Adapts a <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31">LintResult</a> to a <a href="https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61">TodoDataV2</a>. FilePaths are absolute | ||
when received from a lint result, so they're converted to relative paths for stability in | ||
@@ -58,2 +58,5 @@ serializing the contents to disc.</p> | ||
</dd> | ||
<dt><a href="#readTodoData">readTodoData(baseDir)</a> ⇒</dt> | ||
<dd><p>Reads todo files in the .lint-todo directory and returns Todo data in an array.</p> | ||
</dd> | ||
<dt><a href="#getTodoBatches">getTodoBatches(lintResults, existing)</a> ⇒</dt> | ||
@@ -93,6 +96,6 @@ <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> | ||
## buildTodoData(baseDir, lintResults, todoConfig) ⇒ | ||
Adapts a list of [LintResult](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32) to a map of [TodoFileHash](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L35), [TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36). | ||
Adapts an array of [LintResult](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31) to a set of [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61). | ||
**Kind**: global function | ||
**Returns**: - A Promise resolving to a [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) of [TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36). | ||
**Returns**: - A Promise resolving to a [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set) of [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61). | ||
@@ -102,3 +105,3 @@ | Param | Description | | ||
| baseDir | The base directory that contains the .lint-todo storage directory. | | ||
| lintResults | A list of [LintResult](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32) objects to convert to [TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36) objects. | | ||
| lintResults | An array of [LintResult](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31) objects to convert to [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61) objects. | | ||
| todoConfig | An object containing the warn or error days, in integers. | | ||
@@ -109,3 +112,3 @@ | ||
## buildTodoDatum(lintResult, lintMessage, todoConfig) ⇒ | ||
Adapts an [LintResult](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L32) to a [TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36). FilePaths are absolute | ||
Adapts a [LintResult](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/lint.ts#L31) to a [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61). FilePaths are absolute | ||
when received from a lint result, so they're converted to relative paths for stability in | ||
@@ -115,3 +118,3 @@ serializing the contents to disc. | ||
**Kind**: global function | ||
**Returns**: - A [TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36) object. | ||
**Returns**: - A [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61) object. | ||
@@ -164,3 +167,3 @@ | Param | Description | | ||
**Kind**: global function | ||
**Returns**: - The todo file path for a [TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36) object. | ||
**Returns**: - The todo file path for a [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61) object. | ||
@@ -194,3 +197,3 @@ | Param | Description | | ||
**Kind**: global function | ||
**Returns**: - The todo file name for a [TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36) object. | ||
**Returns**: - The todo file name for a [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61) object. | ||
@@ -225,3 +228,3 @@ | Param | Description | | ||
**Kind**: global function | ||
**Returns**: - A [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) of [TodoFilePathHash](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L51)/[TodoMatcher](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4). | ||
**Returns**: - A [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) of [TodoFilePathHash](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L26)/[TodoMatcher](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4). | ||
@@ -238,3 +241,3 @@ | Param | Description | | ||
**Kind**: global function | ||
**Returns**: - A [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) of [TodoFilePathHash](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L51)/[TodoMatcher](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4). | ||
**Returns**: - A [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) of [TodoFilePathHash](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L26)/[TodoMatcher](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/todo-matcher.ts#L4). | ||
@@ -246,2 +249,14 @@ | Param | Description | | ||
<a name="readTodoData"></a> | ||
## readTodoData(baseDir) ⇒ | ||
Reads todo files in the .lint-todo directory and returns Todo data in an array. | ||
**Kind**: global function | ||
**Returns**: An array of [TodoDataV2](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L61) | ||
| Param | Description | | ||
| --- | --- | | ||
| baseDir | The base directory that contains the .lint-todo storage directory. | | ||
<a name="getTodoBatches"></a> | ||
@@ -253,3 +268,3 @@ | ||
**Kind**: global function | ||
**Returns**: - A [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) of [TodoFileHash](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L35)/[TodoData](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/index.ts#L36). | ||
**Returns**: - An object of [TodoBatches](https://github.com/ember-template-lint/ember-template-lint-todo-utils/blob/master/src/types/todo.ts#L36). | ||
@@ -256,0 +271,0 @@ | Param | Description | |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119130
1283
409