From c3c4a5b015e3f557c8ebdff7446a32384606b45b Mon Sep 17 00:00:00 2001 From: Kevin E Meraz Date: Thu, 2 Jun 2016 15:33:58 -0700 Subject: [PATCH 1/4] Modify to include ES6 linting --- .DS_Store | Bin 0 -> 6148 bytes .eslintrc | 10 ++++++++++ README.md | 2 +- client/.DS_Store | Bin 0 -> 6148 bytes client/app.jsx | 20 ++++++++++---------- client/index.html | 2 +- client/index.jsx | 8 ++++++++ npm-debug.log | 34 ++++++++++++++++++++++++++++++++++ package.json | 41 ++++++++++++++++++++++++++++------------- webpack.config.js | 20 +++++++++++++------- 10 files changed, 105 insertions(+), 32 deletions(-) create mode 100644 .DS_Store create mode 100644 .eslintrc create mode 100644 client/.DS_Store create mode 100644 client/index.jsx create mode 100644 npm-debug.log diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..674c9fbe70978d74320050611266275dba3fb0c7 GIT binary patch literal 6148 zcmeHKJ8r`;3?k8QSp}-Am;vDFo4h-G`09OdRVeY*I zuvh?C6X!rgU>a0lP&Hc&4Laf_^J?N87`>Hi$N9z6MQb2ODnJEp6?lwg zXZ8OD{!9OVOX7+OP=SA?fUbtup~sW5wlH1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0Hello, World; - }, + } -}); +} -render ( - , - document.getElementById('app') -); \ No newline at end of file +export default App; diff --git a/client/index.html b/client/index.html index 71adb8c..a7bf844 100644 --- a/client/index.html +++ b/client/index.html @@ -6,6 +6,6 @@
- + \ No newline at end of file diff --git a/client/index.jsx b/client/index.jsx new file mode 100644 index 0000000..c5d10c8 --- /dev/null +++ b/client/index.jsx @@ -0,0 +1,8 @@ +import React from 'react'; +import App from './app.jsx'; +import { render } from 'react-dom'; + +render( + , + document.getElementById('app') +); diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 0000000..c445df5 --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,34 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/local/Cellar/node/5.10.0/bin/node', +1 verbose cli '/usr/local/bin/npm', +1 verbose cli 'start' ] +2 info using npm@3.8.3 +3 info using node@v5.10.0 +4 verbose stack Error: Failed to parse json +4 verbose stack Trailing comma in object at 12:3 +4 verbose stack }, +4 verbose stack ^ +4 verbose stack at parseError (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:379:11) +4 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:68:23) +4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:48:5 +4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16 +4 verbose stack at tryToString (fs.js:414:3) +4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12) +5 verbose cwd /Users/Kevin/hr41/reactBoilerplate +6 error Darwin 15.4.0 +7 error argv "/usr/local/Cellar/node/5.10.0/bin/node" "/usr/local/bin/npm" "start" +8 error node v5.10.0 +9 error npm v3.8.3 +10 error file /Users/Kevin/hr41/reactBoilerplate/package.json +11 error code EJSONPARSE +12 error Failed to parse json +12 error Trailing comma in object at 12:3 +12 error }, +12 error ^ +13 error File: /Users/Kevin/hr41/reactBoilerplate/package.json +14 error Failed to parse package.json data. +14 error package.json must be actual JSON, not just JavaScript. +14 error +14 error This is not a bug in npm. +14 error Tell the package author to fix their package.json file. JSON.parse +15 verbose exit [ 1, true ] diff --git a/package.json b/package.json index beedd55..742a717 100644 --- a/package.json +++ b/package.json @@ -1,33 +1,48 @@ { - "name": "reactboilerplate", + "name": "ReactBoilerplate", "version": "1.0.0", - "description": "Boilerplate repo for React/Webpack/Babel apps", + "description": "Boilerplate repo for React/Webpack/Babel app", "main": "./client/index.html", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "karma start", "start": "webpack-dev-server --inline --hot --content-base client/" }, "repository": { - "type": "git", - "url": "git+https://github.com/naomiajacobs/reactBoilerplate.git" + "type": "git" }, - "author": "Naomi Jacobs", - "license": "ISC", + "license": "MIT", "bugs": { - "url": "https://github.com/naomiajacobs/reactBoilerplate/issues" }, - "homepage": "https://github.com/naomiajacobs/reactBoilerplate#readme", "dependencies": { + "autoprefixer": "^6.3.6", "babel": "^6.1.18", "babel-core": "^6.2.1", "babel-loader": "^6.2.0", "babel-preset-es2015": "^6.1.18", "babel-preset-react": "^6.1.18", - "react": "^0.14.3", - "react-dom": "^0.14.3", - "webpack": "^1.12.9" + "eslint": "^2.7.0", + "eslint-config-airbnb": "^7.0.0", + "eslint-loader": "^1.3.0", + "eslint-plugin-jsx-a11y": "^0.6.2", + "eslint-plugin-react": "^4.3.0", + "extract-text-webpack-plugin": "^1.0.1", + "jasmine-core": "^2.4.1", + "node-sass": "^3.4.2", + "nodemon": "^1.9.1", + "react": "^15.0.0", + "react-dom": "^15.0.0", + "redux": "^3.4.0", + "webpack": "^1.12.14" }, "devDependencies": { - "webpack-dev-server": "^1.14.0" + "jasmine": "^2.4.1", + "karma": "^0.13.22", + "karma-chrome-launcher": "^0.2.3", + "karma-firefox-launcher": "^0.1.7", + "karma-jasmine": "^0.3.8", + "karma-sourcemap-loader": "^0.3.7", + "karma-spec-reporter": "0.0.26", + "karma-webpack": "^1.7.0", + "react-addons-test-utils": "^15.0.0" } } diff --git a/webpack.config.js b/webpack.config.js index 43387ef..736261d 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,14 +7,14 @@ module.exports = { // the top-level file that then `requires` some other files, which then // `require` some other files, etc. Webpack pulls these all into a modularized // bundle. - entry: './client/app.jsx', + entry: './client/index.jsx', // `output` is an object with options for the bundle that Webpack creates // out of your source files. output: { // `path` is a path to the directory where your bundle will be written. - path: 'dist', + path: 'client/dist', // `publicPath` is optional. It allows you to set a separate path that will // be used by any lazy-loading in your Webpack scripts to load more chunks @@ -22,7 +22,7 @@ module.exports = { // your bundle will be written, while `publicPath` tells your Webpack modules // where your bundle can be requested from the server. In this repo, `publicPath` // tells the webpack-dev-server that it's ok to serve the files in the dist folder. - publicPath: 'dist', + publicPath: 'client/dist', // `filename` tells Webpack what to call the file/files it outputs. filename: 'bundle.js', @@ -55,7 +55,7 @@ module.exports = { // this object requires 'babel-loader' to do the transformation. // We could actually apply multiple loaders here by using the property `loaders` // instead of `loader`, which takes an array of loader names. - // + // // When you're declaring loaders in this field, you can leave off the `-loader` part // of the package name. Webpack will interpret `babel` as `babel-loader` here, // `coffee` as `coffee-loader`, etc. But you can also just write out `babel-loader`, @@ -69,9 +69,15 @@ module.exports = { // loader: 'babel?presets[]=react,presets[]=es2015' query: { presets: ['react', 'es2015'], - } + }, }, - ] - } + + { + test: /\.jsx?$/, + loader: 'eslint-loader', + exclude: /node_modules/, + }, + ], + }, }; From 358a7e1d84c7030dc082d550d6d93ab039cedf72 Mon Sep 17 00:00:00 2001 From: Alexander Turinske Date: Thu, 2 Jun 2016 17:24:58 -0700 Subject: [PATCH 2/4] Update to ignore log files --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 04c01ba..660e523 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -dist/ \ No newline at end of file +dist/ +npm-debug.log* From ab391d4bdd2e4fc154acc12b11f66517ed37ffac Mon Sep 17 00:00:00 2001 From: Alexander Turinske Date: Thu, 2 Jun 2016 17:24:58 -0700 Subject: [PATCH 3/4] Update to ignore log files --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 04c01ba..660e523 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules/ -dist/ \ No newline at end of file +dist/ +npm-debug.log* From 47573a4216fa1d2af1cda1050d8b2f4ae3d3775c Mon Sep 17 00:00:00 2001 From: Alexander James Turinske Date: Thu, 2 Jun 2016 17:41:20 -0700 Subject: [PATCH 4/4] Remove log file --- npm-debug.log | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 npm-debug.log diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index c445df5..0000000 --- a/npm-debug.log +++ /dev/null @@ -1,34 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/Cellar/node/5.10.0/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'start' ] -2 info using npm@3.8.3 -3 info using node@v5.10.0 -4 verbose stack Error: Failed to parse json -4 verbose stack Trailing comma in object at 12:3 -4 verbose stack }, -4 verbose stack ^ -4 verbose stack at parseError (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:379:11) -4 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:68:23) -4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/read-package-json/read-json.js:48:5 -4 verbose stack at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:78:16 -4 verbose stack at tryToString (fs.js:414:3) -4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:401:12) -5 verbose cwd /Users/Kevin/hr41/reactBoilerplate -6 error Darwin 15.4.0 -7 error argv "/usr/local/Cellar/node/5.10.0/bin/node" "/usr/local/bin/npm" "start" -8 error node v5.10.0 -9 error npm v3.8.3 -10 error file /Users/Kevin/hr41/reactBoilerplate/package.json -11 error code EJSONPARSE -12 error Failed to parse json -12 error Trailing comma in object at 12:3 -12 error }, -12 error ^ -13 error File: /Users/Kevin/hr41/reactBoilerplate/package.json -14 error Failed to parse package.json data. -14 error package.json must be actual JSON, not just JavaScript. -14 error -14 error This is not a bug in npm. -14 error Tell the package author to fix their package.json file. JSON.parse -15 verbose exit [ 1, true ]