-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
66 lines (64 loc) · 1.93 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
require('tsx/cjs')
const mmkal = require('eslint-plugin-mmkal')
const localPlugin = require('./src')
module.exports = process.env.DOGFOOD_CODEGEN_PLUGIN // todo: make sure the "recommendedConfig" exported by this library actually works, shouldn't force ppl to use eslint-plugin-mmkal
? localPlugin.flatConfig.recommendedConfig
: [
...mmkal.recommendedFlatConfigs.map(cfg => {
if (cfg.plugins?.codegen) {
return {
...cfg,
plugins: {
...cfg.plugins,
codegen: Object.fromEntries(
Object.keys(cfg.plugins.codegen).map(key => {
return [key, localPlugin[key]]
}),
),
},
}
}
return cfg
}),
// .map(cfg => {
// if (require('util').inspect(cfg).includes('codegen/')) {
// throw new Error(
// `codegen config found in eslint config coming from eslint-plugin-mmkal for this repo, this is going to cause confusion. Config: ${JSON.stringify(cfg)}`,
// {
// cause: cfg,
// },
// )
// }
// return cfg
// }),
{
rules: {
'no-restricted-imports': [
'warn',
{
name: 'fs',
message: 'Use the `fs` value passed to the codegen function instead of importing it directly.',
},
],
},
},
{
files: ['test/**/*.ts'],
rules: {
'@typescript-eslint/no-unsafe-argument': 'off', // mmkal
},
},
{
rules: {
'unicorn/no-null': 'off', // mmkal
'no-unsued-vars': 'off', // mmkal
},
},
{
files: ['e2e/**/*.ts'],
rules: {'no-restricted-imports': 'off'},
},
{ignores: ['.vscode-test', 'test-results']},
// codegen.pluginConfig,
// codegen.javascriptFilesConfig,
]