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

@airhelp/ts-utils-lint

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@airhelp/ts-utils-lint

A single command to lint TypeScript files of your app.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
3
Weekly downloads
 
Created
Source

@airhelp/ts-utils-lint

ts-utils-lint wraps ESLint/Prettier-related packages and exposes a single command to lint TypeScript files under src directory of your application respecting its .eslintrc and .prettierrc files.

Setup

./a-lib ➜ yarn add --dev @airhelp/ts-utils-lint
// a-lib/package.json
{
  "scripts": {
    "lint": "ts-utils-lint"
  }
}

How it works

ts-utils-lint is a simple wrapper around CLIEngine API exposed by ESLint. Given lib-a directory, executing ts-utils-lint inside means going through the following steps:

  1. Read .eslintrc configuration in lib-a
  2. Set ts-utils-lint as a current working directory for ESLint in order to resolve the dependencies (namely, ESLint plugins) correctly.
  3. Lint all TypeScript files under lib-a/src directory.
  4. Fix errors automatically and print the report.

Roadmap

ts-utils-lint is meant to always be a single command to lint TypeScript files respecting .eslintrc and .prettierrc files of your application. It means that in terms of features not much is going to change. What we would like to improve in the upcoming releases though, is its configurability. For instance:

  • custom pattern for files to be linted,
  • a --ci flag to skip automatic fixes and return with a non-zero code in case of errors

Code editors integration

Please, make sure to setup your code editor so that you get instant feedback and auto fixes when you code. Too long line or unused variable errors making you CI pipeline red and being the very last thing preventing you from an important release suck. Don't go that way!

VSCode

  1. Install ESLint (dbaeumer.vscode-eslint) extension.

  2. View > Command Pallette... (⇧ + ⌘ + P)

  3. Go to > Preferences: Open Settings (JSON)

  4. Append the following configuration:

    {
      "files.autoSave": "onFocusChange", // not required, although highly recommended
      "eslint.autoFixOnSave": true,
      "eslint.validate": [
        {"language": "typescript", "autoFix": true },
        {"language": "typescriptreact", "autoFix": true }
    ]
    }
    

WebStorm

To do

Sublime Text

To do

Contributing

To do

License

MIT

FAQs

Package last updated on 07 Aug 2019

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