Upgrading @typescript-eslint/parser 3 to 4
Breaking3.10.1 → 4.33.0Breaking15New74Changed13Fixed147Other4
BreakingUpgrade verdict
13 breaking changes.
In plain terms
- 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.
Must act 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).
What you must change
Breaking13
Changes the ban-ts-comment default for ts-expect-error to allow-with-description.
ban-ts-commentts-expect-errorallow-with-descriptionRemoves all default options from the typedef rule.
typedefRemoves the decorators property from FunctionDeclaration, EnumDeclaration and InterfaceDeclaration nodes.
FunctionDeclarationEnumDeclarationInterfaceDeclarationdecoratorsRemoves the AST_NODE_TYPES.Import member.
AST_NODE_TYPES.ImportRemoves all defaults from the typedef rule, requiring users to explicitly opt in to each option.
typedefSupports 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-shadowFixes decorator traversal for AssignmentPattern.
AssignmentPatternno-unnecessary-condition and strict-boolean-expressions now report an error when strictNullChecks is not enabled.
no-unnecessary-conditionstrict-boolean-expressionsstrictNullChecksallowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoingSwitches typescript-estree to use globby.
globbyUpdates 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-undefparserOptions.projectFolderIgnoreList now only accepts an array of glob strings, not RegExp objects or regex strings.
parserOptions.projectFolderIgnoreListparserOptions.projectAPI changes
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)