You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And `src/styles/Foo.css` (or .sass, .less etc...) :
100
107
```css
101
-
.Foo{
108
+
.Foo{
102
109
border: 1pxdashed#f00;
103
110
}
104
111
```
@@ -117,7 +124,9 @@ This will give you all of react component's most common stuff :
117
124
118
125
var Foofoo =React.createClass({
119
126
mixins: [],
120
-
getInitialState:function() { return({}) },
127
+
getInitialState:function() {
128
+
return {};
129
+
},
121
130
getDefaultProps:function() {},
122
131
componentWillMount:function() {},
123
132
componentDidMount:function() {},
@@ -139,9 +148,6 @@ This will give you all of react component's most common stuff :
139
148
140
149
Just remove those you don't need, then fill and space out the rest.
141
150
142
-
143
-
144
-
145
151
### Action
146
152
147
153
When using Flux or Reflux architecture, it generates an actionCreator in `src/actions` and it's corresponding test in `src/spec/actions`.
@@ -180,14 +186,14 @@ and same test for both architectures:
180
186
```js
181
187
'use strict';
182
188
183
-
describe('BarActionCreators', function() {
184
-
var action;
189
+
describe('BarActionCreators', () => {
190
+
let action;
185
191
186
192
beforeEach(function() {
187
193
action =require('actions/BarActionCreators.js');
188
194
});
189
195
190
-
it('should be defined', function() {
196
+
it('should be defined', () => {
191
197
expect(action).toBeDefined();
192
198
});
193
199
});
@@ -246,14 +252,14 @@ and same test for both architectures:
246
252
```js
247
253
'use strict';
248
254
249
-
describe('BazStore', function() {
250
-
var store;
255
+
describe('BazStore', () => {
256
+
let store;
251
257
252
-
beforeEach(function() {
258
+
beforeEach(() => {
253
259
store =require('stores/BazStore.js');
254
260
});
255
261
256
-
it('should be defined', function() {
262
+
it('should be defined', () => {
257
263
expect(store).toBeDefined();
258
264
});
259
265
});
@@ -364,15 +370,19 @@ Out the box the [Gruntfile](http://gruntjs.com/api/grunt.file) is configured wit
364
370
1.**webpack**: uses the [grunt-webpack](https://github.com/webpack/grunt-webpack) plugin to load all required modules and output to a single JS file `src/main.js`. This is included in the `src/index.html` file by default and will reload in the browser as and when it is recompiled.
365
371
2.**webpack-dev-server**: uses the [webpack-dev-server](https://github.com/webpack/webpack-dev-server) to watch for file changes and also serve the webpack app in development.
366
372
3.**connect**: uses the [grunt-connect](https://github.com/gruntjs/grunt-contrib-connect) plugin to start a webserver at [localhost](http://localhost:8000).
367
-
4.**karma**: uses the [grunt-karma](https://github.com/karma-runner/grunt-karma) plugin to load the Karma configuration file `karma.conf.js` located in the project root. This will run all tests using [PhantomJS](http://phantomjs.org/) by default but supports many other browsers.
373
+
4.**karma**: uses the [grunt-karma](https://github.com/karma-runner/grunt-karma) plugin to load the Karma configuration file `karma.conf.js` located in the project root. This will run all tests using [PhantomJS](http://phantomjs.org/) by default but supports many other browsers. Please note that karma-launchers other than PhantomJS must be installed separately and configured in `karma.conf.js`.
368
374
369
375
### CSS
370
376
371
377
Included in the project is the [normalize.css](http://necolas.github.io/normalize.css/) script. There is also a `src/styles/main.css` script that's required by the core `src/components/App.js` component using Webpack.
372
378
373
-
### JSHint
379
+
### Linting
380
+
381
+
Webpack is automatically configured to run esLint (http://eslint.org) on every file change or build. The configuration can be found in `PROJECTROOT/.eslintrc`. There are plugins for different editors that use this tool directly:
382
+
- linter-eslint for Atom
383
+
- Sublime-Linter-eslint for Sublime
374
384
375
-
Please use [JSXHint](https://github.com/STRML/JSXHint) for linting JSX and the corresponding Sublime package if using SLT3 [SublimeLinter-jsxhint](https://github.com/SublimeLinter/SublimeLinter-jsxhint). Note this is a global npm install and JSX files will need to be associated with the JSX file type withing SLT3.
385
+
You could also use jsxhint, the corresponding rules file is located in `PROJECTROOT/.jshintrc`. However, the support for jsxhint is planned to be dropped in a later release and only available for backwards compatibility.
0 commit comments