2024-08-05 16:13:16 -04:00
|
|
|
import js from '@eslint/js';
|
2025-03-31 13:18:25 +02:00
|
|
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
|
|
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
|
2024-08-05 16:13:16 -04:00
|
|
|
import globals from 'globals';
|
|
|
|
import path from 'node:path';
|
|
|
|
import { fileURLToPath } from 'node:url';
|
2025-03-31 13:18:25 +02:00
|
|
|
import typescriptEslint from 'typescript-eslint';
|
2024-08-05 16:13:16 -04:00
|
|
|
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
|
2025-03-31 13:18:25 +02:00
|
|
|
export default typescriptEslint.config([
|
|
|
|
eslintPluginUnicorn.configs.recommended,
|
|
|
|
eslintPluginPrettierRecommended,
|
|
|
|
js.configs.recommended,
|
|
|
|
typescriptEslint.configs.recommended,
|
2024-08-05 16:13:16 -04:00
|
|
|
{
|
|
|
|
ignores: ['eslint.config.mjs', 'dist'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
languageOptions: {
|
|
|
|
globals: {
|
|
|
|
...globals.node,
|
|
|
|
},
|
|
|
|
|
2025-03-31 13:18:25 +02:00
|
|
|
parser: typescriptEslint.parser,
|
2024-08-05 16:13:16 -04:00
|
|
|
ecmaVersion: 5,
|
|
|
|
sourceType: 'module',
|
|
|
|
|
|
|
|
parserOptions: {
|
|
|
|
project: 'tsconfig.json',
|
|
|
|
tsconfigRootDir: __dirname,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
rules: {
|
|
|
|
'@typescript-eslint/interface-name-prefix': 'off',
|
|
|
|
'@typescript-eslint/explicit-function-return-type': 'off',
|
|
|
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
|
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
|
|
'@typescript-eslint/no-floating-promises': 'error',
|
|
|
|
'unicorn/prefer-module': 'off',
|
|
|
|
'unicorn/prevent-abbreviations': 'off',
|
|
|
|
'unicorn/no-process-exit': 'off',
|
|
|
|
'unicorn/import-style': 'off',
|
|
|
|
curly: 2,
|
|
|
|
'prettier/prettier': 0,
|
2024-08-30 14:38:53 -04:00
|
|
|
'object-shorthand': ['error', 'always'],
|
2024-08-05 16:13:16 -04:00
|
|
|
},
|
|
|
|
},
|
2025-03-31 13:18:25 +02:00
|
|
|
]);
|