Files
speckle-server/packages/viewer/eslint.config.mjs
T
Kristaps Fabians Geikins 1d2a594f0a chore: upgrade TS 5.2 -> 5.7.3 & ESLint to 9.20.1 (#4032)
* chore: upgrade TS 5.2 -> 5.7.3

* vite dts fix

* lint fix

* resolutions fix

* ui comp build fix

* precommit fix?

* latest eslint version

* autoloader fix

* undo unnecessary viewer change

* eslint fixes fe2 + trying disabled type linting

* lint fixes
2025-02-20 14:18:18 +02:00

79 lines
2.2 KiB
JavaScript

import path from 'path'
import { baseConfigs, globals, getESMDirname } from '../../eslint.config.mjs'
import * as babelParser from '@babel/eslint-parser'
import tseslint from 'typescript-eslint'
const __dirname = getESMDirname(import.meta.url)
const babelConfigFile = path.resolve(__dirname, './.babelrc')
/**
* @type {Array<import('eslint').Linter.FlatConfig>}
*/
const configs = [
...baseConfigs,
{
files: ['**/*.js'],
languageOptions: {
sourceType: 'module'
}
},
{
files: ['*.{js,cjs,mjs,ts}'],
languageOptions: {
globals: {
...globals.node
}
}
},
{
languageOptions: {
globals: {
...globals.browser
},
parser: babelParser,
parserOptions: {
babelOptions: {
configFile: babelConfigFile
}
}
}
},
...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.eslint.json'
}
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-base-to-string': 'off', // too restrictive
'@typescript-eslint/restrict-template-expressions': 'off', // too restrictive
'@typescript-eslint/no-unsafe-enum-comparison': 'off', // too restrictive
'@typescript-eslint/require-await': 'off', // too restrictive
'@typescript-eslint/unbound-method': 'off', // too restrictive
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
// TODO: Can we re-enable these? Only disabled because of the amount of errors
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-unsafe-return': 'off'
}
},
{
rules: {
'no-console': ['warn', { allow: ['warn', 'error'] }]
}
}
]
export default configs