-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
44 lines (44 loc) · 1.51 KB
/
.eslintrc.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 = {
env: {
browser: true,
es2021: true,
},
extends: [
'next/core-web-vitals',
'airbnb-base',
'airbnb-typescript',
],
ignorePatterns: [
'**/*.js',
'node_modules/*'
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './test/cypress/tsconfig.json']
},
plugins: [
'react',
'@typescript-eslint',
],
rules: {
'@typescript-eslint/comma-dangle': 'off', // allows no comma dangle
'@typescript-eslint/semi': ['error', 'never'], // forces no semicolon
'@typescript-eslint/no-unused-expressions': 'off', // allows true && runFunction()
'@typescript-eslint/no-unused-vars': [ // allows unused vars with explicit underscore
'error',
{ 'argsIgnorePattern': '^_', 'varsIgnorePattern': '^_', 'caughtErrorsIgnorePattern': '^_' },
],
'@typescript-eslint/no-use-before-define': 'off', // allows functions calls before definition
'jsx-quotes': ['error', 'prefer-double'], // force double quotes for jsx props
'object-curly-newline': 'off', // allows objects on one line
'operator-linebreak': 'off', // allows "&&" to be at the end of a line (for jsx specifically)
'react/prop-types': 'off', // no need for propTypes in typescript
'react/react-in-jsx-scope': 'off', // no need to import React in jsx files
'react-hooks/exhaustive-deps': 'off' // no need for all dependencies for useEffect
}
};