Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Style error information
https://eslint.org/docs/rules/prefer-rest-params
Remark
- Code refactoring. Review it carefully :)
How to Review
## 1. Apply Patch
## 2. Review Code Changes
## 3. Confirm no Code Standard Errors
yarn & yarn lint:core-js-passing
## 4.1 If `NO` errors, mark the issue as `Reviewed & tested by the community` (Don't be shy, we're all friendly)
## 4.2 If `HAS` errors, fix it and upload a new patch (Just do it and you can!!!)
Background
- #2912962: Step 1 JS codestyle: [meta] Fix JS coding standards in core
- We adapted the airbnb coding standard (#2815077: Adopt airbnb javascript style guide v14.1 as new baseline javascript coding standards for Drupal 8 core and contrib), but we are not fully compliant to it yet.
More Information
- Using ES6 in Core
https://www.drupal.org/node/2815083
- To find JS code standard errors stats
cd core/ && yarn & yarn lint:core-js-stats
Comment | File | Size | Author |
---|---|---|---|
#13 | 2915534-13.patch | 3.92 KB | GrandmaGlassesRopeMan |
#9 | 2915534-9.patch | 3.92 KB | GrandmaGlassesRopeMan |
#6 | 2915534-6.patch | 3.9 KB | GrandmaGlassesRopeMan |
#6 | interdiff-2915534-4-6.txt | 873 bytes | GrandmaGlassesRopeMan |
#4 | 2915534-4.patch | 3.86 KB | GrandmaGlassesRopeMan |
Comments
Comment #2
GrandmaGlassesRopeManComment #4
GrandmaGlassesRopeManComment #5
nod_ca do this no?
return Drupal.theme[func](...args);
Comment #6
GrandmaGlassesRopeManThanks @nod_! 🤘
Comment #7
dawehnerIts a bit sad that babel copies everything manually, but I guess its not really something to worry about.
Nice simplification
Comment #9
GrandmaGlassesRopeManComment #10
dawehnerB2RTBC
Comment #11
GrandmaGlassesRopeMan🤘
Comment #12
borisson_Patch no longer applies, because of
error: core/.eslintrc.passing.json: patch does not apply
.Comment #13
GrandmaGlassesRopeManReroll death spiral continues.
Comment #14
borisson_Patch applies, back to rtbc - I'm assuming the bot will confirm.
Comment #15
alexpottHere's why we do this: https://github.com/airbnb/javascript#es6-rest
Crediting @nod_ for their review.
Comment #16
alexpottCommitted cf52b41 and pushed to 8.5.x. Thanks!