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

@hong97/tslint

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hong97/tslint

**Work with [lint-staged](https://github.com/lint-staged/lint-staged), run tsc on staged files and output the result of staged-only files.**

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Work with lint-staged, run tsc on staged files and output the result of staged-only files.

⚠️ ONLY TESTED ON TYPESCRIPT 5

Setup

  • Install lint-staged, follow the instructions.

  • Install tslint, use:

    npm i -D @hong97/tslint
    
  • In package.json, add tslint to *.ts, *.tsx files.

    "lint-staged": {
      "*.{ts,tsx}": [
        "tslint"
      ]
    },
    
  • Use Husky or other methods to set up your git 'pre-commit' hooks.

  • Now, TypeScript will be checked at commit staged.

Configuration

Create a file named tslintconfig.js in your root directory:

module.exports = {
  alwaysInclude: [
    // always included in tsc process no matter these files are staged or not
  ],
  ignore: [
    // use glob pattern, see more: https://www.npmjs.com/package/minimatch
  ],
};

You can also set up a callback hook in config file:

module.exports = {
  onFinish: (result) => {
    // ...
  } 
};

The callback will be invoked after tslint finish running and the results will be passed through.

FAQs

Package last updated on 20 Nov 2023

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