From c4287e89631dde99b2913926ec819ff748786dd1 Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Thu, 21 Jul 2016 17:57:41 -0700 Subject: [PATCH 1/2] dogfood eslint config --- .eslintrc.js | 7 +++++++ package.json | 4 +++- scripts/eject.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000000..c3b79f83d16 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,7 @@ +const clientESLintConfig = require('./config/eslint'); + +module.exports = Object.assign({}, clientESLintConfig, { + env: Object.assign({}, clientESLintConfig.env, { + node: true + }) +}); diff --git a/package.json b/package.json index b65e5100421..70f7095bcc7 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ "scripts": { "start": "node scripts/start.js --debug-template", "build": "node scripts/build.js --debug-template", - "create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"" + "create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"", + "lint": "eslint --ignore-path .gitignore ./", + "prepublish": "npm run lint" }, "files": [ "LICENSE", diff --git a/scripts/eject.js b/scripts/eject.js index a945348d3e8..75c06a4b62f 100644 --- a/scripts/eject.js +++ b/scripts/eject.js @@ -69,7 +69,7 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi files.forEach(function(file) { console.log('Copying ' + file + ' to ' + hostPath); - content = fs + var content = fs .readFileSync(path.join(selfPath, file), 'utf8') // Remove license header from JS .replace(/^\/\*\*(\*(?!\/)|[^*])*\*\//, '') From 3bdd99459f37b1e29be978864d4b5bb1c6944a5c Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Thu, 21 Jul 2016 18:58:22 -0700 Subject: [PATCH 2/2] moved linting to e2e --- package.json | 4 +--- tasks/e2e.sh | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 70f7095bcc7..b65e5100421 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,7 @@ "scripts": { "start": "node scripts/start.js --debug-template", "build": "node scripts/build.js --debug-template", - "create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"", - "lint": "eslint --ignore-path .gitignore ./", - "prepublish": "npm run lint" + "create-react-app": "node global-cli/index.js --scripts-version \"$PWD/`npm pack`\"" }, "files": [ "LICENSE", diff --git a/tasks/e2e.sh b/tasks/e2e.sh index 21813326dde..e2dbf6ce378 100755 --- a/tasks/e2e.sh +++ b/tasks/e2e.sh @@ -30,6 +30,9 @@ perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' package.json npm install scripts_path=$PWD/`npm pack` +# lint +./node_modules/.bin/eslint --ignore-path .gitignore ./ + # Pack CLI cd global-cli npm install