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

@putstack/eslint-config-typescript

v3.10.0

Published

ESLint config for TypeScript

Downloads

471

Readme

An ESLint configuration by Putro

This ESLint setup should let any new (or existing) projects adhere to best practices within TypeScript and write fewer bugs as a result! The default version is quite strict, so an existing project might opt for using the base version, see more under Usage.

The latest version (v3 and up) is using the new flat configuration from eslint and eslint v9. If you are not ready for this change, please stick with 2.6.1 or below.

Installation

To install this package run the following command in the terminal in the root directory of your application.

pnpm install -D @putstack/eslint-config-typescript

OR

npm install --save-dev @putstack/eslint-config-typescript

OR

yarn add -D @putstack/eslint-config-typescript

Usage

Ensure that your ESLint configuration is setup to utilize TypeScript's type checking API by following this guide. Note that if you're using this in a monorepo, you SHOULD keep "project":"true" despite that the guide says otherwise in my experience.

Add this to your config by editing your eslint.config.js file or equivalent.

import putstack from '@putstack/eslint-config-typescript';

export default [...putstack.configs.recommended];

If the default is too strict on an existing project, you can also use the base configuration to exclude some of the more strict rules. To see what is dincluded in which package, please view this section.

import putstack from '@putstack/eslint-config-typescript';

export default [...putstack.configs.base];

Example

This project uses the configuration on itself, as seen in the root eslint.config.js file.

ESLint rules

ESLint PLugins and Configurations

This is a list of the plugins and configurations that are extended from.

Base

Plugins

  • eslint-plugin-depend - An ESLint plugin for suggesting optimisations in choice of dependency, native equivalents, etc.
  • eslint-plugin-perfectionist - ESLint plugin for sorting various data such as objects, imports, types, enums, JSX props, etc.
  • eslint-plugin-progress - Report progress when running ESLint. Useful for large projects with thousands of files, so it's obvious that something is running!
  • eslint-plugin-sonarjs - Code smell, bug detection, cognitive complexity and more.
  • typescript-eslint - A large amount of TypeScript related ESLint rules, using the recommended type checking rules.

Configurations

Recommended

Recommended extends the base setup further to add additional rules, therefore it also includes all the rules above.

Plugins

  • eslint-plugin-unicorn - This plugin provides more than 100 powerful ESLint rules of which many are auto-fixable making it easy to fix any issues that arise!

Configurations