eslint.config.js•1.26 kB
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import importPlugin from 'eslint-plugin-import';
import eslintConfigPrettier from 'eslint-config-prettier';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default tseslint.config(
{
ignores: ['dist', 'coverage', 'node_modules', 'vitest.config.ts'],
},
js.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
{
files: ['**/*.ts'],
languageOptions: {
parserOptions: {
project: path.resolve(__dirname, 'tsconfig.json'),
tsconfigRootDir: __dirname,
},
},
plugins: {
import: importPlugin,
},
rules: {
'import/order': [
'warn',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
settings: {
'import/resolver': {
typescript: {
project: path.resolve(__dirname, 'tsconfig.json'),
},
},
},
},
eslintConfigPrettier,
);