62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
import { defineConfig } from 'eslint/config';
|
|
import eslintPluginN from 'eslint-plugin-n';
|
|
import eslintPluginPrettier from 'eslint-plugin-prettier/recommended';
|
|
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
import tseslint from 'typescript-eslint';
|
|
|
|
export default defineConfig([
|
|
eslintPluginPrettier,
|
|
tseslint.configs.stylisticTypeChecked,
|
|
tseslint.configs.eslintRecommended,
|
|
{
|
|
rules: {
|
|
'@typescript-eslint/no-unsafe-call': 'off',
|
|
},
|
|
},
|
|
{
|
|
ignores: ['dist/**', '**/dist/**'],
|
|
},
|
|
{
|
|
languageOptions: {
|
|
parserOptions: {
|
|
tsconfigRootDir: import.meta.dirname,
|
|
projectService: true,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
'simple-import-sort': eslintPluginSimpleImportSort,
|
|
},
|
|
rules: {
|
|
'simple-import-sort/imports': 'error',
|
|
'simple-import-sort/exports': 'error',
|
|
},
|
|
},
|
|
{
|
|
plugins: {
|
|
n: eslintPluginN,
|
|
},
|
|
rules: {
|
|
'block-scoped-var': 'error',
|
|
eqeqeq: 'error',
|
|
'no-var': 'error',
|
|
'prefer-const': 'error',
|
|
'eol-last': 'error',
|
|
'prefer-arrow-callback': 'error',
|
|
'no-trailing-spaces': 'error',
|
|
quotes: ['warn', 'single', { avoidEscape: true }],
|
|
'no-restricted-properties': [
|
|
'error',
|
|
{
|
|
object: 'describe',
|
|
property: 'only',
|
|
},
|
|
{
|
|
object: 'it',
|
|
property: 'only',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
]);
|