-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
70 lines (70 loc) · 1.55 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
module.exports = {
root: true,
plugins: ['@typescript-eslint', 'import'],
extends: [
'@guardian/eslint-config-typescript',
'plugin:import/recommended',
],
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
rules: {
'id-denylist': ['error'],
// TODO - remove these rule once we've migrated to commercial-core
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/unbound-method': 'off',
curly: ['error', 'multi-line'],
'no-use-before-define': ['error', { functions: true, classes: true }],
'import/exports-last': 'error',
'no-else-return': 'error',
'no-restricted-imports': [
'error',
{
patterns: [
{
group: [
'core/*',
'define/*',
'display/*',
'events/*',
'experiments/*',
'init/*',
'lib/*',
'insert/*',
'types/*',
'utils/*',
],
message:
'Non-relative imports from src are forbidden. Please use a relative path instead',
},
],
},
],
},
overrides: [
{
files: ['*.spec.ts'],
rules: {
// This rule erroneously flags up instances where you expect(obj.fn).toHaveBeenCalled
// Enabled for test files only
'@typescript-eslint/unbound-method': 'off',
},
},
],
ignorePatterns: ['*.js', 'dist', 'src/__vendor', '.eslintrc.js'],
settings: {
'import/resolver': {
alias: {
map: [['svgs', './static/svg']],
},
},
},
env: {
jest: true,
browser: true,
node: true,
},
globals: { googletag: 'readonly' },
};