-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.js
69 lines (67 loc) · 1.93 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
// const { getGlobals } = require('eslint-plugin-mdx/lib/helpers');
// const shortcodes = require('./src/lib/mdx/shortcodes.ts');
// const shortcodes = { TileGrid: null, NavTile: null };
/** @type { import('eslint').Linter.Config } */
module.exports = {
extends: ['next/core-web-vitals', 'prettier'],
plugins: ['prettier'],
rules: {
// indent: ['error', 2, { SwitchCase: 1, offsetTernaryExpressions: false }],
indent: 'off',
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'spaced-comment': ['error', 'always'],
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.tsx'] }],
'react/forbid-prop-types': 'off',
'react/jsx-props-no-spreading': 'off',
'react/self-closing-comp': ['error', { component: true, html: false }],
'react/no-array-index-key': 'off',
'react/require-default-props': 'off',
'no-unused-vars': [
'error',
{ destructuredArrayIgnorePattern: '^_', argsIgnorePattern: '^_' }
],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index'
],
alphabetize: {
order: 'asc',
caseInsensitive: true
}
}
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never'
}
]
},
overrides: [
{
files: ['*.md', '*.mdx'],
// requires so eslint can know what JSX is valid
// globals: getGlobals(shortcodes),
rules: {
indent: ['off'],
// 'react/jsx-no-undef': [1, { allowGlobals: true }],
'react/jsx-no-undef': 'off',
'react/no-unescaped-entities': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.md', '.mdx'] }]
},
extends: 'plugin:mdx/recommended',
settings: { 'mdx/remark': true }
}
]
};