Skip to content

Upgrading @typescript-eslint/parser 3 to 4

Breaking3.10.1 → 4.33.0Breaking15New74Changed13Fixed147Other4

BreakingUpgrade verdict

13 breaking changes.

  • Comments suppressing errors with @ts-expect-error now must include a description by default.
  • The typedef rule no longer has built-in defaults, so you must configure its options explicitly.
  • Decorators on functions, enums and interfaces are now silently ignored instead of appearing in the parsed output.
  • Removes the AST_NODE_TYPES.Import member.
Top 3 of 13 that need code or config changes

Adds @typescript-eslint/scope-manager 4.33.0, debug ^4.3.1.

Drops @types/eslint-visitor-keys, @typescript-eslint/experimental-utils, eslint-visitor-keys.

Installs 34 packages in all (was 31).

Breaking13
Changes the ban-ts-comment default for ts-expect-error to allow-with-description.
ban-ts-commentts-expect-errorallow-with-description
Removes all default options from the typedef rule.
typedef
Removes the decorators property from FunctionDeclaration, EnumDeclaration and InterfaceDeclaration nodes.
FunctionDeclarationEnumDeclarationInterfaceDeclarationdecorators
Removes the AST_NODE_TYPES.Import member.
AST_NODE_TYPES.Import
Removes all defaults from the typedef rule, requiring users to explicitly opt in to each option.
typedef
Supports the new official ESTree optional chaining AST representation, replacing the previous babel-eslint style representation.
Consumes the new TypeScript-aware scope analysis package, which may require config changes and switching to new extension rules.
@typescript-eslint/no-redeclare@typescript-eslint/no-shadow
Fixes decorator traversal for AssignmentPattern.
AssignmentPattern
no-unnecessary-condition and strict-boolean-expressions now report an error when strictNullChecks is not enabled.
no-unnecessary-conditionstrict-boolean-expressionsstrictNullChecksallowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing
Switches typescript-estree to use globby.
globby
Updates the AST to the official ESTree optional chaining representation, requiring ESLint 7.5.0 or later for core rule support.
TypeScript scope analysis changes may surface new lint errors, make some eslint-disable comments unnecessary, and require parserOptions.lib for correct global types.
parserOptions.libno-undef
parserOptions.projectFolderIgnoreList now only accepts an array of glob strings, not RegExp objects or regex strings.
parserOptions.projectFolderIgnoreListparserOptions.project

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

  • removed: function analyzeScope(ast: TSESTree.Program, parserOptions: ParserOptions): ScopeManager
  • added: export { createProgram } from '@typescript-eslint/typescript-estree'
  • removed: export { ParserOptions } from '@typescript-eslint/types'
  • removed: class ScopeManager extends TSESLintScope.ScopeManager
  • removed: constructor ScopeManager(options: TSESLintScope.ScopeManagerOptions)
  • removed: method ScopeManager.__nestEmptyFunctionScope(node: TSESTree.TSDeclareFunction): TSESLintScope.Scope
  • removed: method ScopeManager.__nestEnumScope(node: TSESTree.TSEnumDeclaration): TSESLintScope.Scope
  • removed: property ScopeManager.globalScope: TSESLintScope.Scope
  • removed: property ScopeManager.scopes: TSESLintScope.Scope[]
  • removed: class EmptyFunctionScope extends TSESLintScope.Scope
  • removed: class EnumScope extends TSESLintScope.Scope
  • removed: constructor EmptyFunctionScope(scopeManager: ScopeManager, upperScope: TSESLintScope.Scope, block: TSESTree.TSDeclareFunction | null)
  • removed: constructor EnumScope(scopeManager: ScopeManager, upperScope: TSESLintScope.Scope, block: TSESTree.TSEnumDeclaration | null)