-
Notifications
You must be signed in to change notification settings - Fork 0
/
browser.js
52 lines (44 loc) · 1.33 KB
/
browser.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
'use strict';
const confusingBrowserGlobals = require('confusing-browser-globals');
const ERROR = 'error';
/**
* @type {import('eslint').Linter.BaseConfig}
*/
module.exports = {
env: {
browser: true,
},
rules: {
// Suggestions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'no-alert': ERROR,
'no-restricted-globals': [ERROR, ...confusingBrowserGlobals],
'no-script-url': ERROR,
'no-shadow': [
ERROR,
{
allow: confusingBrowserGlobals,
builtinGlobals: true,
hoist: 'functions',
ignoreOnInitialization: true,
},
],
// Import ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'import/no-unassigned-import': [
ERROR,
{
allow: ['**/*.css'],
},
],
// Unicorn ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'unicorn/no-document-cookie': ERROR,
'unicorn/prefer-add-event-listener': ERROR,
'unicorn/prefer-dom-node-append': ERROR,
'unicorn/prefer-dom-node-dataset': ERROR,
'unicorn/prefer-dom-node-remove': ERROR,
'unicorn/prefer-dom-node-text-content': ERROR,
'unicorn/prefer-keyboard-event-key': ERROR,
'unicorn/prefer-modern-dom-apis': ERROR,
'unicorn/prefer-query-selector': ERROR,
'unicorn/require-post-message-target-origin': ERROR,
},
};