Repository navigation
Expand file tree
/
Copy patheslint.config.mjs
More file actions
99 lines (96 loc) · 2.75 KB
/
Copy patheslint.config.mjs
File metadata and controls
99 lines (96 loc) · 2.75 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettier from 'eslint-plugin-prettier';
import prettierConfig from 'eslint-config-prettier';
import importPlugin from 'eslint-plugin-import';
import sortExportAll from 'eslint-plugin-sort-export-all';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default tseslint.config(
{
ignores: ['eslint.config.js', 'dist/**', 'node_modules/**', 'coverage/**'],
},
js.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
files: ['**/*.ts'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
},
plugins: {
'@typescript-eslint': tseslint.plugin,
prettier,
import: importPlugin,
'sort-export-all': sortExportAll,
},
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/naming-convention': [
'warn',
{
selector: 'default',
format: ['camelCase'],
},
{
selector: ['enumMember', 'typeLike'],
format: ['PascalCase'],
},
{
selector: 'classProperty',
modifiers: ['readonly'],
format: ['camelCase', 'UPPER_CASE'],
},
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
},
{
selector: ['objectLiteralProperty', 'typeProperty'],
format: ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE'],
},
{
selector: 'objectLiteralProperty',
modifiers: ['requiresQuotes'],
format: null,
},
{
selector: 'variable',
modifiers: ['const'],
format: ['camelCase', 'UPPER_CASE'],
},
{
selector: 'variable',
types: ['function'],
format: ['camelCase', 'PascalCase'],
},
],
'import/order': [
'error',
{
groups: ['builtin', 'external', ['parent', 'sibling'], 'index'],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
'sort-export-all/sort-export-all': ['error', 'asc', { caseSensitive: false }],
'sort-imports': [
'error',
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
'prettier/prettier': 'error',
},
},
);