Skip to content

Commit 56fd54f

Browse files
authored
update lint (keybase#19072)
1 parent a7382f6 commit 56fd54f

203 files changed

Lines changed: 828 additions & 653 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎shared/.eslintignore‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
1+
*.d.ts
2+
babel.config.js
13
coverage
24
desktop/build/**
35
desktop/dist/**
46
desktop/release/**
57
desktop/renderer/renderer-load.desktop.js
8+
desktop/webpack.config.babel.js
69
fixme/**
710
markdown/parser.js
11+
metro.config.js
812
node_modules
9-
test/setupTestFrameworkScriptFile.js
1013
react-native/react-native-contacts
11-
*.d.ts
14+
react-native/wipe-cache.js
15+
rn-cli.config.js
16+
rn-css-transformer.js
17+
storybook/index.native.js
18+
storybook/webpack.config.js
19+
test/setupTestFrameworkScriptFile.js

‎shared/.eslintrc.js‎

Lines changed: 98 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
env: {es6: true},
33
parser: 'babel-eslint',
4-
extends: ['eslint:recommended', 'standard', 'standard-react'],
4+
extends: ['eslint:recommended'],
55
overrides: [
66
{
77
files: ['*.tsx', '*.ts', '*.d.ts'],
@@ -22,11 +22,12 @@ module.exports = {
2222
globals: {
2323
requestAnimationFrame: 'readonly',
2424
cancelAnimationFrame: 'readonly',
25+
require: 'readonly',
2526
__DEV__: false,
2627
__STORYBOOK__: false,
2728
__STORYSHOT__: false,
2829
},
29-
plugins: ['filenames', 'babel', 'import', 'react-hooks'],
30+
plugins: ['promise', 'react', 'filenames', 'import', 'react-hooks'],
3031
settings: {
3132
'import/core-modules': ['electron', 'react-native'],
3233
'import/extensions': ['.js', '.tsx', '.d.ts', '.native.tsx', '.desktop.tsx', '.native.js', '.desktop.js'],
@@ -35,65 +36,126 @@ module.exports = {
3536
extensions: ['.js', '.tsx', '.d.ts', '.native.tsx', '.desktop.tsx', '.native.js', '.desktop.js'],
3637
},
3738
},
39+
react: {
40+
version: 'detect',
41+
},
3842
},
3943
rules: {
40-
'babel/func-params-comma-dangle': 'off',
41-
'babel/no-unused-expressions': 'off',
42-
camelcase: 'off',
44+
'array-callback-return': 'error',
4345
'comma-dangle': ['error', 'always-multiline'],
44-
curly: 'off',
45-
'filenames/match-regex': ['error', '^[0-9a-z-.]+(\\.desktop|\\.native|\\.ios|\\.android)?$'],
46+
'dot-notation': 'off',
47+
'func-call-spacing': 'off',
4648
'generator-star-spacing': 'off',
47-
'import/export': 'error',
48-
'import/imports-first': 'error',
49-
'import/named': 'error',
50-
'import/no-duplicates': 'error',
51-
'import/no-extraneous-dependencies': 'error',
52-
'import/no-mutable-exports': 'error',
53-
'import/no-named-as-default': 'error',
54-
'import/no-named-as-default-member': 'error',
55-
indent: 'off',
5649
'jsx-quotes': 'off',
50+
'lines-between-class-members': 'off',
5751
'no-duplicate-imports': 'off',
5852
'no-empty': 'off',
59-
'no-useless-return': 'off',
53+
'no-extra-semi': 'off',
54+
'no-implied-eval': 'error',
55+
'no-loop-func': 'off',
6056
'no-mixed-operators': 'off',
57+
'no-script-url': 'error',
58+
'no-self-compare': 'error',
59+
'no-sequences': 'error',
60+
'no-shadow': 'warn',
6161
'no-unused-expressions': 'off',
62-
'no-extra-semi': 'off',
63-
'promise/param-names': 'off',
62+
'no-use-before-define': 'off',
63+
'no-useless-return': 'off',
64+
'object-curly-even-spacing': 'off',
65+
'object-curly-spacing': 'off',
66+
'prefer-const': 'warn',
67+
'quote-props': 'off',
68+
'react-hooks/exhaustive-deps': 'warn',
69+
'react-hooks/rules-of-hooks': 'error',
70+
'react/boolean-prop-naming': 'error',
71+
'react/button-has-type': 'off',
72+
'react/default-props-match-prop-types': 'error',
73+
'react/destructuring-assignment': 'off',
74+
'react/display-name': 'off',
75+
'react/forbid-component-props': 'off',
76+
'react/forbid-dom-props': 'off',
77+
'react/forbid-elements': 'off',
78+
'react/forbid-foreign-prop-types': 'off',
79+
'react/forbid-prop-types': 'off',
6480
'react/jsx-boolean-value': ['error', 'always'],
81+
'react/jsx-child-element-spacing': 'off',
82+
'react/jsx-closing-bracket-location': 'off',
83+
'react/jsx-closing-tag-location': 'off',
84+
'react/jsx-curly-brace-presence': 'off',
85+
'react/jsx-curly-newline': 'off',
6586
'react/jsx-curly-spacing': 'off',
66-
'react/jsx-equals-spacing': 'error',
87+
'react/jsx-equals-spacing': 'off',
88+
'react/jsx-filename-extension': 'off',
89+
'react/jsx-first-prop-new-line': 'off',
90+
'react/jsx-fragments': ['error', 'syntax'],
91+
'react/jsx-handler-names': 'off',
6792
'react/jsx-indent': 'off',
6893
'react/jsx-indent-props': 'off',
6994
'react/jsx-key': 'error',
70-
'react/jsx-no-bind': ['error', {allowArrowFunctions: true}],
95+
'react/jsx-max-depth': 'off',
96+
'react/jsx-max-props-per-line': 'off',
97+
'react/jsx-no-bind': 'off',
98+
'react/jsx-no-comment-textnodes': 'error',
7199
'react/jsx-no-duplicate-props': 'error',
100+
'react/jsx-no-literals': 'off',
101+
'react/jsx-no-target-blank': 'error',
72102
'react/jsx-no-undef': 'error',
73-
'react/jsx-pascal-case': 'error',
103+
'react/jsx-one-expression-per-line': 'off',
104+
'react/jsx-pascal-case': 'off',
105+
'react/jsx-props-no-multi-spaces': 'off',
106+
'react/jsx-props-no-spreading': 'off',
107+
'react/jsx-sort-default-props': 'off',
108+
'react/jsx-sort-props': 'off',
109+
'react/jsx-space-before-closing': 'off',
110+
'react/jsx-tag-spacing': 'off',
74111
'react/jsx-uses-react': 'error',
75112
'react/jsx-uses-vars': 'error',
76-
'react/jsx-space-before-closing': 'off',
113+
'react/jsx-wrap-multilines': 'off',
114+
'react/no-access-state-in-setstate': 'error',
115+
'react/no-array-index-key': 'off',
116+
'react/no-children-prop': 'off',
77117
'react/no-danger': 'error',
78-
'react/no-did-mount-set-state': 'error',
79-
'react/no-did-update-set-state': 'off',
118+
'react/no-danger-with-children': 'error',
119+
'react/no-deprecated': 'warn',
120+
'react/no-did-mount-set-state': 'warn',
121+
'react/no-did-update-set-state': 'warn',
80122
'react/no-direct-mutation-state': 'error',
123+
'react/no-find-dom-node': 'warn',
81124
'react/no-is-mounted': 'error',
125+
'react/no-multi-comp': 'off',
126+
'react/no-redundant-should-component-update': 'error',
127+
'react/no-render-return-value': 'error',
128+
'react/no-set-state': 'off',
129+
'react/no-string-refs': 'error',
130+
'react/no-this-in-sfc': 'error',
131+
'react/no-typos': 'warn',
132+
'react/no-unescaped-entities': 'off',
82133
'react/no-unknown-property': 'error',
83-
'react/no-unused-prop-types': 'off',
134+
'react/no-unsafe': 'error',
135+
'react/no-unused-prop-types': 'error',
136+
'react/no-unused-state': 'error',
137+
'react/no-will-update-set-state': 'warn',
138+
'react/prefer-es6-class': 'off',
139+
'react/prefer-read-only-props': 'error',
140+
'react/prefer-stateless-function': 'warn',
84141
'react/prop-types': 'off',
85142
'react/react-in-jsx-scope': 'error',
86-
'react/require-render-return': 'error',
87-
'react-hooks/rules-of-hooks': 'error',
88-
'react-hooks/exhaustive-deps': 'warn',
143+
'react/require-default-props': 'error',
144+
'react/require-optimization': 'off',
145+
'react/require-render-return': 'off',
146+
'react/self-closing-comp': 'off',
147+
'react/sort-comp': 'off',
148+
'react/sort-prop-types': 'off',
149+
'react/state-in-constructor': 'off',
150+
'react/static-property-placement': 'off',
151+
'react/style-prop-object': 'error',
152+
'react/void-dom-elements-no-children': 'error',
89153
'sort-keys': ['error', 'asc', {caseSensitive: true, natural: false}],
90-
'space-before-function-paren': 'off',
91-
'standard/array-bracket-even-spacing': 'off',
92-
'standard/computed-property-even-spacing': ['error', 'never'],
93-
'standard/no-callback-literal': 'off',
94-
'object-curly-spacing': 'off',
95-
'object-curly-even-spacing': 'off',
96-
strict: ['error', 'global'],
97154
'yield-star-spacing': 'off',
155+
camelcase: 'off',
156+
curly: 'off',
157+
indent: 'off',
158+
quotes: 'off',
159+
strict: ['error', 'global'],
98160
},
99161
}

‎shared/__mocks__/feature-flags.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {FeatureFlags} from '../util/feature-flags'
2+
23
if (!__STORYBOOK__) {
34
throw new Error('Invalid load of mock')
45
}

‎shared/__mocks__/react-list.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as React from 'react'
22
import {clamp} from 'lodash-es'
3+
34
if (!__STORYBOOK__) {
45
throw new Error('Invalid load of mock')
56
}

‎shared/__mocks__/react-virtualized-auto-sizer.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react'
2+
23
if (!__STORYBOOK__) {
34
throw new Error('Invalid load of mock')
45
}

‎shared/actions/chat2/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {downloadFilePath} from '../../util/file'
3737
import {privateFolderWithUsers, teamFolder} from '../../constants/config'
3838
import {RPCError} from '../../util/errors'
3939
import HiddenString from '../../util/hidden-string'
40-
import {TypedActions, TypedState} from 'util/container'
40+
import {TypedActions, TypedState} from '../../util/container'
4141
import {getEngine} from '../../engine/require'
4242
import {store} from 'emoji-mart'
4343

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
import nativeSaga from './common.native'
2+
23
export default nativeSaga

‎shared/actions/pinentry.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import logger from '../logger'
2-
import * as EngineGen from '../actions/engine-gen-gen'
3-
import * as PinentryGen from '../actions/pinentry-gen'
2+
import * as EngineGen from './engine-gen-gen'
3+
import * as PinentryGen from './pinentry-gen'
44
import * as Constants from '../constants/login'
55
import * as Saga from '../util/saga'
66
import * as I from 'immutable'

‎shared/actions/platform-specific/index.native.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
PermissionsAndroid,
2020
Clipboard,
2121
} from 'react-native'
22+
// eslint-ignore-next-line messed up export in module. fixed in the next update
2223
import NetInfo from '@react-native-community/netinfo'
2324
import RNFetchBlob from 'rn-fetch-blob'
2425
import * as PushNotifications from 'react-native-push-notification'

‎shared/actions/platform-specific/push.native.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as Chat2Gen from '../chat2-gen'
22
import * as ConfigGen from '../config-gen'
33
import * as Constants from '../../constants/push'
4-
import * as FsGen from '../../actions/fs-gen'
4+
import * as FsGen from '../fs-gen'
55
import * as FsTypes from '../../constants/types/fs'
6-
import * as NotificationsGen from '../../actions/notifications-gen'
6+
import * as NotificationsGen from '../notifications-gen'
77
import * as ProfileGen from '../profile-gen'
88
import * as PushGen from '../push-gen'
99
import * as PushNotifications from 'react-native-push-notification'

0 commit comments

Comments
 (0)