Skip to content

Commit 2c4cf92

Browse files
Integrate eslint-plugin-import & few other rules into ESLint.
1 parent 8cb3137 commit 2c4cf92

6 files changed

Lines changed: 53 additions & 20 deletions

File tree

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v4.4.3
1+
v4.5.0

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
1.0.0 (Not Released Yet)
22
========================
33

4+
1.0.0-beta.7 (2016-08-24)
5+
=========================
6+
7+
* Bump:
8+
* `eslint` to `3.3.1`
9+
* `eslint-plugin-react` to `6.1.2`
10+
* New rules:
11+
* `no-irregular-whitespace`
12+
* `no-multi-spaces`
13+
* `no-whitespace-before-property`
14+
* `operator-linebreak`
15+
* `react/no-find-dom-node`
16+
* `react/no-danger-with-children`
17+
* Integrate [eslint-plugin-import](https://github.com/benmosher/eslint-plugin-import)
18+
as it more powerful then `eslint-plugin-import-order`
19+
* Disable `eslint-plugin-import-order`
20+
* Remove `object-assign` from project dependencies
21+
* Move to node.js `v4.5.0` for development
22+
423
1.0.0-beta.6 (2016-07-29)
524
=========================
625

base/index.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var objectAssign = require("object-assign");
21
var utils = require("./utils");
32

43
var config = {
@@ -47,6 +46,8 @@ var config = {
4746
"no-empty-function": 2,
4847
"no-eq-null": 0,
4948
"no-implicit-globals": 2,
49+
"no-irregular-whitespace": 2,
50+
"no-multi-spaces": 2,
5051
"no-multiple-empty-lines": [2, {"max": 2}],
5152
"no-nested-ternary": 2,
5253
"no-self-assign": 2,
@@ -55,7 +56,9 @@ var config = {
5556
"no-unneeded-ternary": 2,
5657
"no-unused-vars": 2,
5758
"no-useless-escape": 2,
59+
"no-whitespace-before-property": 2,
5860
"object-curly-spacing": [2, "never"],
61+
"operator-linebreak": [2, "after"],
5962
"prefer-rest-params": 2,
6063
"quotes": [2, "double", "avoid-escape"],
6164
"radix": 2,
@@ -68,16 +71,26 @@ var config = {
6871
}
6972
};
7073

71-
if (utils.importOrderPluginInstalled) {
72-
config.extends.push("plugin:import-order/recommended");
73-
config.plugins.push("import-order");
74+
if (utils.importPluginInstalled) {
75+
config.extends.push("plugin:import/errors");
76+
config.plugins.push("import");
77+
78+
config.rules = Object.assign({}, config.rules, {
79+
"import/imports-first": 2,
80+
"import/newline-after-import": 2,
81+
"import/no-amd": 2,
82+
"import/no-duplicates": 2,
83+
"import/no-restricted-paths": 2,
84+
"import/order": [2, {"newlines-between": "always"}],
85+
"import/prefer-default-export": 2
86+
});
7487
}
7588

7689
if (utils.reactPluginInstalled) {
7790
config.extends.push("plugin:react/recommended");
7891
config.plugins.push("react");
7992

80-
config.rules = objectAssign(config.rules, {
93+
config.rules = Object.assign({}, config.rules, {
8194
"react/jsx-boolean-value": [2, "never"],
8295
"react/jsx-closing-bracket-location": [2, "after-props"],
8396
"react/jsx-curly-spacing": [2, "never", {"allowMultiline": false}],
@@ -96,12 +109,15 @@ if (utils.reactPluginInstalled) {
96109
"react/jsx-space-before-closing": [2, "always"],
97110
"react/jsx-uses-react": 1,
98111
"react/jsx-uses-vars": 1,
112+
"react/jsx-wrap-multilines": 2,
99113
"react/display-name": 1,
100114
"react/no-danger": 2,
115+
"react/no-danger-with-children": 2,
101116
"react/no-deprecated": 2,
102-
"react/no-did-mount-set-state": [2, "allow-in-func"],
103-
"react/no-did-update-set-state": [2, "allow-in-func"],
117+
"react/no-did-mount-set-state": 2,
118+
"react/no-did-update-set-state": 2,
104119
"react/no-direct-mutation-state": 2,
120+
"react/no-find-dom-node": 2,
105121
"react/no-is-mounted": 2,
106122
"react/no-multi-comp": 2,
107123
"react/no-unknown-property": 2,
@@ -147,9 +163,7 @@ if (utils.reactPluginInstalled) {
147163
]
148164
}
149165
}],
150-
"react/sort-prop-types": [2, {"ignoreCase": true}],
151-
"react/wrap-multilines": 2
152-
166+
"react/sort-prop-types": [2, {"ignoreCase": true}]
153167
});
154168
}
155169

base/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ var hasModuleInstalled = function(name) {
99
};
1010

1111
module.exports = {
12-
importOrderPluginInstalled: hasModuleInstalled("esling-plugin-import-order"),
12+
importPluginInstalled: hasModuleInstalled("eslint-plugin-import"),
1313
reactPluginInstalled: hasModuleInstalled("eslint-plugin-react")
1414
};

circle.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ machine:
22
environment:
33
LEVEL: development
44
node:
5-
version: 4.4.3
5+
version: 4.5.0
66
timezone:
77
America/Los_Angeles
88

99
dependencies:
1010
cache_directories:
1111
- node_modules
1212
override:
13+
- npm install -g npm@3.10.6
1314
- make
1415

1516
test:

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "eslint-config-ezhome",
3-
"version": "1.0.0-beta.6",
4-
"author": "Igor Davydenko",
5-
"authorEmail": "igor@ezhome.com",
3+
"version": "1.0.0-beta.7",
4+
"author": "Ezhome Engineers",
5+
"authorEmail": "engineers@ezhome.com",
66
"bugs": {
77
"url": "https://github.com/ezhome/eslint-config-ezhome/issues"
88
},
@@ -23,10 +23,9 @@
2323
},
2424
"dependencies": {
2525
"babel-eslint": "6.1.2",
26-
"eslint": "3.1.1",
27-
"eslint-plugin-import-order": "2.1.4",
28-
"eslint-plugin-react": "5.2.2",
29-
"object-assign": "4.1.0"
26+
"eslint": "3.3.1",
27+
"eslint-plugin-import": "1.14.0",
28+
"eslint-plugin-react": "6.1.2"
3029
},
3130
"engines": {
3231
"node": ">= 4",

0 commit comments

Comments
 (0)