npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tslint-webpack-plugin

v2.1.1

Published

TSLint plugin for Webpack

Downloads

11,870

Readme

tslint-webpack-plugin

npm version license

NPM

Due to TSLint being deprecated, consider using/migrating to @typescript-eslint

This is a webpack plugin that provides a very simple method of running TSLint alongside your webpack builds. This project differs from tslint-loader in that it will lint all specified files instead of only those that are imported by webpack. This is especially useful for interface files that are not always picked up by webpack (due to treeshaking or whatever).

Installation

This plugin also requires TSLint to be installed.

Install the plugin with npm:

$ npm install tslint tslint-webpack-plugin --save-dev

Basic Usage

The plugin will output tslint errors as part of your webpack build process. It will not fail the build, but simply notify you of changes that need to be made. Just add the plugin to your webpack config as follows:

var TSLintPlugin = require('tslint-webpack-plugin');
var webpackConfig = {
  entry: 'index.js',
  output: {
    path: 'dist',
    filename: 'index_bundle.js'
  },
  plugins: [
    new TSLintPlugin({
      files: ['./src/**/*.ts']
    })
  ]
};

Configuration

You can pass a hash of configuration options to TSLintWebpackPlugin.

The basic configuration requires the one of the following:

  • files: string | string[] The files to run through the linter.

    • Examples
      • './src/**/*.ts'
      • ['./src/**/*.ts', './test/**/*.spec.ts']
      • './src/main.ts'
      • ['./src/main.ts', './test/main.spec.ts']
  • project: string Path to tsconfig.json

Use a custom tslint.json config

  • config: ./tslint.json

Disable console output if necessary:

  • silent: true

Add the errors and warnings to the webpack compilation result and stats and wait for the linter to finish. This is useful when you create production builds on your build server and you do not want that tslint errors will go to production. Do not set it to true when you use webpack-dev-server because usually incremental builds are much faster than linting for large projects.

  • waitForLinting: true

Treats all errors as warnings:

  • warningsAsError: true

The plugin uses a custom formatter by default, but any of the built-in TSLint formatters can be used. (Not supported by v2 and later)

For advanced usage, see the various runner options here.

License

This project is licensed under MIT.