Style error information

https://eslint.org/docs/rules/spaced-comment

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

Comments

drpal created an issue. See original summary.

ApacheEx’s picture

Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new840 bytes

Here is a patch. I have also run yarn run build:js.

m1r1k’s picture

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

Status: Reviewed & tested by the community » Needs review

The comment now looks a bit odd...

  /**
  'Example failing test': (browser) => {
    browser
      // Change this to point at a site which has some console errors, as the
      // test site that was just installed doesn't.
      .url('https://www./')
      .waitForElementVisible('h1', 1000)
      // Wait for some errors to build up.
      .pause(5000)
      .assert.containsText('h1', 'I\'m the operator with my pocket calculator')
      .drupalLogAndEnd();
  },
  */

Starting with /** and ending with */ is odd.

ApacheEx’s picture

StatusFileSize
new1.66 KB
new1.15 KB

Hope, now it's better.

anmolgoyal74’s picture

Status: Needs review » Reviewed & tested by the community

Patch applied successfully.
And It is better now. Therefore marking it RTBC.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Let's change the comment to use the // style - so that it is really easy to uncomment using and IDE (eg. webstorm / phpstorm).

ie.

  // 'Example failing test': (browser) => {
  //   browser
  //     // Change this to point at a site which has some console errors, as the
  //     // test site that was just installed doesn't.
  //     .url('https://www./')
  //     .waitForElementVisible('h1', 1000)
  //     // Wait for some errors to build up.
  //     .pause(5000)
  //     .assert.containsText('h1', 'I\'m the operator with my pocket calculator')
  //     .drupalLogAndEnd();
  // },
ApacheEx’s picture

Status: Needs work » Needs review
StatusFileSize
new1.7 KB
new1.18 KB

Ah, now I got it.

GrandmaGlassesRopeMan’s picture

@ApacheEx - Sorry for this. I think the best solution right now is to remove the entire failing example test. Thank you! 😀

Status: Needs review » Needs work

The last submitted patch, 8: 2983382-7.patch, failed testing. View results

ApacheEx’s picture

Status: Needs work » Needs review
StatusFileSize
new1.24 KB

No comment - no problem :)

GrandmaGlassesRopeMan’s picture

Status: Needs review » Reviewed & tested by the community

🎉

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 45dbc22 and pushed to 8.6.x. Thanks!

  • alexpott committed ca5abe8 on 8.6.x
    Issue #2983382 by ApacheEx, drpal: JS codestyle: spaced-comment
    

Status: Fixed » Closed (fixed)

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