forked from udecode/plate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
90 lines (89 loc) · 2.25 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
module.exports = {
extends: ['@borealisgroup/eslint-config-ts', 'plugin:mdx/recommended'],
plugins: ['import', 'prettier'],
settings: {
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/no-namespace': 'off',
camelcase: 'off',
'import/extensions': [
'error',
'never',
{
ts: 'never',
tsx: 'never',
js: 'never',
jsx: 'never',
},
],
'import/no-named-as-default-member': 'off',
// turn on errors for missing imports
'import/no-unresolved': 'error',
'jest/no-export': 'off',
'jest/no-standalone-expect': 'off',
'mdx/no-unescaped-entities': 'off',
'mdx/no-unused-expressions': 'off',
'no-alert': 'off',
'react/jsx-filename-extension': [
'error',
{ extensions: ['.js', '.jsx', '.ts', '.tsx', 'mdx'] },
],
'@typescript-eslint/no-non-null-assertion': 'off',
},
overrides: [
{
files: 'packages/**/*',
rules: {
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@styled-icons',
message:
'@styled-icons package is meant to be used in stories only',
},
],
// The no-restricted-imports rule does not support custom messages for pattern imports yet: https://github.com/eslint/eslint/issues/11843
patterns: ['@styled-icons/*'],
},
],
},
},
{
files: 'packages/**/__tests__/*',
rules: {
'no-restricted-imports': [
'error',
{
paths: [],
},
],
},
},
{
files: '**/*.stories.tsx',
rules: {
// just for showing the code in addon-docs
'react-hooks/rules-of-hooks': 'off',
},
},
{
files: '**/*.mdx',
rules: {
'prettier/prettier': 'off',
'simple-import-sort/sort': 'off',
'import/order': ['error', { 'newlines-between': 'never' }],
},
},
],
};