Skip to content

Commit ae6f483

Browse files
committed
partial lint cleanup
1 parent 0f632e8 commit ae6f483

11 files changed

+26
-20
lines changed

docs/contributor-info/linters.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,23 @@ These linters support the [ShakaCode Style Guidelines](./style.md)
33

44
## Autofix!
55

6-
If you haven't tried the autofix options for `jscs` and `rubocop`, you're seriously missing out!
6+
If you haven't tried the autofix options for `eslint` and `rubocop`, you're seriously missing out!
77

88
1. Be **SURE** you have a clean git status, as you'll want to review what the autofix does to your code!
99
2. **Rubocop:** Be sure to be in the right directory where you have Ruby files, probably the top level of your Rails project.
1010
```
1111
rubocop -a
1212
```
1313

14-
3. **JSCS:**: Be sure to be in the right directory where you have JS files.
14+
3. **eslint:**: Be sure to be in the right directory where you have JS files.
1515
```
16-
jscs -x .
16+
eslint --fix .
17+
```
18+
19+
or
20+
21+
```
22+
npm run lint -- --fix
1723
```
1824

1925
Autofixing is a **HUGE** time saver!
@@ -60,5 +66,4 @@ You can disable all rules for a line or block, or only specific rules, as shown
6066
* [ESLint quick start](http://untilfalse.com/eslint-quick-start/)
6167
* [RuboCop](https://github.com/bbatsov/rubocop)
6268
* [ESLint](http://eslint.org/)
63-
* [JSCS](https://github.com/jscs-dev/node-jscs)
6469

docs/misc/doctrine.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Here's the chef's selection from the React on Rails community:
4444

4545
### JavaScript Tooling
4646
* [Babel](https://babeljs.io/): Transpiler for ES6 into ES5 and much more.
47-
* [EsLint](http://eslint.org/) and [Jsrc](http://jscs.info/): JavaScript linters.
47+
* [EsLint](http://eslint.org/)
4848
* [Webpack](http://webpack.github.io/): Generator of deployment assets and provider of hot module reloading.
4949

5050
By having a common set of tools, we can discuss what we should or shouldn't be using. Thus, this takes out the "JavaScript Fatigue" from having too many unclear choices in the JavaScript world.

node_package/tests/ComponentRegistry.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/* eslint-disable react/prefer-stateless-function */
44
/* eslint-disable react/jsx-filename-extension */
55
/* eslint-disable no-unused-vars */
6+
/* eslint-disable import/extensions */
67

78
import test from 'tape';
89
import React from 'react';

node_package/tests/buildConsoleReplay.test.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ test('consoleReplay replays converts console param objects to JSON', (assert) =>
5353
];
5454
const actual = consoleReplay();
5555

56-
const expected = `console.log.apply(console, ["some message","{\\"a\\":1,\\"b\\":2}"]);
57-
console.warn.apply(console, ["other message","{\\"c\\":3,\\"d\\":4}"]);`;
56+
const expected = `console.log.apply(console, ["some message","{"a":1,"b":2}"]);
57+
console.warn.apply(console, ["other message","{"c":3,"d":4}"]);`;
5858
assert.equals(actual, expected, 'Unexpected value for console replay history');
5959
});
6060

@@ -84,14 +84,11 @@ test('buildConsoleReplay wraps console replay in a script tag', (assert) => {
8484
];
8585
const actual = buildConsoleReplay();
8686

87-
// https://github.com/jscs-dev/node-jscs/issues/2137
88-
// jscs:disable disallowSpacesInsideTemplateStringPlaceholders
8987
const expected = `
9088
<script>
91-
console.log.apply(console, ["some message","{\\"a\\":1,\\"b\\":2}"]);
92-
console.warn.apply(console, ["other message","{\\"c\\":3,\\"d\\":4}"]);
89+
console.log.apply(console, ["some message","{"a":1,"b":2}"]);
90+
console.warn.apply(console, ["other message","{"c":3,"d":4}"]);
9391
</script>`;
9492

95-
// jscs:enable disallowSpacesInsideTemplateStringPlaceholders
9693
assert.equals(actual, expected, 'Unexpected value for console replay history');
9794
});

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"babelify": "^7.3.0",
2323
"blue-tape": "^1.0.0",
2424
"eslint": "^3.12.2",
25-
"eslint-config-shakacode": "^13.2.0",
25+
"eslint-config-shakacode": "^13.2.1",
2626
"eslint-plugin-import": "^2.2.0",
27-
"eslint-plugin-jsx-a11y": "^3.0.2",
27+
"eslint-plugin-jsx-a11y": "^2.2.3",
2828
"eslint-plugin-react": "^6.8.0",
2929
"flow-bin": "^0.37.4",
3030
"jsdom": "^9.9.1",

rakelib/docker.rake

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ namespace :docker do
1919
sh "docker-compose run lint rake lint:eslint"
2020
end
2121

22-
desc "Run jscs linter from docker"
23-
task :jscs do
24-
sh "docker-compose run lint rake lint:jscs"
25-
end
2622
desc "Run all linting from docker"
2723
task :lint do
2824
sh "docker-compose run lint rake lint"

spec/dummy/client/package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@
5050
"babel-plugin-react-transform": "^2.0.2",
5151
"body-parser": "^1.15.2",
5252
"eslint": "^3.8.1",
53-
"eslint-config-shakacode": "^6.0.0",
54-
"eslint-plugin-react": "^6.4.1",
53+
"eslint-config-shakacode": "^13.2.1",
54+
"eslint-plugin-import": "^2.2.0",
55+
"eslint-plugin-jsx-a11y": "^2.2.3",
56+
"eslint-plugin-react": "^6.8.0",
5557
"fbjs": "^0.8.5",
5658
"jsdom": "^9.8.0",
5759
"react-transform-hmr": "^1.0.4",

spec/dummy/client/server-rails-hot.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint no-var: 0, no-console: 0, import/no-extraneous-dependencies: 0 */
2+
/* eslint-disable comma-dangle */
23

34
// This file is used by the npm script:
45
// "hot-assets": "babel-node server-rails-hot.js"

spec/dummy/client/webpack.client.rails.build.config.js

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// cd client && npm run build:client
33
// Note that Foreman (Procfile.dev) has also been configured to take care of this.
44

5+
/* eslint-disable comma-dangle */
6+
57
const webpack = require('webpack');
68
const ExtractTextPlugin = require('extract-text-webpack-plugin');
79

spec/dummy/client/webpack.client.rails.hot.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// rails s
33
// cd client && babel-node server-rails-hot.js
44
// Note that Foreman (Procfile.dev) has also been configured to take care of this.
5+
/* eslint-disable comma-dangle */
56

67
const path = require('path');
78
const webpack = require('webpack');

spec/dummy/client/webpack.server.rails.build.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Common webpack configuration for server bundle
2+
/* eslint-disable comma-dangle */
23

34
const webpack = require('webpack');
45
const path = require('path');

0 commit comments

Comments
 (0)