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/vars-on-top
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
Valuable Follow-up
- N/A
Comment | File | Size | Author |
---|---|---|---|
#2 | 2915766-2.patch | 337 bytes | dawehner |
Comments
Comment #2
dawehnerHere is my little patch. Now that we dropped vars, we no longer want to put them on the top anyway :P
Comment #3
GrandmaGlassesRopeManComment #4
GrandmaGlassesRopeManComment #5
xjmI reviewed this as follows:
yarn lint:core-js-stats
against 8.5.x HEAD and saved the output.Adding issue credit for @drpal for helping me get it working (not for the lack-o-review above). ;)
Committed and pushed to 8.5.x. Thanks!
Comment #7
tim.plunkettfinally you put my vars on top
Comment #8
dawehner😂😹