1
+ /**
2
+ |--------------------------------------------------
3
+ | sudo npm install -g eslint@latest eslint-plugin-import@latest babel-eslint
4
+ |--------------------------------------------------
5
+ */
6
+ module . exports = {
7
+ extends : [
8
+ "eslint:recommended" ,
9
+ ] ,
10
+ env : {
11
+ browser : true ,
12
+ commonjs : true ,
13
+ es6 : true ,
14
+ node : true ,
15
+ jquery : true ,
16
+ amd : true ,
17
+ mocha : true ,
18
+ jasmine : true ,
19
+ phantomjs : true ,
20
+ worker : true ,
21
+ jest : true
22
+ } ,
23
+ parser : "babel-eslint" ,
24
+ parserOptions : {
25
+ "sourceType" : "module" , // import export syntax
26
+ "ecmaVersion" : 2017 // async await syntax
27
+ } ,
28
+ rules : { // 0: allow, 1: warning, 2: error
29
+ "no-tabs" : 2 , // no tabs in code
30
+ "no-empty" : 0 ,
31
+ 'no-console' : 0 ,
32
+ "curly" : 2 ,
33
+ "no-global-assign" : 0 , // allow global variables to be modified
34
+ "no-constant-condition" : 0 , // allow: while(true) { ... }
35
+ "no-control-regex" : 0 , // allow regex
36
+ "no-redeclare" : 0 , // allow redeclare a variable
37
+ "no-inner-declarations" : 0 , // allow define functions inside functions
38
+ "indent" : [ "error" , 2 , {
39
+ "ObjectExpression" : "first" ,
40
+ "ArrayExpression" : "first"
41
+ } ] , // 2 spaces for indentation and consistent alignment
42
+ "arrow-spacing" : 2 ,
43
+ "no-unused-vars" : 0 ,
44
+ "keyword-spacing" : 2 ,
45
+ "no-useless-escape" : 0 ,
46
+ "brace-style" : 2 , // enforce open bracket in same line
47
+ "multiline-comment-style" : [ 2 , "starred-block" ] , // enforce commented block style
48
+ "object-curly-newline" : [ 2 , { "multiline" : true } ] , // enforce obj items identation
49
+ "operator-linebreak" : [ 2 , "before" ] , // break operator to new line
50
+ "space-infix-ops" : 2 ,
51
+ "no-multi-spaces" : 2 ,
52
+ "no-unneeded-ternary" : 2 ,
53
+ "no-multiple-empty-lines" : 2 ,
54
+ "spaced-comment" : [ 2 , "always" ] ,
55
+ "arrow-parens" : [ 2 , "as-needed" ] ,
56
+ "arrow-body-style" : [ 2 , "as-needed" ] ,
57
+ "object-curly-spacing" : [ 2 , "always" ] ,
58
+ "template-curly-spacing" : [ 2 , "never" ] ,
59
+ "space-before-function-paren" : [ 1 , "always" ]
60
+ } ,
61
+ globals : {
62
+ "G" : true ,
63
+ "root" : true ,
64
+ "casper" : true ,
65
+ "message" : true ,
66
+ "endpoint" : true ,
67
+ "GEPPETTO" : true ,
68
+ "gepetto-client" : true ,
69
+ "Project" : true ,
70
+ "Instances" : true ,
71
+ "IPython" : true ,
72
+ "GEPPETTO_CONFIGURATION" : true ,
73
+ "MozWebSocket" : true ,
74
+ "panelComponent" : true ,
75
+ "Detector" : true ,
76
+ "THREE" : true ,
77
+ "VARS" : true ,
78
+ "Stats" : true ,
79
+ "geometry" : true ,
80
+ "aabbMin" : true ,
81
+ "aabbMax" : true ,
82
+ "bb" : true ,
83
+ "ClipboardModal" : true ,
84
+ "Store" : true ,
85
+ "olark" : true ,
86
+ "google" : true ,
87
+ "path" : true ,
88
+ "CodeMirror" : true ,
89
+ "Connectivity" : true ,
90
+ "π" : true ,
91
+ "τ" : true ,
92
+ "halfπ" : true ,
93
+ "dr" : true ,
94
+ "Model" : true ,
95
+ "Plot1" : true ,
96
+ "PIXI" : true ,
97
+ "stackViewerRequest" : true ,
98
+ "_" : true ,
99
+ "labelsInTV" : true ,
100
+ "Backbone" : true ,
101
+ "registeredEvents" : true ,
102
+ "Handlebars" : true ,
103
+ "ActiveXObject" : true ,
104
+ "jstestdriver" : true ,
105
+ "TestCase" : true ,
106
+ "EMBEDDED" : true ,
107
+ "EMBEDDERURL" : true ,
108
+ "handleRequest" : true ,
109
+ "_gaq" : true ,
110
+ "Canvas1" : true
111
+ }
112
+ } ;
0 commit comments