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

@jsdevtools/tslint-modular

v2.0.7

Published

Modular TSLint configuration

Downloads

81

Readme

Modular TSLint Configuration

Cross-Platform Compatibility Build Status

Coverage Status Dependencies

npm License Buy us a tree

TSLint Modular is a set of configuration presets for TSLint that's broken-up into different modules that can be mixed-and-matched to match the needs of your project.

Each module defines rules that are meant to be reasonable defaults and best practices, but you can easily extend or override any of the rules to suit your needs.

Related Projects

Installation

Run the following npm command to install TSLint and @jsdevtools/tslint-modular as dev-dependencies of your project:

npm install tslint @jsdevtools/tslint-modular --save-dev

Usage

Configuration presets are designed to work with the extends feature of tslint.yaml files. You can learn more about configuration presets on the official TSLint website.

To use TSLint Modular in your project, create a tslint.yaml file with the following contents:

tslint.yaml

extends:
  # These modules would be good for a library that runs in Node.js and web browsers
  - "@jsdevtools/tslint-modular/best-practices"
  - "@jsdevtools/tslint-modular/style"
  - "@jsdevtools/tslint-modular/node"
  - "@jsdevtools/tslint-modular/browser"

rules:
  # You can override or extend the rules here

Modules

TSLint Modular includes the following modules. Mix-and-match them as applicable to your project.

@jsdevtools/tslint-modular/best-practices (source)

Contains rules that prevent accidental bugs, insecure code, and bad coding practices. You can use this module directly, or use any/all of its sub-modules.

@jsdevtools/tslint-modular/best-practices/bugs (source)

Prevents syntax that is likely to lead to accidental bugs or runtime errors. Examples include not duplicate variables, and using === instead of == for comparisons. Most of the rules in this file will raise an error if violated, but some less-severe ones will only raise warnings.

@jsdevtools/tslint-modular/best-practices/maintainability (source)

Helps you write code that is more maintainable over time and by multiple people. For example, limiting cyclomatic complexity and keeping files short.

@jsdevtools/tslint-modular/best-practices/security (source)

Helps enforce security best-practices such as avoiding the eval() statement and not calling the Function constructor.

@jsdevtools/tslint-modular/browser (source)

Bans bad practices for web-based code, such as the alert() statement and the jQuery global.

@jsdevtools/tslint-modular/node (source)

Discourages deprecated and outdated Node.js code, such as fs.exists(). It encourages using more modern syntax, such as the fs.promises API.

@jsdevtools/tslint-modular/style (source)

Contains code-styling and consistency rules. You can use this module directly, or use any/all of its sub-modules.

@jsdevtools/tslint-modular/style/comments (source)

Code-commenting rules, such as documenting all public members, using JSDoc format, and not duplicating type information in comments.

@jsdevtools/tslint-modular/style/conventions (source)

Enforces an opinionated set of conventions, such as using double-quotes and semi-colons.

@jsdevtools/tslint-modular/style/naming (source)

Encourages good JavaScript naming conventions, such as camel-case variables and capitialized classes.

@jsdevtools/tslint-modular/style/syntax (source)

Disallows outdated, nonstandard, and confusing syntax. Examples include labels, the comma operator, and parameter properties.

@jsdevtools/tslint-modular/style/whitespace (source)

Enforces opinionated whitespace rules, such as two-space indentation, opening braces on the same line, and type definition spacing.

@jsdevtools/tslint-modular/test (source)

Warns about describe.only() and it.only() calls that may have accidentally been left in your test code.

Note: We recommend that you create a separate tslint.yaml file in your test folder. That way, it can use different modules and rules than the rest of your codebase.

License

TSLint Modular is 100% free and open-source, under the MIT license. Use it however you want.

This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.

Big Thanks To

Thanks to these awesome companies for their support of Open Source developers ❤

Travis CI SauceLabs Coveralls