1- var objectAssign = require ( "object-assign" ) ;
21var utils = require ( "./utils" ) ;
32
43var 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
7689if ( 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
0 commit comments