Problem/Motivation

We are currently on eslint 7.32.0 but the latest version is 8.9.0.

Steps to reproduce

Update to eslint 8.9.0 on Drupal 10.0.x. Evaluate what's the impact of backporting this to 9.4.x since the core eslint is provided as an API by DrupalCI.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Eslint is updated to 8.9.0. core/.eslintrc.passing.json has been updated to reflect the new rules.

Issue fork drupal-3265618

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

longwave made their first commit to this issue’s fork.

longwave’s picture

Status: Active » Needs review

Upgrade is straightforward, three new rules that we need to skip for now:

core/modules/views_ui/js/views-admin.es6.js
  47:23  error  Use a regular expression literal instead of the 'RegExp' constructor  prefer-regex-literals

core/tests/Drupal/Nightwatch/Assertions/deprecationErrorExists.js
  10:13  error  Use a regular expression literal instead of the 'RegExp' constructor  prefer-regex-literals

core/tests/Drupal/Nightwatch/Assertions/noDeprecationErrors.js
  10:13  error  Use a regular expression literal instead of the 'RegExp' constructor  prefer-regex-literals

core/tests/Drupal/Nightwatch/Commands/drupalInstall.js
   1:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
   2:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
   3:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  22:3  error  Default parameters should be last                                                                                    default-param-last

core/tests/Drupal/Nightwatch/Commands/drupalLoginAsAdmin.js
  1:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  2:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  3:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports

core/tests/Drupal/Nightwatch/Commands/drupalLogout.js
   1:1   error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
   2:1   error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  16:41  error  Default parameters should be last                                                                                    default-param-last

core/tests/Drupal/Nightwatch/Commands/drupalUninstall.js
  1:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  2:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports

core/tests/Drupal/Nightwatch/globals.js
  1:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  2:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  3:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  4:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  5:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  6:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports

core/tests/Drupal/Nightwatch/nightwatch.conf.js
  1:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports
  2:1  error  Cannot use import declarations in modules that export using CommonJS (module.exports = 'foo' or exports.bar = 'hi')  import/no-import-module-exports

✖ 23 problems (23 errors, 0 warnings)
lauriii’s picture

Issue tags: +Needs followup

Thank you @longwave! We should open follow-ups for removing those overrides

nod_ made their first commit to this issue’s fork.

nod_’s picture

checked the 10.x and 9.4 branch, all good.

nod_’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Version: 10.0.x-dev » 9.4.x-dev
Issue summary: View changes
Status: Reviewed & tested by the community » Fixed
Issue tags: +9.4.0 release notes

Committed 87b8b64 and pushed to 10.0.x. Thanks!
Committed c16dfb4 and pushed to 9.4.x. Thanks!

  • alexpott committed 87b8b64 on 10.0.x
    Issue #3265618 by longwave, nod_, lauriii: Update to eslint 8
    

  • alexpott committed c16dfb4 on 9.4.x
    Issue #3265618 by longwave, nod_, lauriii: Update to eslint 8
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

xjm’s picture

Issue tags: +10.0.0 release notes
quietone’s picture

Issue tags: -Needs followup

In #5 a followup was asked for, to remove the skips added to core/.eslintrc.passing.json. I searched and found that here is already a Meta for that, #2912962: Step 1 JS codestyle: [meta] Fix JS coding standards in core, so I am removing the tag.