Skip to content

Upgrading @typescript-eslint/parser 2 to 3

Breaking2.34.0 → 3.10.1Breaking26Platform1New21Changed11Fixed49

BreakingUpgrade verdict

25 breaking changes and a platform requirement change.

  • Updates the eslint-recommended, recommended and recommended-requiring-typechecking configs with added and removed rules.
  • Reworks the ban-types default ban list and removes fixers that caused user issues.
  • Sets the no-floating-promises ignoreVoid option to true by default.
  • Removes the ignoreRHS option from no-unnecessary-condition; the rule now only checks the RHS in boolean contexts.
Top 4 of 26 that need code or config changes

Node.js requirement changed in 3.0.0-alpha.23: ^8.10.0 || ^10.13.0 || >=11.10.1 → ^10.12.0 || >=12.0.0.

Adds @typescript-eslint/types 3.10.1.

Installs 31 packages in all (was 29).

Breaking25
Updates the eslint-recommended, recommended and recommended-requiring-typechecking configs with added and removed rules.
eslint-recommendedrecommendedrecommended-requiring-typechecking
Reworks the ban-types default ban list and removes fixers that caused user issues.
ban-types
Sets the no-floating-promises ignoreVoid option to true by default.
no-floating-promisesignoreVoid
Removes the ignoreRHS option from no-unnecessary-condition; the rule now only checks the RHS in boolean contexts.
no-unnecessary-conditionignoreRHS
Removes the checkArrayPredicates option from no-unnecessary-condition; array predicate functions are now always checked.
no-unnecessary-conditioncheckArrayPredicates
Converts the prefer-nullish-coalescing fixer to always be a suggestion fixer and removes the forceSuggestionFixer option.
prefer-nullish-coalescingforceSuggestionFixer
Converts the prefer-optional-chain fixer to always be a suggestion fixer and removes the suggestInsteadOfAutofix option.
prefer-optional-chainsuggestInsteadOfAutofix
Sets the restrict-template-expressions allowNumber option to true by default.
restrict-template-expressionsallowNumber
Renames the restrict-template-expressions allowNullable option to allowNullish.
restrict-template-expressionsallowNullableallowNullish
Completely reworks strict-boolean-expression with more configurability, smarter defaults and more intuitive logic.
strict-boolean-expression
Removes the deprecated ban-ts-ignore rule in favor of ban-ts-comment.
ban-ts-ignoreban-ts-comment
Removes the deprecated camelcase rule in favor of naming-convention.
camelcasenaming-convention
Removes the deprecated class-name-casing rule in favor of naming-convention.
class-name-casingnaming-convention
Removes the deprecated generic-type-naming rule in favor of naming-convention.
generic-type-namingnaming-convention
Removes the deprecated interface-name-prefix rule in favor of naming-convention.
interface-name-prefixnaming-convention
Removes the deprecated member-naming rule in favor of naming-convention.
member-namingnaming-convention
Removes the deprecated no-untyped-public-signatures rule in favor of explicit-module-boundary-types.
no-untyped-public-signaturesexplicit-module-boundary-types
Optional methods now mark the MethodDefinition/TSAbstractMethodDefinition as optional instead of the key, fixing computed keys.
MethodDefinitionTSAbstractMethodDefinition
Import expressions now output as an ImportExpression per the new ESTree spec.
ImportExpression
BigInt literals now output as a Literal with a value of type bigint per the new ESTree spec.
Literal
parserServices are now always emitted regardless of parserOptions.project, with a new hasFullTypeInformation flag.
parserServicesparserOptions.project
Adds parserServices.hasFullTypeInformation, true when parserOptions.project is configured and false otherwise.
parserServices.hasFullTypeInformationparserOptions.project
Marks SourceCode.isSpaceBetween as optional since it is only available in ESLint v6+.
SourceCode.isSpaceBetween
Custom parserServices resolvers must be updated; getParserServices from experimental-utils handles the change automatically.
getParserServices
Reworks ESLint types in experimental-utils to more closely match the ESLint library.
Platform1
Drops explicit support for Node version 8, which has been end of life since 2019-12-31.

Generated by DepDelta from published .d.ts files. Not mixed with prose notes.

  • added: const version: string
  • added: export { ParserOptions } from './parser'
  • added: export { ParserServices } from '@typescript-eslint/typescript-estree'
  • added: export { clearCaches } from '@typescript-eslint/typescript-estree'
  • added: export { parse } from './parser'
  • added: export { parseForESLint } from './parser'
  • removed: const Syntax: Readonly<typeof AST_NODE_TYPES>
  • removed: const version: any
  • removed: export { ParserServices }
  • removed: export { clearCaches } from '@typescript-eslint/typescript-estree'
  • removed: type ParserOptions = TSESLint.ParserOptions
  • added: export { ParserOptions }
  • removed: type ParserOptions = TSESLint.ParserOptions
  • added: export { ParserOptions } from '@typescript-eslint/types'