Skip to content

Commit ebe92e6

Browse files
Enable import order plugin & few new React plugin rules.
1 parent 76a07ae commit ebe92e6

6 files changed

Lines changed: 26 additions & 7 deletions

File tree

CHANGELOG.md

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

4+
1.0.0-beta.4 (2016-07-20)
5+
=========================
6+
7+
* Enable [eslint-plugin-import-order](https://github.com/jfmengels/eslint-plugin-import-order)
8+
plugin
9+
* New rules:
10+
* `react/jsx-indent`
11+
* `react/no-deprecated`
12+
413
1.0.0-beta.3 (2016-07-20)
514
=========================
615

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This package provides Ezhome's `.eslintrc` as an extensible shared config.
1212
1. Install `eslint-config-ezhome` and some other ESLint dev dependencies as,
1313

1414
```
15-
npm install --save-dev babel-eslint eslint eslint-config-ezhome eslint-plugin-react
15+
npm install --save-dev eslint babel-eslint esling-plugin-import-order eslint-plugin-react eslint-config-ezhome
1616
```
1717

1818
If your project doesn't use React, you don't need to install
@@ -24,8 +24,9 @@ This package provides Ezhome's `.eslintrc` as an extensible shared config.
2424

2525
As of `1.0.0` release, `eslint-config-ezhome` prefers:
2626

27-
* `eslint@2.13.1`
28-
* `babel-eslint@6.0.5`
27+
* `eslint@3.1.1`
28+
* `babel-eslint@6.1.2`
29+
* `eslint-plugin-import-order@2.1.4`
2930
* `eslint-plugin-react@5.2.2`
3031

3132
You still able to install other versions of ESLint packages, but we recommend

alternate/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ config.rules["indent"] = [2, 2, {"SwitchCase": 1}];
66

77
if (utils.reactPluginInstalled) {
88
config.rules["react/jsx-handler-names"] = 2;
9+
config.rules["react/jsx-indent"] = [2, 2];
910
config.rules["react/jsx-indent-props"] = [2, 2];
1011
}
1112

base/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,13 @@ var config = {
6868
}
6969
};
7070

71+
if (utils.importOrderPluginInstalled) {
72+
config.extends.push("plugin:import-order/recommended");
73+
config.plugins.push("import-order");
74+
}
75+
7176
if (utils.reactPluginInstalled) {
7277
config.extends.push("plugin:react/recommended");
73-
7478
config.plugins.push("react");
7579

7680
config.rules = objectAssign(config.rules, {
@@ -80,6 +84,7 @@ if (utils.reactPluginInstalled) {
8084
"react/jsx-equals-spacing": [2, "never"],
8185
"react/jsx-first-prop-new-line": [2, "multiline"],
8286
"react/jsx-handler-names": 2,
87+
"react/jsx-indent": [2, 4],
8388
"react/jsx-indent-props": [2, 4],
8489
"react/jsx-key": 2,
8590
"react/jsx-max-props-per-line": [2, {"maximum": 4}],
@@ -93,6 +98,7 @@ if (utils.reactPluginInstalled) {
9398
"react/jsx-uses-vars": 1,
9499
"react/display-name": 1,
95100
"react/no-danger": 2,
101+
"react/no-deprecated": 2,
96102
"react/no-did-mount-set-state": [2, "allow-in-func"],
97103
"react/no-did-update-set-state": [2, "allow-in-func"],
98104
"react/no-direct-mutation-state": 2,

base/utils.js

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

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

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-config-ezhome",
3-
"version": "1.0.0-beta.3",
3+
"version": "1.0.0-beta.4",
44
"author": "Igor Davydenko",
55
"authorEmail": "igor@ezhome.com",
66
"bugs": {
@@ -25,8 +25,9 @@
2525
"object-assign": "4.1.0"
2626
},
2727
"devDependencies": {
28-
"babel-eslint": "6.0.5",
29-
"eslint": "2.13.1",
28+
"babel-eslint": "6.1.2",
29+
"eslint": "3.1.1",
30+
"eslint-plugin-import-order": "2.1.4",
3031
"eslint-plugin-react": "5.2.2"
3132
},
3233
"eslintConfig": {

0 commit comments

Comments
 (0)