Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ember-template-lint/todo-utils

Package Overview
Dependencies
Maintainers
4
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ember-template-lint/todo-utils

![CI Build](https://github.com/ember-template-lint/ember-template-lint-todo-utils/workflows/CI%20Build/badge.svg) [![License](https://img.shields.io/npm/l/@checkup/cli.svg)](https://github.com/checkupjs/checkup/blob/master/package.json) ![Dependabot](http

  • 3.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
increased by9.24%
Maintainers
4
Weekly downloads
 
Created
Source

@ember-template-lint/todo-utils

CI Build License Dependabot Volta Managed TypeScript Code Style: prettier

A collection of utilities to generate and store lint item metadata.

Those utilities are:

buildTodoData(lintResults)

Adapts a list of ESLint.LintResult or TemplateLintResult to a map of FilePath, TodoData.

ensureTodoDir(baseDir)

Creates, or ensures the creation of, the .lint-todo directory.

getTodoStorageDirPath(baseDir)
todoFilePathFor(todoData)

Creates a file path from the linting data. Excludes extension.

todoDirFor(filePath)

Creates a short hash for the todo's file path.

todoFileNameFor(todoData)

Generates a unique filename for a todo lint data.

writeTodos(baseDir, lintResults, filePath?)

Writes files for todo lint violations. One file is generated for each violation, using a generated hash to identify each.

Given a list of todo lint violations, this function will also delete existing files that no longer have a todo lint violation.

readTodos(todoStorageDir, filePath?)

Reads all todo files in the .lint-todo directory.

getTodoBatches(lintResults, existing)

Gets 3 maps containing todo items to add, remove, or those that are stable (not to be modified).

applyTodoChanges(todoStorageDir, add, remove)

Applies todo changes, either adding or removing, based on batches from `getTodoBatches`.

buildTodoData(lintResults)

Adapts a list of ESLint.LintResult or TemplateLintResult to a map of FilePath, TodoData.

Kind: global function

ParamTypeDescription
lintResultsLintResultA list of objects to convert to {TodoData} objects.

ensureTodoDir(baseDir)

Creates, or ensures the creation of, the .lint-todo directory.

Kind: global function

ParamDescription
baseDirThe base directory that contains the .lint-todo storage directory.

getTodoStorageDirPath(baseDir)

Kind: global function

ParamDescription
baseDirThe base directory that contains the .lint-todo storage directory.

todoFilePathFor(todoData)

Creates a file path from the linting data. Excludes extension.

Kind: global function

ParamDescription
todoDataThe linting data for an individual violation.

Example

42b8532cff6da75c5e5895a6f33522bf37418d0c/6e3be839

todoDirFor(filePath)

Creates a short hash for the todo's file path.

Kind: global function

ParamDescription
filePathThe filePath from linting data for an individual violation.

todoFileNameFor(todoData)

Generates a unique filename for a todo lint data.

Kind: global function

ParamDescription
todoDataThe linting data for an individual violation.

writeTodos(baseDir, lintResults, filePath?)

Writes files for todo lint violations. One file is generated for each violation, using a generated hash to identify each.

Given a list of todo lint violations, this function will also delete existing files that no longer have a todo lint violation.

Kind: global function

ParamDescription
baseDirThe base directory that contains the .lint-todo storage directory.
lintResultsThe raw linting data.
filePath?The absolute file path of the file to update violations for.

readTodos(todoStorageDir, filePath?)

Reads all todo files in the .lint-todo directory.

Kind: global function

ParamDescription
todoStorageDirThe .lint-todo storage directory.
filePath?The absolute file path of the file to return todo items for.

getTodoBatches(lintResults, existing)

Gets 3 maps containing todo items to add, remove, or those that are stable (not to be modified).

Kind: global function

ParamDescription
lintResultsThe linting data for all violations.
existingExisting todo lint data.

FAQs

Package last updated on 17 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc