typescript-eslint

Monorepo for all the tooling which enables ESLint to support TypeScript

OTHER License

Downloads
1.4B
Stars
14.5K
Committers
682

Bot releases are hidden (Show)

typescript-eslint - v3.9.1

Published by JamesHenry about 4 years ago

3.9.1 (2020-08-17)

Bug Fixes

  • eslint-plugin: [no-unnecessary-condition] fix false positive with nullish coalescing (#2385) (092c969)
  • eslint-plugin: [prefer-includes] don't auto fix when test method's argument type doesn't have an 'includes' method (#2391) (71c4c72)
typescript-eslint - v3.9.0

Published by JamesHenry about 4 years ago

3.9.0 (2020-08-10)

Bug Fixes

  • eslint-plugin: [no-throw-literal] support type assertions (#2354) (470174a)

Features

  • eslint-plugin: [no-unsafe-assignment/return] allow assigning any => unknown (#2371) (e7528e6)
  • typescript-estree: support TSv4 labelled tuple members (#2378) (00d84ff)
typescript-eslint - v3.8.0

Published by JamesHenry about 4 years ago

3.8.0 (2020-08-03)

Bug Fixes

  • eslint-plugin: [no-implied-eval] don't report when Function is imported (#2348) (fa169e7)
  • eslint-plugin: [no-unsafe-assignment] fix typo in message (#2347) (2027bb1)

Features

  • eslint-plugin: [naming-convention] allow specifying an array of selectors (#2335) (3ef6bd5)
  • eslint-plugin: add prefer-enum-initializers rule (#2326) (4f38ea3)
typescript-eslint - v4.0.0-rc

Published by bradzacher over 4 years ago

typescript-eslint - v3.7.1

Published by JamesHenry over 4 years ago

3.7.1 (2020-07-27)

Bug Fixes

  • eslint-plugin: [adjacent-overload-signatures] fix false positive on call signatures and a method named call (#2313) (30fafb0)
  • eslint-plugin: [no-extra-parens] stop reporting on calling generic functions with one argument and type parameters containing parentheses (#2319) (616a841)
  • typescript-estree: correct AST regression introduced by TS4.0 upgrade (#2316) (d7fefba)
typescript-eslint - v3.7.0

Published by JamesHenry over 4 years ago

3.7.0 (2020-07-20)

Features

  • eslint-plugin: [naming-convention] allow selecting only const variables (#2291) (156d058)
  • eslint-plugin: [no-empty-function] add decoratedFunctions option (#2295) (88f08f4)
  • typescript-estree: support short-circuiting assignment operators (#2307) (2c90d9f)
  • typescript-estree: support type annotations on catch clauses (#2306) (b5afe9c)
typescript-eslint - v3.6.1

Published by JamesHenry over 4 years ago

3.6.1 (2020-07-13)

Bug Fixes

  • eslint-plugin: [no-unnecessary-condition] handle computed member access (#2288) (3a187ca)
  • eslint-plugin: [prefer-literal-enum-member] allow negative numbers (#2277) (00ac9c3)
  • eslint-plugin: [space-before-function-paren] incorrect handling of abstract methods (#2275) (ced6591), closes #2274
  • eslint-plugin: [switch-exhaustiveness-check] handle special characters in enum keys (#2207) (98ab010)
typescript-eslint - v3.6.0

Published by JamesHenry over 4 years ago

3.6.0 (2020-07-06)

Bug Fixes

  • eslint-plugin: [no-namespace] allow namespaces in nested declarations with allowDeclarations (#2238) (c1df669)
  • eslint-plugin: [space-before-function-paren] handle abstract functions (#2199) (88a3edf)

Features

  • eslint-plugin: add rule prefer-literal-enum-member (#1898) (fe2b2ec)
typescript-eslint - v3.5.0

Published by JamesHenry over 4 years ago

3.5.0 (2020-06-29)

Bug Fixes

  • eslint-plugin: [naming-convention] support unicode in regex (#2241) (5fdd21a)
  • typescript-estree: forward compatibility for new compound assignment operators (#2253) (ba41680)

Features

typescript-eslint - v3.4.0

Published by JamesHenry over 4 years ago

3.4.0 (2020-06-22)

Bug Fixes

  • eslint-plugin: [no-base-to-string] handle intersection types (#2170) (9cca3a9)
  • eslint-plugin: [unbound-method] handling destructuring (#2228) (c3753c2)
  • experimental-utils: correct types for TS versions older than 3.8 (#2217) (5e4dda2)
  • experimental-utils: getParserServices takes a readonly context (#2235) (26da8de)

Features

  • eslint-plugin: [no-unnecessary-boolean-literal-compare] add option to check nullable booleans (#1983) (c0b3057)
  • eslint-plugin: add extension rule no-loss-of-precision (#2196) (535b0f2)
typescript-eslint - v3.3.0

Published by JamesHenry over 4 years ago

3.3.0 (2020-06-15)

Bug Fixes

  • eslint-plugin: [no-unused-expressions] handle ternary and short-circuit options (#2194) (ee9f100)
  • typescript-estree: handle TS4.0 breaking change in TupleType (#2197) (5d68129)

Features

  • eslint-plugin: [naming-convention] better error message and docs for prefix/suffix (#2195) (a2ffe55)
typescript-eslint - v3.2.0

Published by JamesHenry over 4 years ago

3.2.0 (2020-06-08)

Bug Fixes

  • eslint-plugin: [explicit-module-boundary-types] dont report return type errors on constructor overloads (#2158) (53232d7)
  • eslint-plugin: [explicit-module-boundary-types] handle bodyless arrow functions with explicit return types that return functions (#2169) (58db655)
  • eslint-plugin: [explicit-module-boundary-types] handle nested functions and functions expressions in a typed variable declaration (#2176) (6ff450d)
  • eslint-plugin: [no-extra-non-null-assertion] dont report for assertions not followed by the optional chain (#2167) (e4c1834)
  • eslint-plugin: [no-unnecessary-conditionals] Handle comparison of generics and loose comparisons with undefined values (#2152) (c86e2a2)
  • eslint-plugin: [prefer-optional-chain] handling first member expression (#2156) (de18660)
  • eslint-plugin: [return-await] correct handling of ternaries (#2168) (fe4c0bf)

Features

  • eslint-plugin: [naming-convention] put identifiers in quotes in error messages (#2182) (fc61932), closes #2178
  • eslint-plugin: [require-array-sort-compare] add ignoreStringArrays option (#1972) (6dee784)
  • eslint-plugin: add rule ban-tslint-comment (#2140) (43ee226)
  • eslint-plugin: add rule no-confusing-non-null-assertion (#1941) (9b51c44)
typescript-eslint - v3.1.0

Published by JamesHenry over 4 years ago

3.1.0 (2020-06-01)

Bug Fixes

  • eslint-plugin: [explicit-module-boundary-types] don't check returned functions if parent function has return type (#2084) (d7d4eeb)
  • eslint-plugin: [no-unnecessary-condition] handle comparison of any, unknown and loose comparisons with nullish values (#2123) (1ae1d01)
  • eslint-plugin: [no-unnecessary-condition] improve optional chain handling (#2111) (9ee399b)
  • eslint-plugin: [no-unnecessary-condition] improve optional chain handling 2 - electric boogaloo (#2138) (c87cfaf)
  • eslint-plugin: [no-unused-expressions] ignore import expressions (#2130) (e383691)
  • eslint-plugin: [no-var-requires] false negative for TSAsExpression and MemberExpression (#2139) (df95338)
  • experimental-utils: downlevel type declarations for versions older than 3.8 (#2133) (7925823)

Features

  • eslint-plugin: [ban-ts-comments] add "allow-with-description" option (#2099) (8a0fd18)
  • eslint-plugin: [ban-types] allow selective disable of default options with false value (#2137) (1cb8ca4)
  • eslint-plugin: [explicit-module-boundary-types] improve accuracy and coverage (#2135) (caaa859)
typescript-eslint - v3.0.2

Published by JamesHenry over 4 years ago

3.0.2 (2020-05-27)

Bug Fixes

typescript-eslint - v3.0.1

Published by JamesHenry over 4 years ago

3.0.1 (2020-05-25)

Bug Fixes

  • eslint-plugin: [naming-convention] handle no options correctly (#2095) (fd7d02b)
  • eslint-plugin: [no-throw-literal] handle intersection and union types (#2085) (cae037f)
  • eslint-plugin: [unbound-method] fix crash due to missing Intl (#2090) (f2fa82c)
  • experimental-utils: export CLIEngine & ESLint (#2083) (014341b)
  • typescript-estree: handle BigInt with _ numeric separator (#2067) (66f1627)
  • typescript-estree: mark TS 3.8 and 3.9 as "supported" (#2057) (5eedbff), closes #1436 #1436
typescript-eslint - v3.0.0

Published by bradzacher over 4 years ago

This major release has been a long time coming! We've been saving up breaking changes for a while now, waiting for the ESLint v7 release which we knew would deprecate support for node version 8.

Due to our weekly release cadence, this major release mostly contains breaking changes!

Breaking Changes

Dropped support for Node version 8 (#1420)

In line with ESLint v7 - we've also dropped explicit support for node version 8.
This version of node has been end of life since 2019-12-31.
We no longer test against the version, so we provide no guarantees about whether or not future versions of our tooling will work on it.

Dropped support for TypeScript 3.2 (#2004)

Old TS versions cause us maintenance pain as we work on integrating tightly with the TypeScript APIs for performance and stability reasons.

As such we've updated our required TS version range to require a minimum of >=3.3.1.

Each version of TS brings bugfixes and features, but most importantly they bring performance improvements. TS 3.9 is releasing with a host of performance improvements that will improve both your build times, and your lint times - so you should endeavour to upgrade if you can. We cannot provide any guarantees around the performance of old TS versions.

Configs

We've updated all of our configs! We've added new rules, old rules, and removed some stylistic rules.

Check out the linked issues for more information about added/removed rules:

  • eslint-recommended config (#1273)
  • recommended config (#1423)
  • recommended-requiring-typechecking (#1423)

Additionally, both of the recommended and recommended-requiring-typechecking sets now inherit from the eslint-recommended set. We noticed that the majority of the time, users were using the sets in tandem, so this just removes one line of config for everyone.

I.e. you can now do the following:

 extends: [
   "recommended",
-  "plugin:@typescript-eslint/eslint-recommended",
   "plugin:@typescript-eslint/recommended"
 ]

Rules Changes

  • ban-types got a rework of its default ban list to provide some more sensible defaults and remove fixers that caused users issues. (#848)
  • no-floating-promises now has the ignoreVoid option set to true by default. (#2003)
  • no-non-null-asserted-optional-chain (non-breaking) now supports TS 3.9's non-null assertion changes.
  • no-unnecessary-condition
    • the ignoreRHS option has been removed. The rule will now only check the RHS when it matters (i.e. in boolean contexts). (#1163)
    • the checkArrayPredicates option has been removed. The rule will now always check array predicate functions. (#1579)
    • the rule now will report if you do an equality check against null/undefined when the value is not nullable. (#1659)
  • prefer-nullish-coalescing (52b60852d0ba6bb6abe519c9d3ec1b231793e91d)
    • the fixer has been converted to a suggestion fixer always - it was unsafe in most cases.
    • removed option forceSuggestionFixer.
  • prefer-optional-chain (52b60852d0ba6bb6abe519c9d3ec1b231793e91d)
    • the fixer has been converted to a suggestion fixer always - it was unsafe in a number of cases.
    • removed option suggestInsteadOfAutofix.
  • restrict-template-expressions
    • now has the allowNumber option set to true by default. (#2005)
    • allowNullable has been renamed to allowNullish. (#2006)
  • strict-boolean-expression received a complete rework. The rule is now more configurable, with smarter defaults and more intuitive logic. (#1515)

Rule Removals

The following deprecated rules have been deleted. Please switch to the listed alternative:

AST Changes

  • typescript-estree now emits a TSEmptyBodyFunctionExpression when it encounters a function expression without a body. Previously this was done in parser (for legacy reasons). This change should only affect users directly consuming typescript-estree. (#1289)
  • When a method is marked as optional (class Foo { name?() {} }) we now mark the MethodDefinition/TSAbstractMethodDefinition as optional. Previously we marked the key of the node as optional, but this only works if the key is an Identifier, and didn't work in the case of a computed key (class Foo { ['name']?() {} }). (#1429)
  • Import expressions (import('foo')) now conform to the newly released ESTree spec, outputting as an ImportExpression. (#1950)
  • BigInt literals now conform to the newly released ESTree spec, outputting as a Literal with a value of type bigint. (#1999)
  • See also the non-breaking change below - Better handling for TS 3.9's non-null assertion changes.

Parser Services

parserServices are now always emitted from both typescript-estree and parser, regardless of the parserOptions.project configuration. (#716)

This will allow you to consume parts of the TypeScript API that are generated at the file level, like variable usage diagnostics, without requiring full type information is generated for the project.

Part of this change includes a new boolean flag on the output: parserServices.hasFullTypeInformation which is true when parserOptions.project was configured, and false otherwise.

If you were using our getParserServices function from experimental-utils, then this will be handled automatically, and you will not notice any changes. If you built your own function for resolving the parserServices, then you'll have to update accordingly.

ESLint Types (experimental-utils)

The old version of our ESLint types were based on those found in the DefinitelyTyped repo. There was a lot of missing documentation, missing properties, misnamed types.

As part of this release, we've reworked some of the internals to be much closer to the ESLint library itself. (#2023)

As part of this change, we have also added the types for the new ESLint class.
SourceCode.isSpaceBetween has also been marked as optional, because it is only available in ESLint v6+

Non-breaking changes

ESLint v7

We now have full support for ESLint v7 (#1550).

Better handling for TS 3.9's non-null assertion changes (#2036)

TS 3.9 introduced a breaking change for how non-null assertions are handled in optional chains.

Pre-3.9, x?.y!.z means (x?.y).z - i.e. it essentially scrubbed the optionality from the chain
Post-3.9, x?.y!.z means x?.y!.z - i.e. it just asserts that the property y is non-null, not the result of x?.y

We now emit a different AST when we work with TS3.9. Note that the AST is unchanged for TS3.8 and lower.

TS3.8

   x?.y!.z
// ^^^^^^^ MemberExpression
// ^^^^^   TSNonNullAssertion
// ^^^^    OptionalMemberExpression

TS3.9

   x?.y!.z
// ^^^^^^^ OptionalMemberExpression <-- NEW!
// ^^^^^   TSNonNullAssertion
// ^^^^    OptionalMemberExpression

Same for each versions

   (x?.y)!.z
// ^^^^^^^^^ MemberExpression
// ^^^^^^^   TSNonNullAssertion
// ^^^^^^    OptionalMemberExpression

   (x?.y!).z
// ^^^^^^^^^ MemberExpression
// ^^^^^^    TSNonNullAssertion
// ^^^^^     OptionalMemberExpression

The same change applies for optional call expressions.

The rule no-non-null-asserted-optional-chain was also updated to handle this appropriately. It will no longer error on x?.y!.z, but it will still error on (x?.y)!.z.

Bug Fixes

  • eslint-plugin: [dot-notation] fix typo in schema (#2040) (242328f)
typescript-eslint - v2.34.0

Published by JamesHenry over 4 years ago

2.34.0 (2020-05-18)

Bug Fixes

  • typescript-estree: fix handling of range/loc removal (#2028) (ce344d9)

Features

  • eslint-plugin: [no-invalid-void-type] allow union of void and allowInGenericTypeArguments (#1960) (1bc105a)
  • eslint-plugin: [restrict-template-expressions] improve error message (#1926) (1af59ba)
  • experimental-utils: add suggestion property for rule modules (#2033) (f42a5b0)
typescript-eslint - v2.33.0

Published by JamesHenry over 4 years ago

2.33.0 (2020-05-12)

Bug Fixes

  • experimental-utils: remove accidental dep on json-schema (#2010) (1875fba)

Features

  • eslint-plugin: add extension rule lines-between-class-members (#1684) (08f93e6)
typescript-eslint - v2.32.0

Published by JamesHenry over 4 years ago

2.32.0 (2020-05-11)

Bug Fixes

  • eslint-plugin: [no-base-to-string] support boolean in unions (#1979) (6987ecc)
  • eslint-plugin: [no-type-alias] handle readonly types in aliases (#1990) (56d9870)
  • eslint-plugin: [no-unused-expressions] inherit messages from base rule (#1992) (51ca404)

Features

typescript-eslint - v2.31.0

Published by JamesHenry over 4 years ago

2.31.0 (2020-05-04)

Bug Fixes

  • eslint-plugin: [dot-notation] handle missing declarations (#1947) (383f931)
  • eslint-plugin: [method-signature-style] fix overloaded methods to an intersection type (#1966) (7f3fba3)
  • eslint-plugin: [return-await] await in a normal function (#1962) (f82fd7b)
  • eslint-plugin: [unbound-method] false positives for unary expressions (#1964) (b35070e)
  • eslint-plugin: no-base-to-string boolean expression detect (#1969) (f78f13a)

Features

  • eslint-plugin: [member-ordering] add decorators support (#1870) (f7ec192)
  • eslint-plugin: [prefer-optional-chain] added option to convert to suggestion fixer (#1965) (2f0824b)
  • eslint-plugin: new extended rule 'no-invalid-this' (#1823) (b18bc35)
  • eslint-plugin-internal: add rule no-poorly-typed-ts-props (#1949) (56ea7c9)
  • experimental-utils: expose our RuleTester extension (#1948) (2dd1638)