83d8035dc2
* root + server * frontend * frontend-2 * dui3 * dui3 * tailwind theme * ui-components * preview service * viewer * viewer-sandbox * fileimport-service * webhook service * objectloader * shared * ui-components-nuxt * WIP full config * WIP full linter * eslint projectwide util * minor fix * removing redundant ci * clean up test errors * fixed prettier formatting * CI improvements * TSC lint fix * 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader * removed unnecessary void --------- Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
64 lines
1.7 KiB
JavaScript
64 lines
1.7 KiB
JavaScript
import { baseConfigs, globals, getESMDirname } from '../../eslint.config.mjs'
|
|
import tseslint from 'typescript-eslint'
|
|
|
|
/**
|
|
* Base configs that should be inherited in all packages as well
|
|
* @type {Array<import('eslint').Linter.FlatConfig>}
|
|
*/
|
|
const configs = [
|
|
...baseConfigs,
|
|
{
|
|
files: ['**/*.js'],
|
|
languageOptions: {
|
|
sourceType: 'module'
|
|
}
|
|
},
|
|
{
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node
|
|
}
|
|
}
|
|
},
|
|
...tseslint.configs.recommendedTypeChecked.map((c) => ({
|
|
...c,
|
|
files: [...(c.files || []), '**/*.ts', '**/*.d.ts']
|
|
})),
|
|
{
|
|
files: ['**/*.ts', '**/*.d.ts'],
|
|
languageOptions: {
|
|
parserOptions: {
|
|
tsconfigRootDir: getESMDirname(import.meta.url),
|
|
project: './tsconfig.json'
|
|
}
|
|
},
|
|
rules: {
|
|
'@typescript-eslint/no-explicit-any': ['error'],
|
|
'@typescript-eslint/no-unsafe-argument': ['error'],
|
|
'@typescript-eslint/no-unsafe-assignment': 'error',
|
|
'@typescript-eslint/no-unsafe-call': 'error',
|
|
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
'@typescript-eslint/no-unsafe-return': 'error',
|
|
'@typescript-eslint/no-for-in-array': ['error'],
|
|
'@typescript-eslint/restrict-template-expressions': ['error'],
|
|
'@typescript-eslint/restrict-plus-operands': ['error'],
|
|
'@typescript-eslint/await-thenable': ['warn'],
|
|
'@typescript-eslint/ban-types': ['warn'],
|
|
'require-await': 'off',
|
|
'@typescript-eslint/require-await': 'error',
|
|
'no-undef': 'off'
|
|
}
|
|
},
|
|
{
|
|
files: ['**/*.d.ts'],
|
|
rules: {
|
|
'no-var': 'off',
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
'@typescript-eslint/ban-types': 'off',
|
|
'no-unused-vars': 'off'
|
|
}
|
|
}
|
|
]
|
|
|
|
export default configs
|