Skip to content

Commit 95f6650

Browse files
Update eslint comments (Shopify#30)
* remove inline comments to fix babel compiling errors * fixes errors on node v4.x * got rid of linting error * updates for clarity
1 parent 263b797 commit 95f6650

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

.babelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"presets": [
3-
"shopify/node"
3+
"shopify"
44
],
55
"plugins": [
66
["add-shopify-header", {

.eslintrc.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
{
22
"extends": [
33
"plugin:shopify/esnext",
4-
"plugin:shopify/node",
5-
"plugin:shopify/mocha"
4+
"plugin:shopify/node"
65
],
76
"rules": {
87
"no-console": 0,

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"babel-preset-shopify": "15.0.1",
4141
"babel-register": "6.18.0",
4242
"eslint": "3.10.2",
43+
"eslint-plugin-node": "3.0.4",
4344
"eslint-plugin-shopify": "15.1.0"
4445
},
4546
"scripts": {

src/config.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import {join, normalize} from 'path';
2+
import {existsSync} from 'fs';
23
import findRoot from 'find-root';
34

45
const workingDirectory = process.cwd();
56
const currentDirectory = __dirname;
67

78
const themeRoot = findRoot(workingDirectory);
9+
const defaultGulpPath = join(themeRoot, normalize('node_modules/.bin/gulp'));
10+
// Legacy path for older versions of Node.
11+
const legacyGulpPath = join(themeRoot, normalize('node_modules/@shopify/slate-tools/node_modules/.bin/gulp'));
812

913
const config = {
1014
gulpFile: join(currentDirectory, 'gulpfile.js'),
11-
gulp: join(themeRoot, normalize('node_modules/.bin/gulp')),
15+
gulp: existsSync(defaultGulpPath) ? defaultGulpPath : legacyGulpPath,
1216
themeRoot,
1317
};
1418

0 commit comments

Comments
 (0)