forked from oskariorg/oskari-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
91 lines (89 loc) · 2.68 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
const resolveConfig = require('./webpack/config.js').RESOLVE;
// http://eslint.org/docs/user-guide/configuring
module.exports = {
"root": true,
"env": {
"browser": true,
},
"globals": {
"_": false,
"$": false,
"ajaxUrl": false,
"Backbone": false,
"Cesium": false,
"Channel": false,
"ClipperLib": false,
"d3": false,
"define": false,
"jQuery": false,
"jsts": false,
"MobileDetect": false,
"moment": false,
"OpenLayers": false,
"Oskari": false,
"OskariNavigation": false,
"OskariPinchZoom": false,
"Proj4js": false,
"turf": false,
"__webpack_public_path__": false,
// ---- jest tests
"describe": false,
"expect": false,
"test": false,
"jest": false
// ----
},
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module"
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
"extends": [
"standard",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:react/recommended"
],
// add your custom rules here
"rules": {
"no-restricted-properties": ["error",
{"property": "getRequestBuilder", "message": "Please use Oskari.requestBuilder() instead."},
{"property": "getEventBuilder", "message": "Please use Oskari.eventBuilder() instead."}
],
"indent": ["error", 4],
// semicolons
"semi": ["error", "always"],
// allow templates to have placeholders as we use lodash templates
"no-template-curly-in-string": 0,
// allow debugger during development
"no-debugger": process.env.NODE_ENV === "production" ? 2 : 0,
// enforce single quote
"quotes": ["error", "single", {"allowTemplateLiterals": true, "avoidEscape": true}],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false }],
"no-fallthrough": "off",
"standard/no-callback-literal": "off",
"import/no-default-export": "error",
// Temporary warn level for Travis-CI
"brace-style": ["warn", "1tbs", { "allowSingleLine": true }],
"camelcase": ["warn", { "properties": "never" }],
"eqeqeq": ["warn", "always", { "null": "ignore" }],
"handle-callback-err": ["warn", "^(err|error)$" ],
"new-cap": ["warn", { "newIsCap": true, "capIsNew": false }],
"no-unmodified-loop-condition": "warn",
"no-unneeded-ternary": ["warn", { "defaultAssignment": false }],
"one-var": ["warn", { "initialized": "never" }],
"no-labels": ["warn", { "allowLoop": false, "allowSwitch": false }]
},
"settings": {
"import/resolver": {
"webpack": {
"config": {
"resolve": resolveConfig
}
}
},
"react": {
"version": "detect"
}
}
}