@@ -11,7 +11,6 @@ module.exports = {
1111 allowForLoopAfterthoughts : true ,
1212 } ,
1313 ] ,
14- camelcase : 'off' ,
1514 'react/jsx-filename-extension' : 'off' ,
1615 'react-hooks/rules-of-hooks' : 'error' ,
1716 'react-hooks/exhaustive-deps' : 'warn' ,
@@ -23,4 +22,55 @@ module.exports = {
2322 'func-names' : 'off' ,
2423 'lines-between-class-members' : 'off' ,
2524 'import/extensions' : [ 'error' , 'never' ] ,
25+ // ===================================
26+ // Some rules from eslint-plugin-babel
27+ // ===================================
28+ // First turn them off
29+ 'new-cap' : 'off' ,
30+ camelcase : 'off' ,
31+ 'no-invalid-this' : 'off' ,
32+ 'object-curly-spacing' : 'off' ,
33+ semi : 'off' ,
34+ 'no-unused-expressions' : 'off' ,
35+ 'valid-typeof' : 'off' ,
36+ // require a capital letter for constructors
37+ 'babel/new-cap' : [
38+ 'error' ,
39+ {
40+ newIsCap : true ,
41+ newIsCapExceptions : [ ] ,
42+ capIsNew : false ,
43+ capIsNewExceptions : [ 'Immutable.Map' , 'Immutable.Set' , 'Immutable.List' ] ,
44+ } ,
45+ ] ,
46+ // require camel case names
47+ // This one is enhanced from airbnb and accounts for destructuring
48+ // and react UNSAFE_component* methods.
49+ 'babel/camelcase' : [
50+ 'error' ,
51+ {
52+ properties : 'never' ,
53+ ignoreDestructuring : true ,
54+ } ,
55+ ] ,
56+ // We would force invalid this rules
57+ // But would only warn about it
58+ 'babel/no-invalid-this' : 'warn' ,
59+ // We don't configure curly spacing because of prettier
60+ 'babel/object-curly-spacing' : 'off' ,
61+ // We don't configure babel/semi because of prettier
62+ 'babel/semi' : 'off' ,
63+ // disallow usage of expressions in statement position
64+ 'babel/no-unused-expressions' : [
65+ 'error' ,
66+ {
67+ allowShortCircuit : false ,
68+ allowTernary : false ,
69+ allowTaggedTemplates : false ,
70+ } ,
71+ ] ,
72+ // ensure that the results of typeof are compared against a valid string
73+ // https://eslint.org/docs/rules/valid-typeof
74+ 'babel/valid-typeof' : [ 'error' , { requireStringLiterals : true } ] ,
75+ 'no-unused-vars' : 'warn' ,
2676} ;
0 commit comments