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-to-eslint-config

v2.14.3

Published

Converts your TSLint configuration to the closest reasonable ESLint equivalent.

Downloads

126,503

Readme

tslint-to-eslint-config

Code Style: Prettier Coverage: 100% TypeScript: Strict NPM version Circle CI Join the chat at https://gitter.im/tslint-to-eslint-config/community Speed: Blazingly Fast

Converts your TSLint configuration to the closest reasonable ESLint equivalent.

👉 Did you know TSLint is deprecated? Hooray! Use tslint-to-eslint-config to expedite migrating your project onto ESLint.

Consider taking a peek at the relevant documentation: 🤔

Usage

⚠ Coming from Angular? Use angular-eslint instead to coordinate around this tool and others.

npx tslint-to-eslint-config

⚡ (wow, so simple!) ⚡

The tslint-to-eslint-config command reads in any existing linter, TypeScript, and package configuration files, then creates an .eslintrc.js result based on them.

For any TSLint rules with corresponding ESLint equivalents, those equivalents will be used in the new configuration. TSLint rules without ESLint equivalents will be wrapped with eslint-plugin-tslint.

Requires Node 14+ (LTS) and TSLint 5.18+

FAQs

We strongly advise reading docs/FAQs.md before planning your conversion from TSLint to ESLint.

CLI Flags

Each of these flags is optional:

  • comments: TypeScript configuration or file glob path(s) to convert TSLint rule flags to ESLint within.
  • config: Path to print the generated ESLint configuration file to.
  • editor: Path to an editor configuration file to convert linter settings within.
  • eslint: Path to an ESLint configuration file to read settings from.
  • package: Path to a package.json file to read dependencies from.
  • prettier: Add eslint-config-prettier to the plugins list.
  • tslint: Path to a TSLint configuration file to read settings from.
  • typescript: Path to a TypeScript configuration file to read TypeScript compiler options from.

comments

npx tslint-to-eslint-config --comments

Default: none

Indicates to convert from TSLint rule flags to ESLint inline comments. Comments such as // tslint:disable: tslint-rule-name will be converted to equivalents like // eslint-disable eslint-rule-name.

If passed without arguments, respects the exclude, files, and include in your TypeScript configuration.

If passed a single file path ending with .json, that is treated as a TypeScript configuration file describing with files to convert.

npx tslint-to-eslint-config --comments tsconfig.json

If passed any other arguments, those are treated as glob paths for file paths to convert:

npx tslint-to-eslint-config --comments 'src/**/*.ts'

config

npx tslint-to-eslint-config --config .eslintrc.json

Default: .eslintrc.js

Path to print the generated ESLint configuration file to.

The file extension of this path will be used to determine the format of the created file:

  • .js file paths will be written module.exports = ... JavaScript
  • Other file paths will default to JSON

editor

npx tslint-to-eslint-config --editor ./path/to/.vscode/settings.json

Default: .vscode/settings.json

Path to an editor configuration file to convert settings settings within. Any VS Code style editor settings for TSLint will be converted to their ESLint equivalents.

eslint

npx tslint-to-eslint-config --eslint ./path/to/eslintrc.js

Default: --config's value

Path to an ESLint configuration file to read settings from. The generated ESLint configuration file will include any settings imported from this file.

package

npx tslint-to-eslint-config --package ./path/to/package.json

Default: package.json

Path to a package.json file to read dependencies from. This will help inform the generated ESLint configuration file's env settings.

prettier

npx tslint-to-eslint-config --prettier

Default: false

Add eslint-config-prettier to the list of ESLint plugins. We highly recommend you use Prettier for code formatting.

When --prettier isn't enabled:

  • If the output configuration already doesn't enable any formatting rules, it'll extend from eslint-config-prettier.
  • Otherwise, a CLI message will suggest running with --prettier.

tslint

npx tslint-to-eslint-config --tslint ./path/to/tslint.json

Default: tslint.json

Path to a TSLint configuration file to read settings from. This file is piped into TSLint's --print-config to generate the list of rules to enable in the generated ESLint configuration file.

typescript

npx tslint-to-eslint-config --typescript ./path/to/tsconfig.json

Default: tsconfig.json

Path to a TypeScript configuration file to read TypeScript compiler options from. This will help inform the generated ESLint configuration file's env settings.

Node API

You can use tslint-to-eslint-config programmatically via its exported functions. See docs/API for details.

import { convertLintConfig } from "tslint-to-eslint-config";

const result = await convertLintConfig();

Development

See the Code of Conduct and general development docs. 💖