-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.ts
41 lines (37 loc) · 1.23 KB
/
base.ts
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
import canonical from 'eslint-config-canonical/configurations/canonical.js';
import { config } from 'typescript-eslint';
export const baseFileMatcher = ['**/*.{js,jsx,cjs,mjs,ts,tsx}'];
export const base = config({
files: baseFileMatcher,
extends: [canonical.recommended],
rules: {
// --- Off rules ---
'perfectionist/sort-decorators': 'off',
// --- Warn rules ---
'canonical/filename-match-regex': [
'warn',
{
ignoreExporting: false,
regex: '^[A-Za-z]+(?:[-A-Za-z0-9]*.[A-Za-z0-9]+)*d*$',
},
],
// --- Error rules ---
'canonical/id-match': [
'error',
'(?=.*[A-Za-z])(?:^[A-Za-z0-9]+(?:[A-Z][a-z0-9]*)*$)|(?=.*[A-Z])(?:^[A-Z0-9]+(_[A-Z0-9]+)*$)|(^(_|\\$)$)',
{
ignoreDestructuring: true,
ignoreNamedImports: true,
onlyDeclarations: true,
properties: true,
},
],
'id-length': [
'error',
{
exceptions: ['$', '_', 'a', 'b', 'i', 'j', 'x', 'y', 'z'],
},
],
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
});