From 9ad368fd7cabfe7bd1a0dc6c42b7ca67c2707063 Mon Sep 17 00:00:00 2001 From: Steve Bosworth Date: Thu, 24 Nov 2016 10:58:19 -0500 Subject: [PATCH] Update eslint comments (#30) * remove inline comments to fix babel compiling errors * fixes errors on node v4.x * got rid of linting error * updates for clarity --- packages/slate-tools/.babelrc | 2 +- packages/slate-tools/.eslintrc.json | 3 +-- packages/slate-tools/package.json | 1 + packages/slate-tools/src/config.js | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/slate-tools/.babelrc b/packages/slate-tools/.babelrc index fce542583..cffbb129f 100644 --- a/packages/slate-tools/.babelrc +++ b/packages/slate-tools/.babelrc @@ -1,6 +1,6 @@ { "presets": [ - "shopify/node" + "shopify" ], "plugins": [ ["add-shopify-header", { diff --git a/packages/slate-tools/.eslintrc.json b/packages/slate-tools/.eslintrc.json index ebd2728b0..18a197fe8 100644 --- a/packages/slate-tools/.eslintrc.json +++ b/packages/slate-tools/.eslintrc.json @@ -1,8 +1,7 @@ { "extends": [ "plugin:shopify/esnext", - "plugin:shopify/node", - "plugin:shopify/mocha" + "plugin:shopify/node" ], "rules": { "no-console": 0, diff --git a/packages/slate-tools/package.json b/packages/slate-tools/package.json index 055f46cda..375c867aa 100644 --- a/packages/slate-tools/package.json +++ b/packages/slate-tools/package.json @@ -40,6 +40,7 @@ "babel-preset-shopify": "15.0.1", "babel-register": "6.18.0", "eslint": "3.10.2", + "eslint-plugin-node": "3.0.4", "eslint-plugin-shopify": "15.1.0" }, "scripts": { diff --git a/packages/slate-tools/src/config.js b/packages/slate-tools/src/config.js index 3c73577b0..a76025bdc 100644 --- a/packages/slate-tools/src/config.js +++ b/packages/slate-tools/src/config.js @@ -1,14 +1,18 @@ import {join, normalize} from 'path'; +import {existsSync} from 'fs'; import findRoot from 'find-root'; const workingDirectory = process.cwd(); const currentDirectory = __dirname; const themeRoot = findRoot(workingDirectory); +const defaultGulpPath = join(themeRoot, normalize('node_modules/.bin/gulp')); +// Legacy path for older versions of Node. +const legacyGulpPath = join(themeRoot, normalize('node_modules/@shopify/slate-tools/node_modules/.bin/gulp')); const config = { gulpFile: join(currentDirectory, 'gulpfile.js'), - gulp: join(themeRoot, normalize('node_modules/.bin/gulp')), + gulp: existsSync(defaultGulpPath) ? defaultGulpPath : legacyGulpPath, themeRoot, };