mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00
51 lines
1.3 KiB
JavaScript
51 lines
1.3 KiB
JavaScript
import { defineConfig } from 'eslint/config'
|
|
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
|
import prettier from 'eslint-plugin-prettier'
|
|
import tsParser from '@typescript-eslint/parser'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import js from '@eslint/js'
|
|
import { FlatCompat } from '@eslint/eslintrc'
|
|
import prettierConfig from './.prettierrc.json' with { type: 'json' }
|
|
import vitest from '@vitest/eslint-plugin'
|
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
const __dirname = path.dirname(__filename)
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
recommendedConfig: js.configs.recommended,
|
|
allConfig: js.configs.all
|
|
})
|
|
|
|
export default defineConfig([
|
|
{
|
|
extends: compat.extends(
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/eslint-recommended',
|
|
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'prettier'
|
|
),
|
|
|
|
plugins: {
|
|
'@typescript-eslint': typescriptEslint,
|
|
prettier,
|
|
vitest
|
|
},
|
|
|
|
languageOptions: {
|
|
parser: tsParser,
|
|
ecmaVersion: 5,
|
|
sourceType: 'script',
|
|
|
|
parserOptions: {
|
|
project: ['./tsconfig.test.json']
|
|
}
|
|
},
|
|
|
|
rules: {
|
|
'prettier/prettier': ['error', prettierConfig],
|
|
...vitest.configs.recommended.rules
|
|
}
|
|
}
|
|
])
|