lupdo
Version:
Database Abstraction Layer for Node js
67 lines (65 loc) • 2.09 kB
JavaScript
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import unusedImports from 'eslint-plugin-unused-imports';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default tseslint.config(
{
ignores: ['eslint.config.mjs', 'dist/*'],
},
eslint.configs.recommended,
tseslint.configs.recommended,
eslintPluginPrettierRecommended,
{
plugins: {
'simple-import-sort': simpleImportSort,
'unused-imports': unusedImports,
},
},
{
languageOptions: {
globals: {
...globals.node,
...globals.jest,
},
sourceType: 'module',
parserOptions: {
root: true,
project: 'tsconfig.json',
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{ allowExpressions: true },
],
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/indent': 'off',
'@typescript-eslint/no-angle-bracket-type-assertion': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
'@typescript-eslint/prefer-interface': 'off',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'none' }],
'no-empty': ['error', { allowEmptyCatch: true }],
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'unused-imports/no-unused-imports': 'error',
},
},
{
files: ['*.test.ts'],
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
},
}
);