Skip to content

Upgrading eslint 4 to 5

Breaking4.19.1 → 5.16.0Breaking20Security2Deprecated1New16Changed72Fixed76Other224

BreakingUpgrade verdict

20 breaking changes and 2 security fixes.

  • New object-curly-newline/no-self-assign default.
  • Remove TDZ scopes.
  • Remove extra check in getScope (fixes ).
  • Remove deprecated browser/jest/node globals.
Top 5 of 23 that need code or config changes

eslint publishes an official migration guide for version 5. It covers more than the release notes do.

Migration guide ↗

Node.js requirement changed in 5.0.0-alpha.1: >=4 → ^6.14.0 || ^8.10.0 || >=9.10.0.

Adds @babel/code-frame ^7.0.0, eslint-utils ^1.3.1, import-fresh ^3.0.0.

Drops babel-code-frame, concat-stream, is-resolvable, pluralize, require-uncached.

Installs 118 packages in all (was 130).

Also installs @babel/helper-validator-identifier, astral-regex, emoji-regex, flatted, nice-try, parent-module, path-key, picocolors, punycode, rxjs, tslib, uri-js.

No longer installs ajv-keywords, buffer-from, caller-path, circular-json, co, core-util-is, graceful-fs, has-ansi, isarray, lru-cache, object-assign, process-nextick-args, pseudomap, readable-stream, rx-lite and 6 more.

Moves acorn 3.3.0, 5.7.4 → 6.4.2, acorn-jsx 3.0.1 → 5.3.2, ajv 5.5.2 → 6.15.0, ansi-regex 2.1.1, 3.0.1 → 3.0.1, 4.1.1, ansi-styles 2.2.1, 3.2.1 → 3.2.1, callsites 0.2.0 → 3.1.0, chalk 1.1.3, 2.4.2 → 2.4.2, chardet 0.4.2 → 0.7.0, cross-spawn 5.1.0 → 6.0.6, debug 3.2.7 → 4.4.3, doctrine 2.1.0 → 3.0.0, eslint-scope 3.7.3 → 4.0.3, espree 3.5.4 → 5.0.1, external-editor 2.2.0 → 3.1.0, fast-deep-equal 1.1.0 → 3.1.3 and 14 more. Your build may pick other versions.

Breaking20
New object-curly-newline/no-self-assign default.
Remove TDZ scopes.
Remove extra check in getScope (fixes ).
Remove deprecated browser/jest/node globals.
Drop supporting Node.js 4.
Remove special exception for linting empty files.
Remove source property from linting messages.
source
Report multiline eslint-disable-line directives.
Report fatal error for linting nonexistent files.
9100819 Breaking: fix plugin resolver in extends.
Add rules to recommended.
Stop using fake context._linter property.
context._linter
2324570 Breaking: no-unused-vars reports all after-used params.
Upgrade to Espree v4 alpha.
Support @scope shorthand in plugins.
Require rules to provide report messages.
Make require('eslint').linter non-enumerable.
Set parent of AST nodes before rules run.
parent
Use an exit code of 2 for fatal config problems.
Use strict equality in RuleTester comparisons.
Security2
Bump js-yaml dependency to fix Denial of Service vulnerability.
Add information about reporting security issues.
Deprecated1
9152417 Fix: deprecation warning in RuleTester using Node v11.