forked from taiga-family/toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.ts
More file actions
69 lines (68 loc) · 2.92 KB
/
Copy patheslint.config.ts
File metadata and controls
69 lines (68 loc) · 2.92 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
import taiga, {
TUI_RECOMMENDED_NAMING_CONVENTION as recommended,
} from '@taiga-ui/eslint-plugin-experience-next';
import {globalIgnores} from 'eslint/config';
export default process.env.HTML_ESLINT
? [
// Eslint doesn't support multiple parsers for different rules
...taiga.configs['html-eslint'],
globalIgnores(['**/*.{ts,js,css,less,scss}']),
]
: [
...taiga.configs.recommended,
...taiga.configs['taiga-specific'],
{
ignores: [
// TypeScript will ignore files with duplicate filenames in the same folder
// (for example, src/file.ts and src/file.js). TypeScript purposely ignore
// all but one of the files, only keeping the one file
// with the highest priority extension
'**/jest-preset.js',
'**/polyfill.js',
'**/jest.config.js',
'**/eslint.config.js',
'.release-it.js',
'**/*.spec.js',
],
},
{
files: ['**/*.js', '**/*.ts'],
rules: {
'@typescript-eslint/naming-convention': ['error', ...recommended],
'perfectionist/sort-objects': [
'error',
{
customGroups: [
{
elementNamePattern: String.raw`^\$schema$`,
groupName: '$schema',
},
{elementNamePattern: '^id$', groupName: 'id'},
{elementNamePattern: '^env$', groupName: 'env'},
{elementNamePattern: '^files$', groupName: 'files'},
{elementNamePattern: '^parser$', groupName: 'parser'},
{elementNamePattern: '^plugins$', groupName: 'plugins'},
{elementNamePattern: '^extends$', groupName: 'extends'},
{elementNamePattern: '^rules$', groupName: 'rules'},
{elementNamePattern: '^overrides$', groupName: 'overrides'},
],
groups: [
'$schema',
'id',
'env',
'files',
'parser',
'plugins',
'extends',
'unknown',
'rules',
'overrides',
],
order: 'asc',
partitionByComment: true,
type: 'natural',
},
],
},
},
];