-
Notifications
You must be signed in to change notification settings - Fork 420
/
typescript.js
44 lines (44 loc) · 1.34 KB
/
typescript.js
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
module.exports = {
globals: {
React: true,
JSX: true,
},
extends: [
'plugin:@typescript-eslint/recommended', // Uses rules from `@typescript-eslint/eslint-plugin`,
'airbnb-typescript',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
// Layer in all the JS Rules
'./.eslintrc.js',
],
// then add some extra good stuff for Typescript
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
// Then we add our own custom typescript rules
rules: {
// This allows us to use async function on addEventListener(). Discussion: https://twitter.com/wesbos/status/1337074242161172486
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'@typescript-eslint/no-explicit-any': 'off',
'no-unused-vars': 0,
'@typescript-eslint/no-unused-vars': [1, { ignoreRestSiblings: true }],
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': [
'warn',
{
ignoreDeclarationMerge: true,
},
],
'@typescript-eslint/no-floating-promises': 'off',
'@typescript-eslint/no-use-before-define': 'off',
// this is covered by the typescript compiler, so we don't need it
'no-undef': 'off',
'no-shadow': 'off', // TS does it
},
parserOptions: {
project: './tsconfig.json',
},
};