-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathreact.mjs
More file actions
77 lines (72 loc) · 2.1 KB
/
react.mjs
File metadata and controls
77 lines (72 loc) · 2.1 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
import { defineConfig } from 'eslint/config'
// We are not listing '@strv/eslint-config-react' in dependencies on purpose -
// - we don't want to spam Node.js users with unwanted React config.
// Also on the other hand we believe that React users will already have
// @strv/eslint-config-react configuration installed.
// eslint-disable-next-line import/no-extraneous-dependencies
import react from '@strv/eslint-config-react'
import ts from '@typescript-eslint/eslint-plugin'
import parser from '@typescript-eslint/parser'
/** @returns {ReturnType<typeof defineConfig>} */
export default defineConfig({
name: '@strv/eslint-config-typescript/react',
extends: [
react,
],
plugins: {
'@typescript-eslint': ts,
},
languageOptions: {
parser,
},
rules: {
'react/prop-types': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'memberLike',
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'forbid',
},
{
selector: 'variable',
types: ['boolean'],
format: ['PascalCase'],
prefix: ['is', 'should', 'has', 'can', 'did', 'will', 'expected'],
},
{
selector: 'typeParameter',
format: ['PascalCase'],
custom: {
regex: '^T[A-Z][a-zA-Z]+',
match: true,
},
},
{
selector: 'interface',
format: ['PascalCase'],
custom: {
regex: '^I[A-Z]',
match: true,
},
},
],
'@typescript-eslint/no-shadow': 'off',
'no-shadow': 'off',
// Must be off, otherwise @typescript-eslint/member-ordering is triggered
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/ban-ts-comment': [
'warn',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': true,
'ts-check': false,
minimumDescriptionLength: 3,
},
],
'@typescript-eslint/no-unnecessary-condition': 'off',
},
})