11import { generateEslintConfig } from '@sofie-automation/code-standard-preset/eslint/main.mjs'
2- // import pluginYaml from 'eslint-plugin-yml'
32import pluginReact from 'eslint-plugin-react'
43import globals from 'globals'
54
5+ const tmpRules = {
6+ // Temporary rules to be removed over time
7+ '@typescript-eslint/ban-types' : 'off' ,
8+ '@typescript-eslint/no-namespace' : 'off' ,
9+ '@typescript-eslint/no-var-requires' : 'off' ,
10+ '@typescript-eslint/no-non-null-assertion' : 'off' ,
11+ '@typescript-eslint/unbound-method' : 'off' ,
12+ '@typescript-eslint/no-misused-promises' : 'off' ,
13+ '@typescript-eslint/no-unnecessary-type-assertion' : 'off' ,
14+ }
15+
616const extendedRules = await generateEslintConfig ( {
717 tsconfigName : 'tsconfig.eslint.json' ,
8- ignores : [
9- 'public' ,
10- 'dist' ,
11- 'src/fonts' ,
12- 'src/meteor' ,
13- // HACk
14- // 'src/client/lib/data/mos/plugin-support.ts',
15- ] ,
16- disableNodeRules :
18+ ignores : [ 'public' , 'dist' , 'src/fonts' , 'src/meteor' ] ,
19+ disableNodeRules : true ,
1720} )
1821extendedRules . push (
1922 {
@@ -35,15 +38,34 @@ extendedRules.push(
3538 } ,
3639 rules : { } ,
3740 } ,
38- // extendedRules.push(...pluginYaml.configs['flat/recommended'], {
39- // files: ['**/*.yaml'],
41+ {
42+ files : [ 'src/**/*' ] ,
43+ rules : {
44+ // custom
45+ 'no-inner-declarations' : 'off' , // some functions are unexported and placed inside a namespace next to related ones
46+ // 'n/no-missing-import': [
47+ // 'error',
48+ // {
49+ // allowModules: ['meteor', 'mongodb'],
50+ // tryExtensions: ['.js', '.json', '.node', '.ts', '.tsx', '.d.ts'],
51+ // },
52+ // ],
53+ // 'n/no-extraneous-import': [
54+ // 'error',
55+ // {
56+ // allowModules: ['meteor', 'mongodb'],
57+ // },
58+ // ],
4059
41- // rules: {
42- // 'yml/quotes': ['error', { prefer: 'single' }],
43- // 'yml/spaced-comment': ['error'],
44- // 'spaced-comment': ['off'],
45- // },
46- // })
60+ 'n/no-extraneous-import' : 'off' , // because there are a lot of them as dev-dependencies
61+ 'n/no-missing-import' : 'off' , // erroring on every single import
62+ 'react/prop-types' : 'off' , // we don't use this
63+ '@typescript-eslint/no-empty-interface' : 'off' , // many prop/state types are {}
64+ '@typescript-eslint/promise-function-async' : 'off' , // event handlers can't be async
65+
66+ ...tmpRules ,
67+ } ,
68+ } ,
4769)
4870
4971export default extendedRules
0 commit comments