Add eslint eol-last to require newline at end of files (#4985)

This commit is contained in:
Joseph Baylon
2020-11-30 20:46:05 -08:00
committed by GitHub
parent e719f43485
commit 67398d83cb
106 changed files with 106 additions and 105 deletions

View File

@@ -22,6 +22,7 @@
"__DEV__": true
},
"rules": {
"eol-last": ["error", "always"],
"global-require": 0,
"no-undefined": 0,
"react/display-name": [2, { "ignoreTranspilerName": false }],

View File

@@ -419,4 +419,4 @@ async function getProfilesFromPromises(promises: Array<Promise<ActionResult>>):
} catch {
return null;
}
}
}

View File

@@ -97,4 +97,4 @@ async function getCustomEmojiByName(name) {
}
return null;
}
}

View File

@@ -48,4 +48,4 @@ export function closePermalink() {
showingPermalink = false;
return dispatch(selectFocusedPostId(''));
};
}
}

View File

@@ -185,4 +185,4 @@ describe('Actions.Views.Post', () => {
const receivedStatuses = actionTypes.filter((type) => type === UserTypes.RECEIVED_STATUSES);
expect(receivedStatuses.length).toBe(1);
});
});
});

View File

@@ -242,4 +242,4 @@ export function setCurrentUserStatusOffline() {
}
/* eslint-disable no-import-assign */
HelperActions.forceLogoutIfNecessary = forceLogoutIfNecessary;
HelperActions.forceLogoutIfNecessary = forceLogoutIfNecessary;

View File

@@ -176,4 +176,4 @@ describe('Websocket Chanel Events', () => {
const {channels} = store.getState().entities.channels;
assert.ok(Object.keys(channels).length);
});
});
});

View File

@@ -57,4 +57,4 @@ describe('Websocket General Events', () => {
assert.ok(config.EnableCustomEmoji === 'true');
assert.ok(config.EnableLinkPreviews === 'false');
});
});
});

View File

@@ -24,4 +24,4 @@ export function handleLicenseChangedEvent(msg: WebSocketMessage): GenericAction
type: GeneralTypes.CLIENT_LICENSE_RECEIVED,
data,
};
}
}

View File

@@ -20,4 +20,4 @@ export function handleGroupUpdatedEvent(msg: WebSocketMessage) {
]));
return {data: true};
};
}
}

View File

@@ -44,4 +44,4 @@ describe('Websocket Integration Events', () => {
assert.ok(dialog.trigger_id === 'sometriggerid');
assert.ok(dialog.dialog);
});
});
});

View File

@@ -11,4 +11,4 @@ export function handleOpenDialogEvent(msg: WebSocketMessage) {
dispatch({type: IntegrationTypes.RECEIVED_DIALOG, data: JSON.parse(data)});
return {data: true};
};
}
}

View File

@@ -206,4 +206,4 @@ export function handlePostUnread(msg: WebSocketMessage) {
return {data: null};
};
}
}

View File

@@ -57,4 +57,4 @@ export function handlePreferencesDeletedEvent(msg: WebSocketMessage): GenericAct
const preferences = JSON.parse(msg.data.preferences);
return {type: PreferenceTypes.DELETED_PREFERENCES, data: preferences};
}
}

View File

@@ -57,4 +57,4 @@ describe('Websocket Reaction Events', () => {
assert.ok(emojis);
assert.ok(emojis[created.id]);
});
});
});

View File

@@ -38,4 +38,4 @@ export function handleReactionRemovedEvent(msg: WebSocketMessage): GenericAction
type: PostTypes.REACTION_DELETED,
data: reaction,
};
}
}

View File

@@ -30,4 +30,4 @@ export function handleRoleUpdatedEvent(msg: WebSocketMessage): GenericAction {
type: RoleTypes.RECEIVED_ROLE,
data: role,
};
}
}

View File

@@ -103,4 +103,4 @@ describe('Websocket Team Events', () => {
const {myMembers} = store.getState().entities.teams;
assert.ifError(myMembers[team.id]);
});
});
});

View File

@@ -103,4 +103,4 @@ export function handleTeamAddedEvent(msg: WebSocketMessage) {
return {data: true};
};
}
}

View File

@@ -91,4 +91,4 @@ describe('Websocket User Events', () => {
assert.strictEqual(profiles[user.id].first_name, 'tester4');
});
});
});
});

View File

@@ -202,4 +202,4 @@ export function handleUserUpdatedEvent(msg: WebSocketMessage) {
}
return {data: true};
};
}
}

View File

@@ -35,4 +35,4 @@ const AppVersion = () => {
);
};
export default AppVersion;
export default AppVersion;

View File

@@ -41,4 +41,4 @@ describe('AtMention', () => {
wrapper.setState({user: {username: 'Victor.Welch'}});
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -75,4 +75,4 @@ AutocompleteSectionHeader.propTypes = {
isFirstSection: PropTypes.bool,
};
export default AutocompleteSectionHeader;
export default AutocompleteSectionHeader;

View File

@@ -72,4 +72,4 @@ describe('components/autocomplete/emoji_suggestion', () => {
expect(wrapper.state('dataSource')).toEqual(output3);
}, 100);
});
});
});

View File

@@ -18,4 +18,4 @@ describe('ChannelLoader', () => {
const wrapper = shallow(<ChannelLoader {...baseProps}/>);
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -4,4 +4,4 @@
import {createIconSetFromFontello} from 'react-native-vector-icons';
import fontelloConfig from '@assets/compass-icons.json';
export default createIconSetFromFontello(fontelloConfig, 'compass-icons', 'compass-icons.ttf');
export default createIconSetFromFontello(fontelloConfig, 'compass-icons', 'compass-icons.ttf');

View File

@@ -79,4 +79,4 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
};
});
export default DeletedPost;
export default DeletedPost;

View File

@@ -91,4 +91,4 @@ describe('EditChannelInfo', () => {
instance.onKeyboardDidShow();
expect(instance.scrollHeaderToTop).toHaveBeenCalledTimes(2);
});
});
});

View File

@@ -52,4 +52,4 @@ export default class ImageViewPort extends PureComponent {
render() {
return null;
}
}
}

View File

@@ -125,4 +125,4 @@ describe('ActionButton', () => {
expect(dynamicButtonStyles).toBe(undefined);
expect(buttonTextChild.props.style.color).toBe(Preferences.THEMES.default.centerChannelColor);
});
});
});

View File

@@ -88,4 +88,4 @@ const styles = StyleSheet.create({
ActionButtonText.propTypes = {
message: PropTypes.string.isRequired,
style: PropTypes.object.isRequired,
};
};

View File

@@ -140,4 +140,4 @@ describe('ActionButtonText emojis', () => {
expect(emoticonChild.props.textStyle.fontSize).toBe(12);
});
});
});
});

View File

@@ -20,4 +20,4 @@ describe('PostAttachmentImage', () => {
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -120,4 +120,4 @@ describe('makeMapStateToProps', () => {
mapStateToProps(defaultState, defaultOwnProps);
expect(canDeletePost).toHaveBeenCalledTimes(1);
});
});
});

View File

@@ -103,4 +103,4 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => ({
color: 'white',
fontWeight: 'bold',
},
}));
}));

View File

@@ -117,4 +117,4 @@ describe('mapStateToProps', () => {
permission: Permissions.USE_CHANNEL_MENTIONS,
});
});
});
});

View File

@@ -180,4 +180,4 @@ const style = StyleSheet.create({
justifyContent: 'center',
padding: 10,
},
});
});

View File

@@ -101,4 +101,4 @@ describe('FileQuickAction', () => {
expect(request).toHaveBeenCalled();
expect(hasPermission).toBe(true);
});
});
});

View File

@@ -17,4 +17,4 @@ function mapStateToProps(state) {
};
}
export default connect(mapStateToProps, null, null, {forwardRef: true})(QuickActions);
export default connect(mapStateToProps, null, null, {forwardRef: true})(QuickActions);

View File

@@ -88,4 +88,4 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
padding: 10,
},
};
});
});

View File

@@ -136,4 +136,4 @@ const style = StyleSheet.create({
flexDirection: 'row',
height: 44,
},
});
});

View File

@@ -67,4 +67,4 @@ const getStyle = makeStyleSheetFromTheme((theme: Theme) => ({
},
}));
export default ReadOnlyChannnel;
export default ReadOnlyChannnel;

View File

@@ -154,4 +154,4 @@ describe('PostHeader', () => {
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -53,4 +53,4 @@ describe('RetryBarIndicator', () => {
expect(Animated.timing).toHaveBeenCalledTimes(1);
});
});
});
});

View File

@@ -54,4 +54,4 @@ const DrawerLayoutAdapter = (props: DrawerLayoutAdapterProps) => {
);
};
export default DrawerLayoutAdapter;
export default DrawerLayoutAdapter;

View File

@@ -307,4 +307,4 @@ const style = StyleSheet.create({
swiperContent: {
flex: 1,
},
});
});

View File

@@ -175,4 +175,4 @@ const getStyleSheet = makeStyleSheetFromTheme((theme) => {
marginTop: 35,
},
};
});
});

View File

@@ -2,4 +2,4 @@
// See LICENSE.txt for license information.
export const ALL_EMOJIS = 'all_emojis';
export const MAX_ALLOWED_REACTIONS = 40;
export const MAX_ALLOWED_REACTIONS = 40;

View File

@@ -4,4 +4,4 @@
export default {
EMPTY_ARRAY: [],
EMTPY_OBJECT: {},
};
};

View File

@@ -85,4 +85,4 @@ describe('Fetch', () => {
expect(Client4.serverVersion).toEqual(serverVersion1);
expect(emit).toHaveBeenCalledWith(General.SERVER_VERSION_CHANGED, serverVersion1);
});
});
});

View File

@@ -251,4 +251,4 @@ class PushNotifications {
};
}
export default new PushNotifications();
export default new PushNotifications();

View File

@@ -79,4 +79,4 @@ describe('componentDidDisappearListener', () => {
expect(EventEmitter.emit).toHaveBeenCalledTimes(1);
expect(EventEmitter.emit).toHaveBeenCalledWith(NavigationTypes.MAIN_SIDEBAR_DID_CLOSE);
});
});
});

View File

@@ -5,4 +5,4 @@ export default {
MEMBERS: 'members',
GUESTS: 'guests',
ADMINS: 'admins',
};
};

View File

@@ -107,4 +107,4 @@ describe('Reducers.teams.myMembers', () => {
state = teamsReducer(state, testAction);
assert.deepEqual(state.myMembers, {team_id_1: myMember1});
});
});
});

View File

@@ -17,4 +17,4 @@ export type BotPatch = {
username: string;
display_name: string;
description: string;
}
}

View File

@@ -31,4 +31,4 @@ export type FilesState = {
export type FileUploadResponse = {
file_infos: FileInfo[];
client_ids: string[];
}
}

View File

@@ -4,4 +4,4 @@ declare module 'gfycat-sdk';
declare module 'remote-redux-devtools';
declare module 'redux-action-buffer';
declare module 'react-intl';
declare module 'react-native-local-auth';
declare module 'react-native-local-auth';

View File

@@ -38,4 +38,4 @@ export type Theme = {
mentionHighlightBg: string;
mentionHighlightLink: string;
codeTheme: string;
};
};

View File

@@ -67,4 +67,4 @@ export type JobsRequestsStatuses = {
export type SearchRequestsStatuses = {
flaggedPosts: RequestStatusType;
pinnedPosts: RequestStatusType;
};
};

View File

@@ -30,4 +30,4 @@ export type SearchParameter = {
page: number;
per_page: number;
include_deleted_channels: boolean;
}
}

View File

@@ -55,4 +55,4 @@ export type TeamUnread = {
team_id: string;
mention_count: number;
msg_count: number;
};
};

View File

@@ -27,4 +27,4 @@ export type EmailMappedObjects<E extends {email: string}> = {
export type Dictionary<T> = {
[key: string]: T;
};
};

View File

@@ -15,4 +15,4 @@ export type WebSocketMessage = {
data: any;
broadcast: WebsocketBroadcast;
seq: number;
}
}

View File

@@ -89,4 +89,4 @@ describe('group utils', () => {
assert.deepEqual(filterGroupsMatchingTerm(groups, '@software'), [groupC]);
});
});
});
});

View File

@@ -20,4 +20,4 @@ export default function recentEmojis(state = [], action) {
default:
return state;
}
}
}

View File

@@ -114,4 +114,4 @@ const style = StyleSheet.create({
flex: {
flex: 1,
},
});
});

View File

@@ -148,4 +148,4 @@ const getStyle = makeStyleSheetFromTheme((theme) => ({
flex: {
flex: 1,
},
}));
}));

View File

@@ -155,4 +155,4 @@ ChannelNavBar.propTypes = {
theme: PropTypes.object.isRequired,
};
export default ChannelNavBar;
export default ChannelNavBar;

View File

@@ -51,4 +51,4 @@ describe('ChannelInfo -> Add Members', () => {
);
expect(wrapper.getElement()).toBeNull();
});
});
});

View File

@@ -63,4 +63,4 @@ describe('ChannelInfo -> Archive', () => {
);
expect(wrapper.getElement()).toBeNull();
});
});
});

View File

@@ -43,4 +43,4 @@ describe('ChannelInfo -> ConvertPrivate', () => {
);
expect(wrapper.getElement()).toBeNull();
});
});
});

View File

@@ -41,4 +41,4 @@ describe('ChannelInfo -> EditChannel', () => {
);
expect(wrapper.getElement()).toBeNull();
});
});
});

View File

@@ -43,4 +43,4 @@ describe('ChannelInfo -> Favorite', () => {
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -40,4 +40,4 @@ const Favorite = ({channelId, favoriteChannel, isFavorite, unfavoriteChannel, te
);
};
export default memo(Favorite);
export default memo(Favorite);

View File

@@ -43,4 +43,4 @@ describe('ChannelInfo -> IgnoreMentions', () => {
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -44,4 +44,4 @@ const IgnoreMentions = ({channelId, ignore, updateChannelNotifyProps, userId, te
);
};
export default memo(IgnoreMentions);
export default memo(IgnoreMentions);

View File

@@ -94,4 +94,4 @@ describe('ChannelInfo -> Leave', () => {
);
expect(wrapper.getElement()).toBeNull();
});
});
});

View File

@@ -63,4 +63,4 @@ describe('ChannelInfo -> Manage Members', () => {
);
expect(wrapper.getElement()).toBeNull();
});
});
});

View File

@@ -43,4 +43,4 @@ describe('ChannelInfo -> Mute', () => {
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -43,4 +43,4 @@ const Mute = ({channelId, isChannelMuted, updateChannelNotifyProps, userId, test
);
};
export default memo(Mute);
export default memo(Mute);

View File

@@ -32,4 +32,4 @@ describe('ChannelInfo -> Pinned', () => {
);
expect(wrapper.getElement()).toMatchSnapshot();
});
});
});

View File

@@ -25,4 +25,4 @@ const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => ({
},
}));
export default Separator;
export default Separator;

View File

@@ -56,4 +56,4 @@ describe('ChannelMembers', () => {
const renderItem = wrapper.find(CustomList).props().renderItem;
expect(renderItem).toEqual(wrapper.instance().renderSelectableItem);
});
});
});

View File

@@ -90,4 +90,4 @@ const styles = StyleSheet.create({
},
});
export default NotificationIcon;
export default NotificationIcon;

View File

@@ -29,4 +29,4 @@ const styles = StyleSheet.create({
},
});
export default NotificationTitle;
export default NotificationTitle;

View File

@@ -80,4 +80,4 @@ describe('SelectServer', () => {
expect(queryByTestId('select_server.error.text')).toBeNull();
await waitFor(() => expect(getByText('Connecting...')).toBeTruthy());
});
});
});

View File

@@ -36,4 +36,4 @@ export const getCustomTheme = createSelector(
}
return null;
},
);
);

View File

@@ -35,4 +35,4 @@ export async function getStoredState() {
}
return {storeKeys, restoredState};
}
}

View File

@@ -32,4 +32,4 @@ export function createMiddlewares(clientOptions: any): ThunkMiddleware[] {
}
return middleware;
}
}

View File

@@ -70,4 +70,4 @@ async function saveStateToFile(store) {
mattermostBucket.writeToFile('entities', JSON.stringify(entities));
}
}
}

View File

@@ -71,4 +71,4 @@ export default function messageRetention(store) {
return next(action);
};
}
}

View File

@@ -14,4 +14,4 @@ class Store {
}
}
export default new Store();
export default new Store();

View File

@@ -29,4 +29,4 @@ interface NotificationWithData extends Notification {
payload?: NotificationData;
foreground?: boolean;
userInteraction?: boolean;
}
}

View File

@@ -173,4 +173,4 @@ export function compareEmojis(emojiA, emojiB, searchedName) {
}
return doDefaultComparison(aName, bName);
}
}

View File

@@ -10,4 +10,4 @@ export function getStatusColors(theme) {
primary: theme.buttonBg,
success: theme.onlineIndicator,
};
}
}

View File

@@ -8,4 +8,4 @@ export function buildPreference(category, userId, name, value = 'true') {
name,
value,
};
}
}

View File

@@ -71,4 +71,4 @@ function unsupportedServerAlert(formatMessage: FormatMessageType) {
const options = {cancelable: false};
Alert.alert(title, message, buttons, options);
}
}

View File

@@ -30,4 +30,4 @@ module.exports = {
transformIgnorePatterns: [
'node_modules/(?!react-native|jail-monkey|@sentry/react-native|react-navigation|@react-native-community/cameraroll)',
],
};
};

View File

@@ -36,4 +36,4 @@ module.exports = [
'app/store/store.ts',
'app/store/utils.js',
'share_extension/android/index.js',
];
];

Some files were not shown because too many files have changed in this diff Show More