Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-standard-with-typescript

mightyiam1.7mMITdeprecated43.0.1TypeScript support: included

Please use eslint-config-love, instead.

An ESLint Shareable Config for JavaScript Standard Style with TypeScript support

JavaScript Standard Style, check, checker, code, code checker, code linter, code standards, code style, enforce, eslint, eslintconfig, hint, jscs, jshint, lint, policy, quality, simple, standard, standard style, style, style checker, style linter, verify, TypeScript

readme

Build Status JavaScript Style Guide npm

An ESLint shareable config for TypeScript that is based on eslint-config-standard and has TypeScript specific rules from @typescript-eslint/eslint-plugin.

Peer dependencies

This package specifies the following peerDependencies:

Yes, this is a large number of peerDependencies. This is due to a known limitation in ESLint.

@typescript-eslint dependencies

This package has @typescript-eslint/parser in dependencies.
And it has @typescript-eslint/eslint-plugin in peerDependencies.
Both are specified as ranges. It's probably safest for the installed versions of these packages to be the same. This can be achieved by:

  1. Pin (exact version) the @typescript-eslint/eslint-plugin in package.json.
  2. Have a package-lock.json which locks the version of the @typescript-eslint/parser sub-dependency.

And both pin/lock to the same version.

Yarn

Yarn does not automatically install peerDependencies, so if that's what you're using, install them manually. Here is an example, but use it only for reference, because your decisions regarding version ranges and range specifiers may vary.

yarn add --dev \
  typescript@\* \
  eslint@^8.0.1 \
  eslint-plugin-promise@^6.0.0 \
  eslint-plugin-import@^2.25.2 \
  eslint-plugin-n@^15.0.0 \
  @typescript-eslint/eslint-plugin@^6.4.0 \
  eslint-config-standard-with-typescript@latest

Example config

Here is an example .eslintrc.js. Pay close attention to the files property, because it determines which files are linted.

module.exports = {
  overrides: [
    {
      files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
      extends: 'standard-with-typescript'
    }
  ],
}

Note: the config exported by this package sets parserOptions.project = true. Read about the project option here.

There are some more parserOptions you may care about.

Example command line usage:

$ npx eslint .

changelog

43.0.1 (2024-1-20)

Build system / dependencies

  • rm add-to-project workflow (8d2f497)

Documentation

43.0.0 (2023-12-16)

⚠ BREAKING CHANGES

  • add rule @typescript-eslint/prefer-return-this-type

Features

  • @typescript-eslint/prefer-return-this-type (d987ba3)

42.0.0 (2023-12-9)

⚠ BREAKING CHANGES

  • add rule @typescript-eslint/no-unsafe-argument

Features

  • @typescript-eslint/no-unsafe-argument (350bd29)

41.0.0 (2023-12-9)

⚠ BREAKING CHANGES

  • add rule @typescript-eslint/non-nullable-type-assertion-style

Co-authored-by: Rostislav Simonik rostislav.simonik@technologystudio.sk

Features

  • @typescript-eslint/non-nullable-type-assertion-style (3f94c58)

40.0.0 (2023-11-18)

⚠ BREAKING CHANGES

  • add rule @typescript-eslint/unbound-method

Features

39.1.1 (2023-10-07)

Build system / dependencies

Bug fixes

  • turn off ESLint no-implied-eval (ed8f1d4)

39.1.0 (2023-09-23)

Build system / dependencies

  • add-to-project workflow (dd3ceae)
  • automergeMinor eslint-config-standard (f531394)
  • tsconfig.module = nodenext (7590972)

Features

39.0.0 (2023-08-27)

⚠ BREAKING CHANGES

  • deps: minimum @typescript-eslint packages bumped to v6.4.0

closes https://github.com/standard/eslint-config-standard-with-typescript/issues/1202

chore

38.1.0 (2023-08-27)

Features

Refactoring

  • remove now unneeded types definition src/inclusion.d.ts (f10cd95)

38.0.0 (2023-08-20)

⚠ BREAKING CHANGES

  • minimum @typescript-eslint packages bumped to v6.1.0
  • there will be some

Build system / dependencies

Features

37.0.0 (2023-07-22)

⚠ BREAKING CHANGES

  • add rule @typescript-eslint/block-spacing and bump minimum @typescript-eslint to 5.52.0

Co-authored-by: Rostislav Simonik rostislav.simonik@technologystudio.sk

Features

  • @typescript-eslint/block-spacing (0a0585f)

36.1.1 (2023-07-22)

Build system / dependencies

  • automerge @types/ bumps (09b9445)

Documentation

36.1.0 (2023-07-15)

Features

  • bump eslint-config-standard to v17.1.0 (aacad54)

Build system / dependencies

  • rm redundant peerDep range test (4e7ac4f)

36.0.1 (2023-07-14)

Bug fixes

  • retrieval of active node versions in ci (5ccd9a6)

36.0.0 (2023-06-30)

⚠ BREAKING CHANGES

  • the rules are provided at the top level, instead of under an overrides property. Providing the rules under the overrides property was never a good idea. It prevents specifying which files the rules apply to (e.g. [*.js, *.ts]). I apologize. To migrate, make sure that your extends property is under an overrides item. An example is in the readme. To help verify your configuration, you could obtain a list of files that will be linted, this way: DEBUG=eslint:cli-engine npx eslint <path>.

Bug fixes

35.0.0 (2023-06-02)

⚠ BREAKING CHANGES

  • minimum @typescript-eslint is corrected to be 5.50.0

Co-authored-by: Rostislav Simonik rostislav.simonik@technologystudio.sk

Build system / dependencies

Testing

  • assign to config.overrides.parser in compatibility config test (2e62830)
  • bottom peerDep compatibility test actually works (73da75f)

Bug fixes

34.0.1 (2023-03-14)

Testing

  • equivalents not used upstream not considered (7354da5)

Bug fixes

34.0.0 (2023-02-01)

⚠ BREAKING CHANGES

  • @typescript-eslint/key-spacing

Features

  • @typescript-eslint/key-spacing (f1d8be3)

33.0.0 (2023-01-27)

⚠ BREAKING CHANGES

  • @typescript-eslint/class-literal-property-style

Co-authored-by: Shahar Dawn Or mightyiampresence@gmail.com

Features

  • @typescript-eslint/class-literal-property-style (35093cb)

32.0.0 (2023-01-24)

⚠ BREAKING CHANGES

  • @typescript-eslint/consistent-type-{imports/exports}

Co-authored-by: Rostislav Simonik rostislav.simonik@technologystudio.sk

Features

  • @typescript-eslint/consistent-type-{imports/exports} (bf0f96f)

31.0.0 (2023-01-19)

⚠ BREAKING CHANGES

  • @typescript-eslint/consistent-generic-constructors

Features

  • @typescript-eslint/consistent-generic-constructors (0248ed7)

30.0.0 (2023-01-17)

⚠ BREAKING CHANGES

  • @typescript-eslint/ban-types

Features

  • @typescript-eslint/ban-types (94fcc73)

29.0.0 (2023-01-17)

⚠ BREAKING CHANGES

  • @typescript-eslint/ban-tslint-comment

Features

  • @typescript-eslint/ban-tslint-comment (6aa6817)

28.0.0 (2023-01-17)

⚠ BREAKING CHANGES

  • @typescript-eslint/ban-ts-comment

Co-authored-by: Shahar Dawn Or mightyiampresence@gmail.com

Features

  • @typescript-eslint/ban-ts-comment (13e53c0)

27.0.1 (2023-01-12)

Documentation

27.0.0 (2023-01-12)

⚠ BREAKING CHANGES

  • add @typescript-eslint/await-thenable

Co-authored-by: Shahar Dawn Or mightyiampresence@gmail.com

Features

  • add @typescript-eslint/await-thenable (7dad1a9)

Testing

  • all plugin rules are considered (f91887f)
  • correct 'all plugin rules are considered' (6863028)

Build system / dependencies

  • latest node.js in publish job (0c8d8f8)

26.0.0 (2023-01-03)

⚠ BREAKING CHANGES

  • add @typescript-eslint/no-confusing-void-expression

Co-authored-by: Rostislav Simonik rostislav.simonik@technologystudio.sk

Features

  • add @typescript-eslint/no-confusing-void-expression (15ce349)

25.0.0 (2023-01-03)

⚠ BREAKING CHANGES

  • add @typescript-eslint/no-unnecessary-type-constraint

Co-authored-by: Rostislav Simonik rostislav.simonik@technologystudio.sk

Features

  • add @typescript-eslint/no-unnecessary-type-constraint (3451bac)

24.0.0 (2022-12-14)

⚠ BREAKING CHANGES

  • add rule consistent-indexed-object-style

Features

  • add rule consistent-indexed-object-style (2edd0af)

Build system / dependencies

  • workaround some commitlint issue (a202f4b)

23.0.0 (2022-09-13)

⚠ BREAKING CHANGES

  • add rules from @typescript-eslint: no-extra-parens, no-loss-of-precision, object-curly-spacing, space-before-blocks, comma-dangle.

Features

CI

Build system / dependencies

  • renovate automergeMinor github actions (02dde9d), closes #910

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

22.0.0 (2022-07-06)

⚠ BREAKING CHANGES

  • the dependency eslint-config-standard is now pinned.
  • several peerDep bumps including eslint@^8.0.1 (was

Features

  • pin eslint-config-standard dependency (5bbd534), closes #849
  • support ESLint v8 (dc25743)

Bug Fixes

  • log #759 as breaking change (519a8bc), closes #806
  • peer-depend on any version of typescript (3446e30), closes #604
  • use typescript-eslint version of space-infix-ops rule (e57051c)

21.0.1 (2021-08-31)

21.0.0 (2021-08-29)

⚠ BREAKING CHANGES

  • package: peer dependencies are specified with ^.

Bug Fixes

  • deps: expand eslint-plugin-promise peerDep to equal upstream (dcc5a33)
  • deps: sort peer deps (a26b179)
  • doc: readme travis ci badge .com (34953e6)
  • no-void: allowAsStatement (8ab083e)
  • package: peerDeps use caret ranges (b8b544d), closes #596
  • relax rule default-param-last (#591) (8c836dc)

20.0.0 (2021-01-25)

⚠ BREAKING CHANGES

  • Now based on eslint-config-standard v16. Also bumped some peerDeps, including eslint. Notice removed eslint-plugin-standard peerDep.

Features

  • eslint-config-standard v16 (020569b)
  • require-array-sort-compare ignoreStringArrays (#359) (95fcb7c)

Bug Fixes

  • docs: install version of @typescript-eslint/eslint-plugin@4 (#414) (51c40be)

19.0.1 (2020-09-02)

Bug Fixes

  • add @typescript-eslint/no-redeclare (73e39a6)

19.0.0 (2020-09-02)

⚠ BREAKING CHANGES

  • deps: minimum @typescript-eslint/eslint-plugin version bumped to 4.0.1

Bug Fixes

  • docs: install version of @typescript-eslint/eslint-plugin@3 (26691c7), closes #353 #351
  • test: deps parser & plugin same major version (0329cac), closes #407
  • deps: update eslint packages to v4 (7275f68)

18.0.2 (2020-05-28)

Bug Fixes

  • allow PascalCase format on variables (14bc44c)

18.0.1 (2020-05-27)

Bug Fixes

  • include lib/eslint-config-standard in package (07c0aba), closes #329

18.0.0 (2020-05-27)

⚠ BREAKING CHANGES

  • deps: peer dep version bump

Features

  • export is of type ESLint.Config (1d61c3d)

Bug Fixes

  • deep copy standardRules config (db3467d), closes #303
  • deps: bump parser & plugin to v3.0.1 (9621cde), closes #209

17.0.0 (2020-05-16)

⚠ BREAKING CHANGES

https://github.com/typescript-eslint/typescript-eslint/blob/v2.29.0/packages/eslint-plugin/docs/rules/keyword-spacing.md

  • add rule @typescript-eslint/prefer-reduce-type-parameter

https://github.com/typescript-eslint/typescript-eslint/blob/v2.29.0/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md

  • add rule @typescript-eslint/method-signature-style
  • plugin peerDep bumped to 2.29.0

Features

  • allowSingleExtends in no-empty-interface (821005e), closes #293
  • rule @typescript-eslint/keyword-spacing (728a592)
  • rule @typescript-eslint/method-signature-style (aecc59e)
  • rule @typescript-eslint/prefer-reduce-type-parameter (3015c46)
  • rule @typescript-eslint/prefer-ts-expect-error (b10a230)
  • upgrade parser & plugin to 2.33.0 (ce506b1), closes #290 #291 #295 #297

Bug Fixes

16.0.0 (2020-04-23)

⚠ BREAKING CHANGES

  • plugin peerDep bump
  • bump plugin peerDep

Bug Fixes

  • ensure @typescript-eslint/semi rule is applied (#275) (92b21c7)
  • remove @typescript-eslint/require-await (657ee28), closes #217
  • upgrade parser & plugin to 2.25.0 (99af05e), closes #263
  • upgrade parser & plugin to 2.26.0 (08c2444), closes #269

15.0.1 (2020-03-21)

Bug Fixes

  • bump dependency on eslint-config-standard (dc3a348)

15.0.0 (2020-03-17)

⚠ BREAKING CHANGES

no-use-before-define ignores enums.

  • member-ordering handles enum declarations

Features

Bug Fixes

  • remove @typescript-eslint/no-empty-function (e183d4e), closes #248
  • upgrade parser & plugin to v2.19.2 (443680f)

14.0.0 (2020-02-19)

⚠ BREAKING CHANGES

no-use-before-define ignores enums.

  • member-ordering handles enum declarations

Features

  • upgrade parser & plugin to v2.19.2 (443680f)

13.0.0 (2020-02-11)

⚠ BREAKING CHANGES

no-use-before-define ignores enums.

  • member-ordering handles enum declarations

Features

  • upgrade parser & plugin to v2.17.0 (11a16f4), closes #218
  • upgrade parser & plugin to v2.18.0 (fe2242a), closes #218
  • upgrade parser & plugin to v2.19.0 (64fdf31), closes #223
  • rules: add rule prefer-includes (#148) (#225) (a2bdac5)
  • upgrade plugin & parser to v2.11.0 (6a378ad), closes #191
  • upgrade plugin & parser to v2.12.0 (e5cfecf), closes #194
  • upgrade plugin & parser to v2.13.0 (a0ef9e7), closes #196
  • upgrade plugin & parser to v2.14.0 (af722c3), closes #202
  • upgrade plugin & parser to v2.15.0 (f6eab66), closes #203
  • upgrade plugin & parser to v2.16.0 (b83b82e), closes #207
  • upgrade parser & plugin to v2.19.2 (443680f)

12.0.1 (2020-01-21)

Bug Fixes

12.0.0 (2020-01-21)

⚠ BREAKING CHANGES

Features

Bug Fixes

11.0.0 (2019-11-15)

⚠ BREAKING CHANGES

  • brace-style now supports TypeScript syntax.

Features

Bug Fixes

10.0.0 (2019-10-03)

⚠ BREAKING CHANGES

Bug Fixes

  • don't use the TypeScript parser for .js files (bad0301)
  • tsconfig.json: utilize new tsconfig.eslint.json file (fb0976d)
  • [no-unused-vars] Allow unused parameters (5b70896)
  • [no-use-before-define] Disable eslint version (9d9c792)
  • add ESLint to the list of dependencies (4600a95)
  • add missing eslint dependency to readme.md (501ba09)
  • drop peerDependency of eslint-config-standard (85d7174), closes #131
  • loosen explicit-function-return-type (bdae116), closes #110
  • remove explicit-member-accessibility (f673d9d), closes #111
  • sort the rules by type (4e48fdc)
  • update readme to reflect correct usage (8a29b9e)

Features

  • @typescript-eslint/eslint-plugin@^1.11.0 (ad3f043), closes #99
  • @typescript-eslint/eslint-plugin@^1.12.0 (b41f0e5), closes #100
  • @typescript-eslint/eslint-plugin@^1.13.0 (72fc639), closes #101

9.0.0 (2019-08-30)

⚠ BREAKING CHANGES

Bug Fixes

  • [no-unused-vars] Allow unused parameters (5b70896)
  • [no-use-before-define] Disable eslint version (9d9c792)
  • add ESLint to the list of dependencies (4600a95)
  • add missing eslint dependency to readme.md (501ba09)
  • drop peerDependency of eslint-config-standard (85d7174), closes #131
  • loosen explicit-function-return-type (bdae116), closes #110
  • remove explicit-member-accessibility (f673d9d), closes #111
  • sort the rules by type (4e48fdc)
  • update readme to reflect correct usage (8a29b9e)
  • tsconfig.json: utilize new tsconfig.eslint.json file (fb0976d)

Features

  • @typescript-eslint/eslint-plugin@^1.11.0 (ad3f043), closes #99
  • @typescript-eslint/eslint-plugin@^1.12.0 (b41f0e5), closes #100
  • @typescript-eslint/eslint-plugin@^1.13.0 (72fc639), closes #101