-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy path.eslintrc.js
49 lines (48 loc) · 1.31 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
const path = require( 'path' );
const { nodeConfig } = require( '@automattic/calypso-eslint-overrides' );
module.exports = {
// Allow fetch api function usage (and similar)
env: { browser: true },
rules: {
// We have lots of "fake" packages (directories with a package.json that don't declare dependencies),
// we need to configure this rule to look into __dirname/node_modules, otherwise it will stop
// looking up when it finds a package.json
'import/no-extraneous-dependencies': [
'error',
{ packageDir: [ __dirname, path.join( __dirname, '..' ) ] },
],
// No need to import @testing-library/jest-dom - it is already globally provided by our test setup framework.
'no-restricted-imports': [
'error',
{
patterns: [
{
group: [ '@testing-library/jest-dom*' ],
message:
'@testing-library/jest-dom is already globally provided by our test setup framework.',
},
],
},
],
'jest/no-mocks-import': 'off',
},
overrides: [
{
files: [ './webpack.*.js', './server/**/*', '**/test/**/*' ],
...nodeConfig,
},
{
files: [ './**/docs/example.jsx' ],
rules: {
// We use a log of console.log() in examples.
'no-console': 'off',
},
},
{
files: [ '**/*.stories.tsx' ],
rules: {
'import/no-extraneous-dependencies': 'off',
},
},
],
};