Skip to content

Commit

Permalink
lint: make Props types readonly (step 2 of 3)
Browse files Browse the repository at this point in the history
Make more Props types readonly.  In particular, the type `{}` is not
readonly, but the type `{||}` is.

This is also an automatic transformation, performed by the following:

  find src -name '*.js' |\
    xargs perl -i -0pe 's/PureComponent<\{\}>/PureComponent<\{||\}>/sg'
  • Loading branch information
rk-for-zulip committed Nov 7, 2019
1 parent aaba085 commit f079e71
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/common/LineSeparator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { View } from 'react-native';
import type { ThemeColors } from '../styles';
import { ThemeContext } from '../styles';

export default class LineSeparator extends PureComponent<{}> {
export default class LineSeparator extends PureComponent<{||}> {
static contextType = ThemeContext;
context: ThemeColors;

Expand Down
2 changes: 1 addition & 1 deletion src/common/OptionDivider.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { View } from 'react-native';
import type { ThemeColors } from '../styles';
import { ThemeContext } from '../styles';

export default class OptionDivider extends PureComponent<{}> {
export default class OptionDivider extends PureComponent<{||}> {
static contextType = ThemeContext;
context: ThemeColors;

Expand Down
2 changes: 1 addition & 1 deletion src/common/SectionSeparator.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const styles = StyleSheet.create({
},
});

export default class SectionSeparator extends PureComponent<{}> {
export default class SectionSeparator extends PureComponent<{||}> {
render() {
return <View style={styles.separator} />;
}
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics/TimingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Screen } from '../common';
import TimeItem from './TimeItem';
import timing from '../utils/timing';

export default class TimingScreen extends PureComponent<{}> {
export default class TimingScreen extends PureComponent<{||}> {
render() {
return (
<Screen title="Timing" scrollEnabled={false}>
Expand Down
2 changes: 1 addition & 1 deletion src/diagnostics/VariablesScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import config from '../config';
import { Screen } from '../common';
import InfoItem from './InfoItem';

export default class VariablesScreen extends PureComponent<{}> {
export default class VariablesScreen extends PureComponent<{||}> {
render() {
const variables = {
enableReduxLogging: config.enableReduxLogging,
Expand Down
2 changes: 1 addition & 1 deletion src/main/MainScreenWithTabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OfflineNotice, ZulipStatusBar } from '../common';
import MainTabs from './MainTabs';
import styles from '../styles';

export default class MainScreenWithTabs extends PureComponent<{}> {
export default class MainScreenWithTabs extends PureComponent<{||}> {
context: Context;

static contextTypes = {
Expand Down
2 changes: 1 addition & 1 deletion src/message/AnnouncementOnly.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { View } from 'react-native';
import { Label } from '../common';
import styles from '../styles';

class AnnouncementOnly extends PureComponent<{}> {
class AnnouncementOnly extends PureComponent<{||}> {
render() {
return (
<View style={styles.disabledComposeBox}>
Expand Down
2 changes: 1 addition & 1 deletion src/start/CompatibilityScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const GooglePlayBadge = () => (
<Image style={styles.googlePlayBadge} source={googlePlayBadgePNG} resizeMode="contain" />
);

export default class CompatibilityScreen extends PureComponent<{}> {
export default class CompatibilityScreen extends PureComponent<{||}> {
storeURL =
Platform.OS === 'ios'
? 'https://itunes.apple.com/app/zulip/id1203036395'
Expand Down
2 changes: 1 addition & 1 deletion src/start/LoadingScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const styles = StyleSheet.create({
},
});

export default class LoadingScreen extends PureComponent<{}> {
export default class LoadingScreen extends PureComponent<{||}> {
render() {
return (
<View style={styles.center}>
Expand Down
2 changes: 1 addition & 1 deletion src/start/WelcomeHelpScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const styles = StyleSheet.create({
},
});

export default class WelcomeHelpScreen extends PureComponent<{}> {
export default class WelcomeHelpScreen extends PureComponent<{||}> {
render() {
return (
<Screen title="Help" centerContent padding>
Expand Down

0 comments on commit f079e71

Please sign in to comment.