diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-10-28 16:16:08 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-10-29 13:12:44 +0100 |
| commit | 9ca15a449584bf80a7c2de31415ef33aa8dd0c8e (patch) | |
| tree | 808b670d2e8472075c3506d503c77e184685216e | |
| parent | 68433afb080e8c6cab4766daee7dd884ad721096 (diff) | |
| download | mullvadvpn-9ca15a449584bf80a7c2de31415ef33aa8dd0c8e.tar.xz mullvadvpn-9ca15a449584bf80a7c2de31415ef33aa8dd0c8e.zip | |
Disallow ts-comments other than ts-ignore and remove one ts-ignore
| -rw-r--r-- | gui/.eslintrc.js | 2 | ||||
| -rw-r--r-- | gui/src/renderer/components/LocationList.tsx | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/gui/.eslintrc.js b/gui/.eslintrc.js index 66948d120e..02e377d84a 100644 --- a/gui/.eslintrc.js +++ b/gui/.eslintrc.js @@ -91,10 +91,10 @@ module.exports = { 'no-return-await': 'error', 'react/jsx-no-bind': 'error', '@typescript-eslint/naming-convention': ['error', ...namingConvention], + '@typescript-eslint/ban-ts-comment': ['error', { 'ts-ignore': false }], '@typescript-eslint/no-use-before-define': 'off', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/ban-ts-comment': 'off', }, }; diff --git a/gui/src/renderer/components/LocationList.tsx b/gui/src/renderer/components/LocationList.tsx index 2f2b440dfc..2f8d44048e 100644 --- a/gui/src/renderer/components/LocationList.tsx +++ b/gui/src/renderer/components/LocationList.tsx @@ -124,8 +124,9 @@ export default class LocationList<SpecialValueType> extends React.Component< if (typeof this.props.selectedElementRef === 'function') { this.props.selectedElementRef(value); } else { - // @ts-ignore - this.props.selectedElementRef.current = value; + const ref = this.props + .selectedElementRef as React.MutableRefObject<React.ReactInstance | null>; + ref.current = value; } } } |
