Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
83 lines (80 loc) · 2.39 KB
/
Copy patheslint.config.mjs
File metadata and controls
83 lines (80 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import eslint from '@eslint/js';
import { importX as eslintPluginImportX } from 'eslint-plugin-import-x';
import eslintPluginUnicorn from 'eslint-plugin-unicorn';
import eslintPluginPrettierConfigRecommended from 'eslint-plugin-prettier/recommended';
import eslintPluginVitest from '@vitest/eslint-plugin';
import eslintPluginSimpleImportSort from 'eslint-plugin-simple-import-sort';
import tseslint from 'typescript-eslint';
import globals from 'globals';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
export default tseslint.config(
{
ignores: [
'**/node_modules/**',
'**/dist/**',
'**/coverage/**',
'.releaserc.js',
'eslint.config.*',
'vitest.config.*',
],
},
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
eslintPluginImportX.flatConfigs.recommended,
eslintPluginImportX.flatConfigs.typescript,
eslintPluginVitest.configs.recommended,
eslintPluginUnicorn.configs['flat/recommended'],
eslintPluginPrettierConfigRecommended,
{
files: ['src/**/*.ts', 'tests/**/*.ts'],
plugins: {
'simple-import-sort': eslintPluginSimpleImportSort,
},
languageOptions: {
globals: {
...globals.node,
},
parser: tseslint.parser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
project: ['tsconfig.eslint.json'],
tsconfigRootDir: __dirname,
},
},
settings: {
'import-x/parsers': {
'@typescript-eslint/parser': ['.ts'],
},
'import-x/resolver': {
typescript: {
alwaysTryTypes: true,
project: ['tsconfig.eslint.json'],
},
},
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'prettier/prettier': 'error',
'import-x/no-unresolved': 'error',
'import-x/first': 'error',
'import-x/newline-after-import': 'error',
'import-x/no-duplicates': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'vitest/max-nested-describe': [
'error',
{
max: 3,
},
],
'vitest/consistent-test-it': 'error',
'vitest/no-identical-title': 'error',
'vitest/prefer-to-be': 'error',
'vitest/prefer-lowercase-title': 'error',
},
},
);