Problem/Motivation

Currently eslint outputs the following warning for every linted js file :

warning Definition for rule 'no-mutable-exports' was not found no-mutable-exports

This is because in eslintrc.json the "no-mutable-exports": [1], declaration in the rules block is wrong.

Proposed resolution

When using rules from a modules, the rule name must be prefixed with the module name, the line should read :

"import/no-mutable-exports": [1],

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

morsok created an issue. See original summary.

morsok’s picture

Issue summary: View changes
morsok’s picture

drpal’s picture

Status: Active » Needs review
Issue tags: +JavaScript

Status: Needs review » Needs work

The last submitted patch, 3: 2923747-wrong_declaration.patch, failed testing. View results

morsok’s picture

FileSize
410 bytes
morsok’s picture

Status: Needs work » Needs review
drpal’s picture

Status: Needs review » Reviewed & tested by the community

This is a mistake in our original implementation of our rule overrides. ➕1️⃣ ✌️

  • xjm committed df5ddd2 on 8.5.x
    Issue #2923747 by morsok, drpal: Wrong declaration of no-mutable-exports...
xjm’s picture

Version: 8.5.x-dev » 8.4.x-dev

HEAD:

[ibnsina:core | Fri 15:18:36] $ yarn run lint:core-js
yarn run v1.2.1
$ node ./node_modules/eslint/bin/eslint.js --ext=.es6.js . || exit 0

/Users/xjm/git/maintainer/core/misc/active-link.es6.js
  6:1  warning  Definition for rule 'no-mutable-exports' was not found  no-mutable-exports
  6:2  warning  Unexpected unnamed function                             func-names

Patch: no "mutable" in the output.

Committed and pushed to 8.5.x!

@drpal and I also discussed the backport of this. Since this throws an error on every lint I think it makes sense to remove the invalid rule name. However, this is effectively adding a "new" rule by correcting the name to the correct name, which is a disruptive change under https://www.drupal.org/core/d8-allowed-changes#minor.

So, can we get a backport that just removes the invalid rule, rather than changing it to the valid one? Thanks!

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Correct status.

  • xjm committed a0342fb on 8.4.x
    Issue #2923747 by morsok, drpal: Wrong declaration of no-mutable-exports...

  • xjm committed 8d99066 on 8.4.x
    Revert "Issue #2923747 by morsok, drpal: Wrong declaration of no-mutable...
xjm’s picture

I was wondering how it was that I didn't push this commit, except turns out what I didn't push was a cherry-pick despite #10. So that's the revert message; this is still in 8.5.x.

morsok’s picture

So, can we get a backport that just removes the invalid rule, rather than changing it to the valid one? Thanks!

This patch should do the trick.

morsok’s picture

Status: Needs work » Needs review

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.