-
Notifications
You must be signed in to change notification settings - Fork 58
/
.eslintrc.js
49 lines (49 loc) · 1.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
module.exports = {
parser: 'babel-eslint',
env: {
browser: true,
'jest/globals': true,
},
globals: {
__DEV__: true,
},
plugins: [ 'react', 'react-native', 'jest' ],
extends: [ 'plugin:@wordpress/eslint-plugin/recommended' ],
settings: {
'import/resolver': {
node: {
moduleDirectory: [ 'node_modules', 'gutenberg/node_modules' ],
},
},
},
rules: {
// do not throw an error if imported dependencies are
// declared in `package.json` or `gutenberg/package.json`
'import/no-extraneous-dependencies': [
'error',
{ packageDir: [ '.', './gutenberg/' ] },
],
},
overrides: [
{
// Disable rules for tests as we do in Gutenberg.
// Reference: https://git.io/JSMAQ
files: [ 'src/**/test/**/*.js' ],
rules: {
'import/default': 'off',
'import/no-extraneous-dependencies': 'off',
'import/no-unresolved': 'off',
'import/named': 'off',
'@wordpress/data-no-store-string-literals': 'off',
},
},
{
// Workaround for addressing errors when importing react-native components.
// Related issue: https://git.io/JSKeJ
files: [ 'src/**/*.js' ],
settings: {
'import/ignore': [ 'react-native' ],
},
},
],
};