-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
88 lines (86 loc) · 2.23 KB
/
eslint.config.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
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
/** @type {import('eslint').Linter.Config} */
const config = {
root: true,
extends: ['@joggr/eslint-config'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
rules: {
// @todo re-enable these rules and fix the underlying issues
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-confusing-void-expression': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn',
'@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/return-await': 'warn',
},
ignorePatterns: [
'node_modules',
'dist',
'public',
'next.config.mjs',
'contentlayer.config.ts',
'eslint.config.js',
'tailwind.config.js',
'postcss.config.js',
],
};
const compat = new FlatCompat({
recommendedConfig: js.configs.recommended,
});
module.exports = [
...compat.config(config),
{
files: ['src/**/*.tsx'],
rules: {
'filenames-simple/naming-convention': ['error', { rule: 'PascalCase' }],
},
},
{
ignores: ['src/@generated/*', 'cli/*'],
},
{
files: ['src/**/*.ts'],
rules: {
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'import/order': [
'error',
{
pathGroups: [
{
pattern: '@generated/**',
group: 'internal',
position: 'before',
},
{
pattern: '@launchpad/*',
group: 'internal',
position: 'before',
},
{
pattern: '@launchpad/lib/**',
group: 'internal',
position: 'before',
},
{
pattern: '@launchpad/+(plugins|hooks|routes)/**',
group: 'internal',
position: 'before',
},
],
},
],
},
},
];