mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
88 lines
1.9 KiB
JavaScript
88 lines
1.9 KiB
JavaScript
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat'
|
|
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
|
import globals from 'globals'
|
|
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'
|
|
|
|
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 [
|
|
{
|
|
ignores: [
|
|
'**/build',
|
|
'**/eslint.config.mjs',
|
|
'**/jest-config.js',
|
|
'**/babel.config.js',
|
|
'*/node_modules/*',
|
|
'**/prisma',
|
|
'**/coverage',
|
|
],
|
|
},
|
|
...fixupConfigRules(
|
|
compat.extends(
|
|
'eslint:recommended',
|
|
'plugin:prettier/recommended',
|
|
'plugin:import/recommended',
|
|
'plugin:@typescript-eslint/recommended-type-checked'
|
|
)
|
|
),
|
|
{
|
|
plugins: {
|
|
'@typescript-eslint': fixupPluginRules(typescriptEslint),
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
|
|
parser: tsParser,
|
|
ecmaVersion: 5,
|
|
sourceType: 'script',
|
|
|
|
parserOptions: {
|
|
project: true,
|
|
tsconfigRootDir: __dirname,
|
|
},
|
|
},
|
|
|
|
settings: {
|
|
'import/resolver': {
|
|
typescript: {},
|
|
},
|
|
},
|
|
|
|
rules: {
|
|
'prettier/prettier': [
|
|
'error',
|
|
{
|
|
endOfLine: 'auto',
|
|
},
|
|
],
|
|
|
|
'no-async-promise-executor': 'off',
|
|
'import/no-named-as-default-member': 'off',
|
|
'import/default': 'off',
|
|
'import/namespace': 'off',
|
|
'no-console': 'error',
|
|
'no-unused-vars': 'off',
|
|
'@typescript-eslint/no-unused-vars': 'off',
|
|
'@typescript-eslint/no-misused-promises': [
|
|
'error',
|
|
{
|
|
checksVoidReturn: false,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
]
|