-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.eslintrc.js
More file actions
56 lines (53 loc) · 1.72 KB
/
.eslintrc.js
File metadata and controls
56 lines (53 loc) · 1.72 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
module.exports = {
// means don't look to parent dir, so use `root: true` in descendant directories to ignore this config
// See https://eslint.org/docs/user-guide/configuring/configuration-files#cascading-and-hierarchy
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint', 'react-hooks', 'react'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@next/next/recommended',
'prettier',
],
env: {
amd: true,
browser: true,
jest: true,
node: true,
},
rules: {
'no-debugger': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
// allow (_arg: number) => {}
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
// Add React hooks rules so we don't misuse them.
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
// From https://github.com/typescript-eslint/typescript-eslint/issues/1391#issuecomment-1124154589
// Prefer `private` ts keyword to `#private` private methods
'no-restricted-syntax': [
'error',
{
selector:
':matches(PropertyDefinition, MethodDefinition) > PrivateIdentifier.key',
message: 'Use `private` instead',
},
],
// Makes it harder to accidentally fire off a promise without waiting for it.
'@typescript-eslint/no-floating-promises': 'error',
'react/destructuring-assignment': [2, 'always'],
},
ignorePatterns: ['node_modules', 'convex/_generated', '*.js'],
}