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

parcel-plugin-tslint

v0.0.2

Published

A Parcel plugin for running tslint.

Downloads

7

Readme

parcel-plugin-tslint NPM version shield

A Parcel plugin for running tslint.

Screenshot showing parcel-plugin-tslint output

Install

# Ensure that you have peer dependencies installed first...
npm install --save parcel-bundler typescript tslint

# ...then install the plugin.
npm install --save-dev parcel-plugin-tslint

Usage

Create a tslint.json file, per the tslint configuration docs. You can customize how the linter output is displayed by adding a custom formatter setting to the linterOptions property. Example:

"linterOptions": {
    // See https://palantir.github.io/tslint/formatters/ for full list of formatters
    "formatter": "stylish"
}

To disable linting (e.g., while making a production bundle) run with the DISABLE_PARCEL_TSLINT_PLUGIN environment variable. Example:

// package.json
...
"script" {
  "bundle": "DISABLE_PARCEL_TSLINT_PLUGIN=true parcel build src/index.html"
}

Example

Clone this repo and run npm run testWatch or see the whole thing in action in your browser here: https://codesandbox.io/s/1ryv0o467

Release Notes

  • 0.0.1 WIP
  • 0.0.2 Fix for #3 (thanks @teroyks!), upgraded to Parcel 1.11.

Dependencies

Regular

  • strip-json-comments makes it easier to parse tslint.json (which can have comments).

Peer

parcel-plugin-tslint assumes that you're already bringing the following to the party:

  • parcel-bundler 1.x (tested with 1.11)
  • tslint 5.x (tested with 5.11)
  • typescript

Dev

  • @types/node allowed IDEs such as VSCode to be aware of Node's API (i.e., to support "intellisense" features for core Node objects such as 'fs').

Contributing

See CONTRIBUTING

Credits

TODO

  • Add a mocha test that uses the bundler output checker

  • Add to https://github.com/parcel-bundler/awesome-parcel

  • Mention in https://github.com/fathyb/parcel-plugin-typescript/issues/51#issuecomment-407219283

  • Do a better job of detecting and reporting error if/when tslint depdendency can't be found. Exmple output:

      $ npm run serve
    
    > [email protected] serve /Users/c/projects/@clinthharris/unstated-counter
    > parcel --no-cache --no-autoinstall -p 1234 src/index.html
    
    Server running at http://localhost:1234
    🚨  /Users/c/projects/@clinthharris/unstated-counter/src/index.tsx: Cannot resolve dependency './state/CounterState' at '/Users/c/projects/@clinthharris/unstated-counter/src/state/CounterState'
        at Function.Module._resolveFilename (module.js:548:15)
        at Function.Module._load (module.js:475:25)
        at Module.require (module.js:597:17)
        at require (/Users/c/projects/@clinthharris/unstated-counter/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
        at Object.<anonymous> (/Users/c/projects/@clinthharris/unstated-counter/node_modules/parcel-plugin-tslint/src/TslintAsset.js:2:16)

    The error says Cannot resolve dependency './state/CounterState' but it's actually coming from TslintAsset.js:2:16 which is require('tslint');