# ts-standard

> TypeScript Standard Style based on StandardJS

Latest version **12.0.2** (published 2022-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-standard
pnpm add ts-standard
yarn add ts-standard
bun add ts-standard
```

Provides the command `ts-standard`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 12.0.2 |
| Published | 2022-12-20 |
| First published | 2019-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | ^12.22.0 \|\| ^14.17.0 \|\| >=16.0.0 |
| Dependencies | 12 |
| Unpacked size | 22.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Todd Bluhm |
| Maintainers | jhiesey, bret, feross, flet, linusu, mafintosh, jprichardson, watson, raynos, toddbluhm, voxpelli |
| Keywords | TypeScript Standard Style, check, checker, code, code checker, code linter, code standards, code style, enforce, eslint, lint, policy, quality, simple, standard, standard style, style, style checker, style linter, verify, typescript, standardjs, tslint |

## Links

- npm: https://www.npmjs.com/package/ts-standard
- Homepage: https://github.com/standard/ts-standard
- Issues: https://github.com/standard/ts-standard/issues
- npm.io page: https://npm.io/package/ts-standard

## Dependencies (12)

- [eslint](https://npm.io/package/eslint.md) ^8.0.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.6
- [pkg-conf](https://npm.io/package/pkg-conf.md) ^4.0.0
- [eslint-plugin-n](https://npm.io/package/eslint-plugin-n.md) ^15.0.0
- [standard-engine](https://npm.io/package/standard-engine.md) ^15.0.0
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.28.0
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.25.2
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^6.0.0
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^5.0.0
- [eslint-config-standard-jsx](https://npm.io/package/eslint-config-standard-jsx.md) ^11.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^5.0.0
- [eslint-config-standard-with-typescript](https://npm.io/package/eslint-config-standard-with-typescript.md) ^23.0.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 12.0.2 (latest) — 2022-12-20
- 12.0.1 — 2022-10-06
- 12.0.0 — 2022-10-03
- 11.0.0 — 2021-11-17
- 10.0.0 — 2020-12-07
- 9.0.0 — 2020-08-04
- 8.0.1 — 2020-05-07
- 8.0.0 — 2020-04-28
- 7.0.0 — 2020-03-18
- 6.0.0 — 2020-02-27
- 5.0.0 — 2020-02-17
- 4.0.0 — 2020-02-09
- 3.1.0 — 2020-01-20
- 3.0.0 — 2019-11-15
- 2.0.0 — 2019-11-01
- … 2 more at https://npm.io/package/ts-standard/versions

## README

[![Tests](https://github.com/standard/ts-standard/workflows/tests/badge.svg?branch=master)](https://github.com/standard/ts-standard/actions?query=workflow%3A%22tests%22)
[![npm](https://badgen.net/npm/v/ts-standard)](https://www.npmjs.com/package/ts-standard)
[![npm](https://badgen.net/npm/dm/ts-standard)](https://www.npmjs.com/package/ts-standard)
[![License](https://badgen.net/github/license/standard/ts-standard)](https://github.com/standard/ts-standard/blob/master/LICENSE)
[![TS-Standard - TypeScript Standard Style Guide](https://badgen.net/badge/code%20style/ts-standard/blue?icon=typescript)](https://github.com/standard/ts-standard)
[![Dependabot badge](https://badgen.net/github/dependabot/standard/ts-standard?icon=dependabot)](https://dependabot.com/)

# ts-standard

TypeScript Style Guide, with linter and automatic code fixer based on [StandardJS](https://standardjs.com/)

## 💾 Install

`npm install --save-dev ts-standard`

## ⌨️ Basic Usage

```sh
ts-standard
```

Enable auto code fixing

```sh
ts-standard --fix
```

Note: A `tsconfig.json` or similar project file is required. See
**[TSConfig](https://github.com/standard/ts-standard#-tsconfig-linting-with-type-information)**
section below for more details

## 📜 Help

```text
ts-standard - Standard for TypeScript! (https://github.com/standard/ts-standard)

Usage:
  ts-standard <flags> [FILES...]

  If FILES is omitted, all JavaScript/TypeScript source files (*.js, *.jsx, *.mjs, *.cjs, *.ts, *.tsx)
  in the current working directory are checked, recursively.

  Certain paths (node_modules/, coverage/, vendor/, *.min.js, and
  files/folders that begin with '.' like .git/) are automatically ignored.

  Paths in a project's root .gitignore file are also automatically ignored.

Flags:
      --fix       Automatically fix problems
  -p, --project   Specify ts-config location (default: ./tsconfig.eslint.json or ./tsconfig.json)
      --version   Show current version
  -h, --help      Show usage information

Flags (advanced):
      --stdin     Read file text from stdin
      --ext       Specify JavaScript/TypeScript file extensions
      --global    Declare global variable
      --plugin    Use custom eslint plugin
      --env       Use custom eslint environment
      --parser    Use custom ts/js parser (default: @typescript-eslint/parser)

```

## 🧬 TSConfig: Linting with Type Information

By default `ts-standard` will search the current working director (cwd) for the following in order

1. `tsconfig.eslint.json`
2. `tsconfig.json`

You can also manually configure the location of the `tsconfig` file by either passing the path to
the `--project` flag or adding a `ts-standard` configuration property to your `package.json` file.

```json
{
  "ts-standard": {
    "project": "path/to/tsconfig.json"
  }
}
```

## 🗑 Ignoring files and folders

You can add an `ignore` property to your `package.json` `ts-standard` configuration settings.

```json
{
  "ts-standard": {
    "ignore": [
      "dist",
      "src/**/*.js"
    ]
  }
}
```

## 🚫 Please change X rule

This project has no control over the rules implemented, as such this project cannot change any of the
rules that have been configured. If you want to discuss the rules, please visit the rules configuration repo
[`eslint-config-standard-with-typescript`](https://github.com/standard/eslint-config-standard-with-typescript).

## 🧙 Why

This utility was designed to be the [`standard`](https://github.com/standard/standard) equivalent for typescript.
Underneath the hood, this utility uses the same [`standard-engine`](https://github.com/standard/standard-engine)
and combines that engine with the official
[`eslint-config-standard-with-typescript`](https://github.com/standard/eslint-config-standard-with-typescript)
ruleset.

You can also choose to just use [`eslint`](https://github.com/eslint/eslint) with the
`eslint-config-standard-with-typescript` shareable config instead and achieve the same results as
this project. But `ts-standard` saves you from having to manually install all the extra dependencies
and may reduce configuration overhead.

## 🎉 Special Thanks

Special thanks to [`standard`](https://github.com/standard/standard) for inspiration and some shared code and
to [`eslint-config-standard-with-typescript`](https://github.com/standard/eslint-config-standard-with-typescript) for
creating a typescript specific standard.

## 📋 Contributing Guide

I welcome all pull requests. Please make sure you add appropriate test cases for any features
added. Before opening a PR please make sure to run the following scripts:

- `npm run lint:standard` checks for code errors and format according to [standard](https://github.com/standard/standard)
- `npm test` make sure all tests pass

---
_Source: https://npm.io/package/ts-standard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
