From 8c7434c91c49c07ecc22fd20a88e0623f8d2bda7 Mon Sep 17 00:00:00 2001 From: Michael LaCroix Date: Wed, 26 Apr 2017 16:19:12 -0500 Subject: [PATCH] Fix the eslint config when using the CLI (#82) --- packages/react-scripts/package.json | 2 +- packages/react-scripts/scripts/lint.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 0b3836f9aa7..28ea19efd4b 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -1,6 +1,6 @@ { "name": "@trunkclub/build", - "version": "6.1.0", + "version": "6.1.1", "upstream-version": "0.8.4", "description": "Configuration and scripts for Create React App. Fork maintained by Trunk Club", "repository": "trunkclub/create-react-app", diff --git a/packages/react-scripts/scripts/lint.js b/packages/react-scripts/scripts/lint.js index 726ecd202d7..70430a4a4b0 100644 --- a/packages/react-scripts/scripts/lint.js +++ b/packages/react-scripts/scripts/lint.js @@ -7,6 +7,12 @@ var config = require('@trunkclub/eslint-config'); config.fix = true; config.extensions = ['.js', '.jsx', '.es6']; +// CLIEngine env config differs from .eslintrc +// http://eslint.org/docs/developer-guide/nodejs-api#cliengine +config.envs = Object + .keys(config.env) + .filter(envKey => config.env[envKey]) + var eslint = new CLIEngine(config); var report = eslint.executeOnFiles([paths.appSrc]);