Skip to content

Commit fd92f95

Browse files
authored
Merge pull request #1944 from streamr-dev/update-typescript-eslint
Update @typescript-eslint stack
2 parents f55873e + c4e7ad1 commit fd92f95

File tree

26 files changed

+345
-482
lines changed

26 files changed

+345
-482
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ node_modules/
33
storybook-static/
44
*.spec.js
55
src/generated/gql/
6+
src/queries/

.eslintrc.js

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
const path = require('path')
22

33
module.exports = {
4-
extends: ['plugin:react/recommended', 'streamr-ts', 'plugin:cypress/recommended', 'prettier'],
4+
extends: [
5+
'plugin:react/recommended',
6+
'streamr-ts',
7+
'plugin:cypress/recommended',
8+
'prettier',
9+
],
510
parser: '@typescript-eslint/parser',
611
settings: {
712
'import/resolver': {
@@ -16,8 +21,20 @@ module.exports = {
1621
'react-hooks/rules-of-hooks': 'error',
1722
'react-hooks/exhaustive-deps': 'warn',
1823
'no-unused-vars': 'off', // as we prefer the typescript version of this rule
19-
'@typescript-eslint/no-unused-vars': 'warn',
24+
'@typescript-eslint/no-unused-vars': [
25+
'warn',
26+
{
27+
args: 'all',
28+
argsIgnorePattern: '^_',
29+
caughtErrors: 'all',
30+
caughtErrorsIgnorePattern: '^_',
31+
destructuredArrayIgnorePattern: '^_',
32+
varsIgnorePattern: '^_',
33+
ignoreRestSiblings: true,
34+
},
35+
],
2036
'@typescript-eslint/ban-ts-comment': 'warn',
37+
'@typescript-eslint/no-require-imports': 'off',
2138
'no-multiple-empty-lines': 'warn',
2239
'jsx-a11y/no-noninteractive-tabindex': 'warn',
2340
'react/jsx-indent': 'warn',
@@ -32,12 +49,20 @@ module.exports = {
3249
'promise/always-return': 'off',
3350
'require-atomic-updates': 'off',
3451
'react/sort-comp': 0,
35-
"react/no-unknown-property": ['error', { ignore: ['css'] }],
52+
'react/no-unknown-property': ['error', { ignore: ['css'] }],
3653
'import/extensions': 'off',
3754
'import/order': [
3855
'warn',
3956
{
40-
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
57+
groups: [
58+
'builtin',
59+
'external',
60+
'internal',
61+
'parent',
62+
'sibling',
63+
'index',
64+
'object',
65+
],
4166
pathGroups: [
4267
{
4368
pattern: '$*/**',
@@ -53,7 +78,7 @@ module.exports = {
5378
pattern: '~/**',
5479
group: 'internal',
5580
position: 'after',
56-
}
81+
},
5782
],
5883
},
5984
],
@@ -64,16 +89,8 @@ module.exports = {
6489
allowArgumentsExplicitlyTypedAsAny: true,
6590
},
6691
],
67-
"@typescript-eslint/no-namespace": "off",
68-
"no-underscore-dangle": "off",
69-
"@typescript-eslint/ban-types": [
70-
"error",
71-
{
72-
"types": {
73-
"{}": false,
74-
},
75-
},
76-
],
92+
'@typescript-eslint/no-namespace': 'off',
93+
'no-underscore-dangle': 'off',
7794
},
7895
overrides: [
7996
{

cypress/support/e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import './commands'
1717

1818
declare global {
1919
namespace Cypress {
20-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
20+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
2121
interface Chainable {
2222
// Def types for your custom commands here, sir (or maddam).
2323
}

0 commit comments

Comments
 (0)