forked from kryton/hue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
85 lines (78 loc) · 2.16 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
const normalGlobals = [];
const hueGlobals = [
// global_js_constants.mako
'AUTOCOMPLETE_TIMEOUT', 'CACHEABLE_TTL', 'CSRF_TOKEN', 'DOCUMENT_TYPES', 'DROPZONE_HOME_DIR',
'ENABLE_SQL_SYNTAX_CHECK', 'HAS_MULTI_CLUSTER', 'HAS_CATALOG', 'HAS_OPTIMIZER', 'HAS_WORKLOAD_ANALYTICS',
'HUE_I18n', 'HUE_VERSION', 'IS_K8S_ONLY', 'IS_NEW_INDEXER_ENABLED', 'IS_S3_ENABLED',
'isIE11', 'KO_DATERANGEPICKER_LABELS', 'LOGGED_USERGROUPS', 'LOGGED_USERNAME', 'METASTORE_PARTITION_LIMIT',
'USER_HOME_DIR', 'WorkerGlobalScope',
// other misc
'ace', 'CodeMirror', 'impalaDagre', 'less', 'MediumEditor', 'moment', 'Role', 'trackOnGA', '__webpack_public_path__',
// jest
'afterAll', 'afterEach', 'beforeAll', 'beforeEach', 'describe', 'expect', 'fail', 'fdescribe', 'fit', 'it', 'jest',
'spyOn', 'xdescribe', 'xit'
];
const globals = normalGlobals.concat(hueGlobals).reduce((acc, key) => {
acc[key] = true;
return acc;
}, {});
module.exports = {
env: {
browser: true,
node: true,
es6: true,
jasmine: true
},
extends: [
'plugin:prettier/recommended'
],
globals: globals,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2017,
sourceType: 'module',
ecmaFeatures: {
}
},
plugins: [
'jest'
],
rules: {
'jest/no-focused-tests': 'error',
'jest/valid-expect': 'error',
'new-cap': 0,
'no-console': 0,
'no-restricted-syntax': [
'error',
{
'selector': 'CallExpression[callee.object.name="console"][callee.property.name!=/^(warn|error|info|trace)$/]',
'message': 'Unexpected property on console object was called'
}
],
'no-extra-boolean-cast': 0,
'no-invalid-this': 0,
'no-lonely-if': 2,
'no-throw-literal': 0,
'no-unused-vars': [
'error',
{
vars: 'all',
args: 'none',
ignoreRestSiblings: true,
varsIgnorePattern: '_[a-zA-Z0-9_]+'
}
],
'no-useless-constructor': 2,
'no-var': 1,
'no-undef': 2,
'one-var': 0,
'prefer-arrow-callback': 2,
'prefer-const': ['warn', { destructuring: 'all' }],
'require-jsdoc': 0,
strict: 0,
'valid-jsdoc': 0,
curly: [2, 'all']
},
settings: {
}
};