Problem/Motivation

We are updating eslint as part of #3101543: Update core JavaScript dependencies listed in package.json.

It seems like eslint 5.4.0 introduced .eslintrc overrides, and for that reason, .eslintrc files are being read from subfolders.

There's an invalid .eslintrc.json file in the scaffold fixtures which leads to following error message:

Failed to read JSON file at /Users/lauri.eskola/Projects/drupal/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-assets-fixture/assets/.eslintrc.json.

Proposed resolution

Make the file a valid .eslintrc.json file so that it doesn't lead into an error.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3101556-2.patch542 byteslauriii

Comments

lauriii created an issue. See original summary.

lauriii’s picture

Status: Active » Needs review
StatusFileSize
new542 bytes
lauriii’s picture

This problem can be reproduced by running ./node_modules/.bin/eslint --config=tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-assets-fixture/assets/.eslintrc.json . in the ./core folder.

lauriii’s picture

Version: 9.0.x-dev » 8.9.x-dev
Issue tags: +Drupal 9
phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

Confirmed the bug and the fix.

Running npx eslint --config=tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-assets-fixture/assets/.eslintrc.json . in HEAD yielded this error:

Cannot read config file: /Users/phen/Sites/drupal/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-assets-fixture/assets/.eslintrc.json
Error: Unexpected end of JSON input

After applying the patch, I got a full eslint report as expected. So, marking this RTBC on the presumption that it will pass tests.

  • alexpott committed 1012c94 on 9.0.x
    Issue #3101556 by lauriii, phenaproxima: Invalid .eslintrc.json file in...

  • alexpott committed 9ed2d8e on 8.9.x
    Issue #3101556 by lauriii, phenaproxima: Invalid .eslintrc.json file in...
alexpott’s picture

Version: 8.9.x-dev » 8.8.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed and pushed 1012c94717 to 9.0.x and 9ed2d8e183 to 8.9.x. Thanks!

Will backport to 8.8.x once it is unfrozen.

alexpott’s picture

Status: Patch (to be ported) » Fixed

  • alexpott committed 490201e on 8.8.x
    Issue #3101556 by lauriii, phenaproxima: Invalid .eslintrc.json file in...

Status: Fixed » Closed (fixed)

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