-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
35 lines (34 loc) · 1.02 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
const DOMGlobals = [ 'window', 'document' ]
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module'
},
rules: {
'no-unused-vars': [
'error',
// we are only using this rule to check for unused arguments since TS
// catches unused variables but not args.
{ varsIgnorePattern: '.*', args: 'after-used', argsIgnorePattern: '^_' }
],
// most of the codebase are expected to be env agnostic
'no-restricted-globals': [ 'error', ...DOMGlobals ],
// since we target ES2015 for baseline support, we need to forbid object
// rest spread usage (both assign and destructure)
'no-restricted-syntax': [
'error',
'ObjectExpression > SpreadElement',
'ObjectPattern > RestElement'
]
},
overrides: [
// tests, no restrictions (runs in Node / jest with jsdom)
{
files: [ '**/__tests__/**', 'test-dts/**' ],
rules: {
'no-restricted-globals': 'off',
'no-restricted-syntax': 'off'
}
}
]
}