forked from openedx/paragon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
74 lines (73 loc) · 1.73 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
71
72
73
74
const path = require('path');
module.exports = {
extends: [
'@edx/eslint-config',
'plugin:import/typescript',
],
parser: '@babel/eslint-parser',
parserOptions: {
requireConfigFile: true,
babelOptions: {
configFile: path.resolve(__dirname, './babel.config.json'),
},
},
rules: {
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: [
'**/*.stories.jsx',
'src/setupTest.ts',
'**/*.test.jsx',
'**/*.test.js',
'config/*.js',
'*.config.ts',
'*.config.*.js',
'**/*.config.js',
'component-generator/**',
'generate-changelog.js',
],
},
],
'import/no-relative-packages': [2, { ignore: ['icons'] }],
'import/no-unresolved': [2, { ignore: ['axios'] }],
'react/jsx-no-constructed-context-values': 0,
'no-restricted-exports': [0, { restrictedNamedExports: ['default'] }],
// https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/340#issuecomment-338424908
'jsx-a11y/anchor-is-valid': ['error', {
components: ['Link'],
specialLink: ['to'],
}],
'jsx-a11y/label-has-for': [2, {
components: ['label'],
required: 'id',
allowChildren: false,
}],
'no-param-reassign': [2, { props: false }],
},
env: {
jest: true,
},
globals: {
newrelic: false,
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: 'airbnb-typescript',
parserOptions: {
project: './tsconfig.json',
},
},
],
};