This repository was archived by the owner on Aug 5, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Update Project to have ES6 Conventions #84
Open
jasecode
wants to merge
6
commits into
develop
Choose a base branch
from
add-eslint
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| extends: | ||
| - './node_modules/mobify-code-style/es6/mobify-es6-react-a11y.yml' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| exports.command = function(selector, callback) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment about exports here |
||
| var client = this; | ||
| const client = this | ||
| /* | ||
| / Use Javascript's click when Selenium's does not register. | ||
| */ | ||
| client.execute('document.querySelector("' + selector + '").click();', function(result) { | ||
| client.execute(`document.querySelector("${selector}").click();`, (result) => { | ||
| if (typeof callback === 'function') { | ||
| callback.call(client, result); | ||
| callback.call(client, result) | ||
| } | ||
| }); | ||
| }) | ||
|
|
||
| return this; | ||
| }; | ||
| return this | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,10 @@ | |
| "url": "https://github.com/mobify/nightwatch-commands/issues" | ||
| }, | ||
| "devDependencies": { | ||
| "eslint": "3.19.0", | ||
| "eslint-plugin-import": "2.2.0", | ||
| "eslint-plugin-jsx-a11y": "2.2.3", | ||
| "eslint-plugin-react": "6.10.3", | ||
| "nightwatch": "0.9.8", | ||
| "nodeunit": "0.8.4", | ||
| "grunt": "0.4.5", | ||
|
|
@@ -20,7 +24,9 @@ | |
| }, | ||
| "scripts": { | ||
| "install": "node selenium/install.js", | ||
| "test": "./node_modules/.bin/grunt lint; ./node_modules/.bin/grunt test" | ||
| "test": "./node_modules/.bin/grunt lint; ./node_modules/.bin/grunt test", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be |
||
| "lint": "npm run lint:js", | ||
| "lint:js": "eslint '**/*.{js,jsx}'" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want to double check that this blob works on Windows. I've run into issues with commands before where the quotes used for this mattered to Windows and broke things. 😞 |
||
| }, | ||
| "homepage": "https://github.com/mobify/nightwatch-commands", | ||
| "dependencies": { | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that you're using es6 everything, do you still need to create the exports object? Or can you just say:
export const command = function(...)Also, while you're at it, can you use an arrow function here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed. Unfortunately we're unable to use an arrow function due to losing the ability to call 'argument.lengths'.