2024-09-04 15:06:23 +03:00
|
|
|
import tseslint from 'typescript-eslint'
|
|
|
|
import {
|
|
|
|
baseConfigs,
|
|
|
|
getESMDirname,
|
|
|
|
globals,
|
|
|
|
prettierConfig
|
|
|
|
} from '../../eslint.config.mjs'
|
2024-06-12 14:38:02 +03:00
|
|
|
|
|
|
|
const configs = [
|
|
|
|
...baseConfigs,
|
|
|
|
{
|
2024-09-04 15:06:23 +03:00
|
|
|
ignores: ['dist', 'public', 'docs']
|
2024-06-12 14:38:02 +03:00
|
|
|
},
|
|
|
|
{
|
2024-09-04 15:06:23 +03:00
|
|
|
files: ['webpack.config.renderPage.cjs'],
|
2024-06-12 14:38:02 +03:00
|
|
|
languageOptions: {
|
|
|
|
globals: {
|
|
|
|
...globals.node
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2024-09-04 15:06:23 +03:00
|
|
|
files: ['**/*.js'],
|
|
|
|
ignores: ['renderPage', '**/*.mjs', 'src/scripts/puppeteerDriver.js'],
|
2024-06-12 14:38:02 +03:00
|
|
|
languageOptions: {
|
|
|
|
sourceType: 'module',
|
2024-09-04 15:06:23 +03:00
|
|
|
globals: {
|
|
|
|
...globals.node
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['bin/www'],
|
|
|
|
languageOptions: {
|
|
|
|
sourceType: 'module',
|
|
|
|
globals: {
|
|
|
|
...globals.node
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['renderPage/**/*.js'],
|
|
|
|
languageOptions: {
|
|
|
|
sourceType: 'module',
|
|
|
|
globals: {
|
|
|
|
...globals.browser
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['src/scripts/puppeteerDriver.js'],
|
|
|
|
languageOptions: {
|
2024-06-12 14:38:02 +03:00
|
|
|
globals: {
|
|
|
|
...globals.browser
|
|
|
|
}
|
|
|
|
}
|
2024-09-04 15:06:23 +03:00
|
|
|
},
|
|
|
|
...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-return': 'error'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
files: ['**/*.spec.{js,ts}'],
|
|
|
|
languageOptions: {
|
|
|
|
globals: {
|
|
|
|
...globals.node
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
prettierConfig
|
2024-06-12 14:38:02 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
export default configs
|