You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
1.6 KiB
JavaScript
74 lines
1.6 KiB
JavaScript
import { defineConfig, globalIgnores } from 'eslint/config'
|
|
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 defineConfig([
|
|
globalIgnores([
|
|
'**/dist',
|
|
'**/node_modules',
|
|
'**/*.config.js',
|
|
'**/*.config.ts',
|
|
'**/test-results/**',
|
|
]),
|
|
{
|
|
extends: compat.extends(
|
|
'eslint:recommended',
|
|
'plugin:@typescript-eslint/recommended',
|
|
'plugin:solid/recommended',
|
|
'prettier'
|
|
),
|
|
|
|
plugins: {
|
|
'@typescript-eslint': typescriptEslint,
|
|
},
|
|
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
...globals.node,
|
|
},
|
|
|
|
parser: tsParser,
|
|
ecmaVersion: 'latest',
|
|
sourceType: 'module',
|
|
},
|
|
|
|
rules: {
|
|
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
|
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
'prefer-const': 'error',
|
|
'no-var': 'error',
|
|
'object-shorthand': 'error',
|
|
'prefer-template': 'error',
|
|
|
|
'no-console': [
|
|
'warn',
|
|
{
|
|
allow: ['warn', 'error'],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
])
|