diff options
author | 2021-07-30 10:54:54 +0200 | |
---|---|---|
committer | 2021-07-30 14:24:54 +0530 | |
commit | f4b4416ea52d564bc2dbe543a82084ed98843ccc (patch) | |
tree | 7ca6b23571c86458a6b799746c91a7191de02715 /src/components/ui | |
parent | 5.6.1-nightly.8 [skip ci] (diff) | |
download | ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.gz ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.tar.zst ferdium-app-f4b4416ea52d564bc2dbe543a82084ed98843ccc.zip |
chore: migrate from tslint to @typescript-eslint (#1706)
- update .eslintrc to work for .js and .ts
- update devDependencies
- lint properly both root /src and nested /packages
- update webhint recommended setting for tsconfig.json to shrink output
- Manage all eslint rules from the repo root
- escape single quotes in scripts to please windows build
Co-authored-by: Vijay A <avijayr@protonmail.com>
Diffstat (limited to 'src/components/ui')
-rw-r--r-- | src/components/ui/AppLoader/index.js | 2 | ||||
-rw-r--r-- | src/components/ui/FeatureItem.js | 2 | ||||
-rw-r--r-- | src/components/ui/FeatureList.js | 2 | ||||
-rw-r--r-- | src/components/ui/Link.js | 2 | ||||
-rw-r--r-- | src/components/ui/Modal/styles.js | 2 | ||||
-rw-r--r-- | src/components/ui/Radio.js | 2 | ||||
-rw-r--r-- | src/components/ui/SearchInput.js | 2 | ||||
-rw-r--r-- | src/components/ui/Select.js | 4 | ||||
-rw-r--r-- | src/components/ui/ServiceIcon.js | 2 | ||||
-rw-r--r-- | src/components/ui/Slider.js | 2 | ||||
-rw-r--r-- | src/components/ui/Tabs/TabItem.js | 8 | ||||
-rw-r--r-- | src/components/ui/Tabs/Tabs.js | 2 | ||||
-rw-r--r-- | src/components/ui/Toggle.js | 2 | ||||
-rw-r--r-- | src/components/ui/ToggleRaw.js | 2 | ||||
-rw-r--r-- | src/components/ui/WebviewLoader/styles.js | 2 |
15 files changed, 18 insertions, 20 deletions
diff --git a/src/components/ui/AppLoader/index.js b/src/components/ui/AppLoader/index.js index a7f6f4545..31d7ca249 100644 --- a/src/components/ui/AppLoader/index.js +++ b/src/components/ui/AppLoader/index.js | |||
@@ -37,7 +37,7 @@ export default @injectSheet(styles) @withTheme class AppLoader extends Component | |||
37 | 37 | ||
38 | componentDidMount() { | 38 | componentDidMount() { |
39 | this.interval = setInterval(() => { | 39 | this.interval = setInterval(() => { |
40 | this.setState(prevState => ({ | 40 | this.setState((prevState) => ({ |
41 | step: prevState.step === textList.length - 1 ? 0 : prevState.step + 1, | 41 | step: prevState.step === textList.length - 1 ? 0 : prevState.step + 1, |
42 | })); | 42 | })); |
43 | }, 2500); | 43 | }, 2500); |
diff --git a/src/components/ui/FeatureItem.js b/src/components/ui/FeatureItem.js index 4926df470..646cf56ca 100644 --- a/src/components/ui/FeatureItem.js +++ b/src/components/ui/FeatureItem.js | |||
@@ -4,7 +4,7 @@ import { Icon } from '@meetfranz/ui'; | |||
4 | import classnames from 'classnames'; | 4 | import classnames from 'classnames'; |
5 | import { mdiCheckCircle } from '@mdi/js'; | 5 | import { mdiCheckCircle } from '@mdi/js'; |
6 | 6 | ||
7 | const styles = theme => ({ | 7 | const styles = (theme) => ({ |
8 | featureItem: { | 8 | featureItem: { |
9 | borderBottom: [1, 'solid', theme.defaultContentBorder], | 9 | borderBottom: [1, 'solid', theme.defaultContentBorder], |
10 | padding: [8, 0], | 10 | padding: [8, 0], |
diff --git a/src/components/ui/FeatureList.js b/src/components/ui/FeatureList.js index ada15244b..cf2664830 100644 --- a/src/components/ui/FeatureList.js +++ b/src/components/ui/FeatureList.js | |||
@@ -92,7 +92,7 @@ export class FeatureList extends Component { | |||
92 | 92 | ||
93 | return ( | 93 | return ( |
94 | <ul className={className}> | 94 | <ul className={className}> |
95 | {features.map(feature => <FeatureItem name={intl.formatMessage(feature)} className={featureClassName} />)} | 95 | {features.map((feature) => <FeatureItem name={intl.formatMessage(feature)} className={featureClassName} />)} |
96 | </ul> | 96 | </ul> |
97 | ); | 97 | ); |
98 | } | 98 | } |
diff --git a/src/components/ui/Link.js b/src/components/ui/Link.js index 7930d98b4..fd14b7018 100644 --- a/src/components/ui/Link.js +++ b/src/components/ui/Link.js | |||
@@ -48,7 +48,7 @@ export default @inject('stores') @observer class Link extends Component { | |||
48 | href={router.history.createHref(to)} | 48 | href={router.history.createHref(to)} |
49 | className={linkClasses} | 49 | className={linkClasses} |
50 | style={style} | 50 | style={style} |
51 | onClick={e => this.onClick(e)} | 51 | onClick={(e) => this.onClick(e)} |
52 | > | 52 | > |
53 | {children} | 53 | {children} |
54 | </a> | 54 | </a> |
diff --git a/src/components/ui/Modal/styles.js b/src/components/ui/Modal/styles.js index c2bebf9bb..f32c075ce 100644 --- a/src/components/ui/Modal/styles.js +++ b/src/components/ui/Modal/styles.js | |||
@@ -1,4 +1,4 @@ | |||
1 | export default theme => ({ | 1 | export default (theme) => ({ |
2 | component: { | 2 | component: { |
3 | zIndex: 500, | 3 | zIndex: 500, |
4 | position: 'absolute', | 4 | position: 'absolute', |
diff --git a/src/components/ui/Radio.js b/src/components/ui/Radio.js index ba13aca63..e77714eb7 100644 --- a/src/components/ui/Radio.js +++ b/src/components/ui/Radio.js | |||
@@ -54,7 +54,7 @@ export default @observer class Radio extends Component { | |||
54 | </label> | 54 | </label> |
55 | )} | 55 | )} |
56 | <div className="franz-form__radio-wrapper"> | 56 | <div className="franz-form__radio-wrapper"> |
57 | {field.options.map(type => ( | 57 | {field.options.map((type) => ( |
58 | <label | 58 | <label |
59 | key={type.value} | 59 | key={type.value} |
60 | htmlFor={`${field.id}-${type.value}`} | 60 | htmlFor={`${field.id}-${type.value}`} |
diff --git a/src/components/ui/SearchInput.js b/src/components/ui/SearchInput.js index 78d6aae8b..0b25734dd 100644 --- a/src/components/ui/SearchInput.js +++ b/src/components/ui/SearchInput.js | |||
@@ -96,7 +96,7 @@ export default @observer class SearchInput extends Component { | |||
96 | type="text" | 96 | type="text" |
97 | placeholder={placeholder} | 97 | placeholder={placeholder} |
98 | value={value} | 98 | value={value} |
99 | onChange={e => this.onChange(e)} | 99 | onChange={(e) => this.onChange(e)} |
100 | ref={(ref) => { this.input = ref; }} | 100 | ref={(ref) => { this.input = ref; }} |
101 | /> | 101 | /> |
102 | </label> | 102 | </label> |
diff --git a/src/components/ui/Select.js b/src/components/ui/Select.js index b4511433c..e7a5eafa8 100644 --- a/src/components/ui/Select.js +++ b/src/components/ui/Select.js | |||
@@ -82,7 +82,7 @@ export default @observer class Select extends Component { | |||
82 | </label> | 82 | </label> |
83 | )} | 83 | )} |
84 | <select | 84 | <select |
85 | onChange={multiple ? e => this.multipleChange(e) : field.onChange} | 85 | onChange={multiple ? (e) => this.multipleChange(e) : field.onChange} |
86 | id={field.id} | 86 | id={field.id} |
87 | defaultValue={selected} | 87 | defaultValue={selected} |
88 | className="franz-form__select" | 88 | className="franz-form__select" |
@@ -90,7 +90,7 @@ export default @observer class Select extends Component { | |||
90 | multiple={multiple} | 90 | multiple={multiple} |
91 | ref={this.element} | 91 | ref={this.element} |
92 | > | 92 | > |
93 | {field.options.map(type => ( | 93 | {field.options.map((type) => ( |
94 | <option | 94 | <option |
95 | key={type.value} | 95 | key={type.value} |
96 | value={type.value} | 96 | value={type.value} |
diff --git a/src/components/ui/ServiceIcon.js b/src/components/ui/ServiceIcon.js index 0b9155a4e..b2dadeac3 100644 --- a/src/components/ui/ServiceIcon.js +++ b/src/components/ui/ServiceIcon.js | |||
@@ -6,7 +6,7 @@ import classnames from 'classnames'; | |||
6 | 6 | ||
7 | import ServiceModel from '../../models/Service'; | 7 | import ServiceModel from '../../models/Service'; |
8 | 8 | ||
9 | const styles = theme => ({ | 9 | const styles = (theme) => ({ |
10 | root: { | 10 | root: { |
11 | height: 'auto', | 11 | height: 'auto', |
12 | }, | 12 | }, |
diff --git a/src/components/ui/Slider.js b/src/components/ui/Slider.js index b00a6a3f8..f344449a0 100644 --- a/src/components/ui/Slider.js +++ b/src/components/ui/Slider.js | |||
@@ -53,7 +53,7 @@ export default @observer class Slider extends Component { | |||
53 | value={field.value} | 53 | value={field.value} |
54 | min="1" | 54 | min="1" |
55 | max="100" | 55 | max="100" |
56 | onChange={e => (!disabled ? this.onChange(e) : null)} | 56 | onChange={(e) => (!disabled ? this.onChange(e) : null)} |
57 | /> | 57 | /> |
58 | </div> | 58 | </div> |
59 | 59 | ||
diff --git a/src/components/ui/Tabs/TabItem.js b/src/components/ui/Tabs/TabItem.js index 546b05a4e..d0ef4e798 100644 --- a/src/components/ui/Tabs/TabItem.js +++ b/src/components/ui/Tabs/TabItem.js | |||
@@ -1,17 +1,15 @@ | |||
1 | import React, { Component, Fragment } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | 2 | ||
3 | import { oneOrManyChildElements } from '../../../prop-types'; | 3 | import { oneOrManyChildElements } from '../../../prop-types'; |
4 | 4 | ||
5 | export default class TabItem extends Component { | 5 | export default class TabItem extends Component { |
6 | static propTypes = { | 6 | static propTypes = { |
7 | children: oneOrManyChildElements.isRequired, | 7 | children: oneOrManyChildElements.isRequired, |
8 | } | 8 | }; |
9 | 9 | ||
10 | render() { | 10 | render() { |
11 | const { children } = this.props; | 11 | const { children } = this.props; |
12 | 12 | ||
13 | return ( | 13 | return <>{children}</>; |
14 | <>{children}</> | ||
15 | ); | ||
16 | } | 14 | } |
17 | } | 15 | } |
diff --git a/src/components/ui/Tabs/Tabs.js b/src/components/ui/Tabs/Tabs.js index e68dc3a1d..56c76f215 100644 --- a/src/components/ui/Tabs/Tabs.js +++ b/src/components/ui/Tabs/Tabs.js | |||
@@ -28,7 +28,7 @@ class Tab extends Component { | |||
28 | 28 | ||
29 | render() { | 29 | render() { |
30 | const { children: childElements } = this.props; | 30 | const { children: childElements } = this.props; |
31 | const children = childElements.filter(c => !!c); | 31 | const children = childElements.filter((c) => !!c); |
32 | 32 | ||
33 | if (children.length === 1) { | 33 | if (children.length === 1) { |
34 | return <div>{children}</div>; | 34 | return <div>{children}</div>; |
diff --git a/src/components/ui/Toggle.js b/src/components/ui/Toggle.js index 78fb77cbe..14330e5c7 100644 --- a/src/components/ui/Toggle.js +++ b/src/components/ui/Toggle.js | |||
@@ -59,7 +59,7 @@ export default @observer class Toggle extends Component { | |||
59 | name={field.name} | 59 | name={field.name} |
60 | value={field.name} | 60 | value={field.name} |
61 | checked={field.value} | 61 | checked={field.value} |
62 | onChange={e => (!disabled ? this.onChange(e) : null)} | 62 | onChange={(e) => (!disabled ? this.onChange(e) : null)} |
63 | /> | 63 | /> |
64 | </label> | 64 | </label> |
65 | {field.error && <div className={field.error}>{field.error}</div>} | 65 | {field.error && <div className={field.error}>{field.error}</div>} |
diff --git a/src/components/ui/ToggleRaw.js b/src/components/ui/ToggleRaw.js index dcaf664e1..4700127d4 100644 --- a/src/components/ui/ToggleRaw.js +++ b/src/components/ui/ToggleRaw.js | |||
@@ -64,7 +64,7 @@ export default @observer class ToggleRaw extends Component { | |||
64 | name={field.name} | 64 | name={field.name} |
65 | value={field.name} | 65 | value={field.name} |
66 | checked={field.value} | 66 | checked={field.value} |
67 | onChange={e => (!disabled ? this.onChange(e) : null)} | 67 | onChange={(e) => (!disabled ? this.onChange(e) : null)} |
68 | /> | 68 | /> |
69 | </label> | 69 | </label> |
70 | {field.error && <div className={field.error}>{field.error}</div>} | 70 | {field.error && <div className={field.error}>{field.error}</div>} |
diff --git a/src/components/ui/WebviewLoader/styles.js b/src/components/ui/WebviewLoader/styles.js index dbd75db8a..5d58011fe 100644 --- a/src/components/ui/WebviewLoader/styles.js +++ b/src/components/ui/WebviewLoader/styles.js | |||
@@ -1,4 +1,4 @@ | |||
1 | export default theme => ({ | 1 | export default (theme) => ({ |
2 | component: { | 2 | component: { |
3 | background: theme.colorWebviewLoaderBackground, | 3 | background: theme.colorWebviewLoaderBackground, |
4 | padding: 20, | 4 | padding: 20, |