Upgrading @typescript-eslint/parser 1 to 2
Breaking1.13.0 → 2.34.0Breaking12Platform1New121Changed17Fixed150Other8
BreakingUpgrade verdict
12 breaking changes and a platform requirement change.
In plain terms
- TypeScript-specific rules may now report on JS files in mixed codebases; use ESLint overrides to control which files rules apply to.
- Removes deprecated rule prefer-interface, replaced by consistent-type-definitions.
- Removes deprecated rule no-triple-slash-reference, replaced by triple-slash-reference.
- explicit-function-return-type no longer treats export default () => {} as an expression for allowExpressions.
Must act Top 4 of 13 that need code or config changes
Node.js requirement changed in 2.34.0: ^6.14.0 || ^8.10.0 || >=9.10.0 → ^8.10.0 || ^10.13.0 || >=11.10.1.
Installs 29 packages in all (was 11).
What you must change
Breaking12
Removes hardcoded checks that prevented some rules from running on non-TypeScript files.
Removes deprecated rule prefer-interface, replaced by consistent-type-definitions.
prefer-interfaceconsistent-type-definitionsRemoves deprecated rule no-triple-slash-reference, replaced by triple-slash-reference.
no-triple-slash-referencetriple-slash-referenceexplicit-function-return-type no longer treats export default () => {} as an expression for allowExpressions.
explicit-function-return-typeallowExpressionsChanges default rule configs: explicit-function-return-type, no-inferrable-types and no-this-alias options now default differently.
explicit-function-return-typeallowTypedFunctionExpressionsallowHigherOrderFunctionsno-inferrable-typesignoreParametersignorePropertiesno-this-aliasallowDestructuringRemoves deprecated rules from eslint-plugin.
Removes Rule.meta.extraDescription from experimental-utils.
Rule.meta.extraDescriptionHard fails when parsing files not included in the tsconfig(s) given via parserOptions.project.
parserOptions.projectparserOptions.extraFileExtensionsMerges no-angle-bracket-type-assertion and no-object-literal-type-assertion into consistent-type-assertions.
no-angle-bracket-type-assertionno-object-literal-type-assertionconsistent-type-assertionsReworks the recommended configs into recommended, recommended-requiring-type-checking, eslint-recommended and all.
plugin:@typescript-eslint/recommendedplugin:@typescript-eslint/recommended-requiring-type-checkingplugin:@typescript-eslint/eslint-recommendedplugin:@typescript-eslint/allReworks the options for the [array-type] rule.
array-typeThrows an error on files not in the project when
project is set.projectPlatform1
Drops support for Node 6, which is end of life and no longer supported by ESLint v6.
API changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- changed:
function analyzeScope(ast: any, parserOptions: ParserOptions): ScopeManager → function analyzeScope(ast: TSESTree.Program, parserOptions: ParserOptions): ScopeManager
- changed:
function parse(code: string, options?: ParserOptions): any → function parse(code: string, options?: ParserOptions): ParseForESLintResult['ast'] - added:
export { clearCaches } from '@typescript-eslint/typescript-estree'
- removed:
function simpleTraverse(startingNode: TSESTree.Node, options: SimpleTraverseOptions): void
- removed:
const visitorKeys: eslintVisitorKeys.VisitorKeys