-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
114 lines (113 loc) · 3.2 KB
/
.eslintrc.cjs
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* eslint-env node */
/**
* @see https://eslint.org/docs/v8.x/use/configure/configuration-files
* @type {import("eslint").Linter.Config}
* */
module.exports = {
root: true,
extends: [
'expo',
'plugin:lingui/recommended',
'plugin:tailwindcss/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
],
plugins: [
'@typescript-eslint',
'jest',
'react-compiler',
'tailwindcss',
'lingui',
],
parser: '@typescript-eslint/parser',
parserOptions: {
project: true,
tsconfigRootDir: __dirname,
},
settings: {
tailwindcss: {
classRegex: '^[a-zA-Z]*(c|C)lassName$',
callees: ['cn', 'tv'],
},
},
rules: {
'react-compiler/react-compiler': 'error',
'tailwindcss/no-arbitrary-value': 'warn',
'@typescript-eslint/no-var-requires': ['error', { allow: ['.ttf$'] }],
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/consistent-type-definitions': ['warn', 'type'],
},
overrides: [
{
extends: ['plugin:lingui/recommended'],
files: ['*.tsx'],
rules: {
'lingui/no-unlocalized-strings': [
'error',
{
ignore: [
// Ignore strings which are a single "word" (no spaces)
// and doesn't start with an uppercase letter
'^(?![A-Z])\\S+$',
// Ignore UPPERCASE literals
// Example: const test = "FOO"
'^[A-Z0-9_-]+$',
],
ignoreNames: [
// Ignore matching className (case-insensitive)
{ regex: { pattern: 'className', flags: 'i' } },
// Ignore UPPERCASE names
// Example: test.FOO = "ola!"
{ regex: { pattern: '^[A-Z0-9_-]+$' } },
'styleName',
'src',
'srcSet',
'type',
'id',
'width',
'height',
'displayName',
'Authorization',
],
ignoreFunctions: [
'cva',
'cn',
'track',
'Error',
'console.*',
'*headers.set',
'*.addEventListener',
'*.removeEventListener',
'*.postMessage',
'*.getElementById',
'*.dispatch',
'*.commit',
'*.includes',
'*.indexOf',
'*.endsWith',
'*.startsWith',
'require',
],
// Following settings require typed linting https://typescript-eslint.io/getting-started/typed-linting/
useTsTypes: true,
ignoreMethodsOnTypes: [
// Ignore specified methods on Map and Set types
'Map.get',
'Map.has',
'Set.has',
],
},
],
},
},
{
extends: ['plugin:@typescript-eslint/disable-type-checked'],
files: ['*.js', '*.cjs', '*.mjs'],
},
{
extends: ['plugin:jest/recommended'],
files: ['**/?(*.)+test.ts?(x)'],
},
],
ignorePatterns: ['/.expo', 'node_modules', 'android', 'ios', 'dist'],
};