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

@n4bb12/config-tslint

v1.4.1

Published

Shareable TSLint configuration for my projects

Downloads

24

Readme

Install

yarn add --dev @n4bb12/config-tslint

Usage

Add the following to your TSLint config:

{
  "extends": "@n4bb12/config-tslint"
}

Thoughts

If the mere goal is consistency, any randomly chosen ruleset is equally good.

From a productivity and readability standpoint, however, different rule configurations can have varyling levels of potential positive and negative impact.

trailing-comma

{ "multiline": "always", "singleline": "never" }
  • Allows cloning the last line.
  • Allows exchanging the last line.
  • Allows deleting the last line.
  • Is auto-fixable, while a missing semicolon, after performing one of the above actions, is not.

semicolon

"never"
  • Semicolons are noise and don't add any value.
  • Non-semicolon snippets work both as statements and as parameters:
console.log()
events.subscribe(e => console.log(e)/* no disturbing semicolon here */)

quotemark

"double"
  • Double quotes are valid and commonly used in way more languages than single quotes.
  • Double quotes are easier to type on German keyboards.

linebreak-style

["LF"]
  • LF works well on all platforms.
  • CRLF in bash scripts will fail on non-Windows systems.

max-line-length

[80]
  • Easier to work with two columns / files side by side
  • Leaves enough space for tool windows like file tree, outline
  • Horizontal scrolling is tedious when you don't have a horizontal scroll wheel

object-literal-key-quotes

"consistent-as-needed"
  • Less typing is needed when keys are not quoted.
  • When quoting is however needed, consistency improves readability.

eofline

true
  • An extra empty line speeds up adding new code at the end.
  • When hitting Ctrl + End, the page in most cases only scrolls vertically.

indent

["spaces", 2]
  • Spaces look better on the Web.
  • Editor support is good enough to compete with tabs.
  • Two spaces seem to be the most common choice.

interface-name

"never-prefix"
  • Modern tools make it easy to determine the accurate type quickly, when needed. This makes type prefixes are a thing of the past.
  • Interfaces in TypeScript have a different semantic than in other languages, where the I prefix is commonly used on interfaces.
  • class, interface and type are often intersected or exchanged, depending on what needs to be achieved, so type names would need to be changed quite often, when they are prefixed with C, I or T.
  • Prefixes don't play well with acronyms.