This repository was archived by the owner on Nov 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
54 lines (53 loc) · 1.56 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
45
46
47
48
49
50
51
52
53
54
/**
* Unified ES+TS+Prettier configuration for ESLint. Inspired by:
* https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb
*
* This file uses JS (not JSON) so we can have comments and object literals.
* PLEASE DO NOT ADD CONDITIONALS OR DYNAMIC CODE. Keep this file as pure data.
*/
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['cypress'],
env: {
browser: true,
es6: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:cypress/recommended',
'plugin:react/recommended',
// NB: please leave these at the end so they can override all other rules!
'plugin:prettier/recommended'
],
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018, // aka ECMAScript 9
sourceType: 'module' // allow `import` statement
},
rules: {
'@typescript-eslint/no-explicit-any': 'off', // maybe someday!
'@typescript-eslint/no-namespace': 'off', // Cypress makes us use namespaces
'no-empty': 'warn',
'no-extra-boolean-cast': 'warn',
'no-undef': 'off', // gives false alarms about Cypress globals e.g. JQuery
'no-unused-vars': 'off', // gives false alarms about mandatory TS param names in fn declarations!
'prettier/prettier': ['error', {singleQuote: true, trailingComma: 'es5'}],
'react/prop-types': 'off'
},
overrides: [
{
files: ['cypress/**/*.js', 'cypress/**/*.jsx'],
env: {
"cypress/globals": true
}
}
],
settings: {
react: {
version: 'detect'
}
}
};