Turn on all of Microsoft's recommend lint rules
Biggest changes forced by this: alt tags for all images, resulting in new strings added to messages.json, and a new i18n paramter/prop added in a plot of places. Another change of note is that there are two new tslint.json files under ts/test and ts/styleguide to relax our rules a bit there. This required a change to our package.json script, as manually specifying the config file there made it ignore our tslint.json files in subdirectories
This commit is contained in:
parent
23586be6b0
commit
2988da0981
49 changed files with 311 additions and 123 deletions
|
@ -1,11 +1,10 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { padStart, sample } from 'lodash';
|
||||
import { default as _, padStart, sample } from 'lodash';
|
||||
import libphonenumber from 'google-libphonenumber';
|
||||
|
||||
import _ from 'lodash';
|
||||
import moment from 'moment';
|
||||
import qs from 'qs';
|
||||
import QueryString from 'qs';
|
||||
|
||||
export { _ };
|
||||
|
||||
|
@ -57,6 +56,7 @@ function makeObjectUrl(data: ArrayBuffer, contentType: string): string {
|
|||
const blob = new Blob([data], {
|
||||
type: contentType,
|
||||
});
|
||||
|
||||
return URL.createObjectURL(blob);
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ export {
|
|||
const parent = window as any;
|
||||
|
||||
const query = window.location.search.replace(/^\?/, '');
|
||||
const urlOptions = qs.parse(query);
|
||||
const urlOptions = QueryString.parse(query);
|
||||
const theme = urlOptions.theme || 'android';
|
||||
const locale = urlOptions.locale || 'en';
|
||||
|
||||
|
@ -99,11 +99,11 @@ import localeMessages from '../../_locales/en/messages.json';
|
|||
|
||||
// @ts-ignore
|
||||
import { setup } from '../../js/modules/i18n';
|
||||
import filesize from 'filesize';
|
||||
import fileSize from 'filesize';
|
||||
|
||||
const i18n = setup(locale, localeMessages);
|
||||
|
||||
parent.filesize = filesize;
|
||||
parent.filesize = fileSize;
|
||||
|
||||
parent.i18n = i18n;
|
||||
parent.React = React;
|
||||
|
@ -137,6 +137,7 @@ const Attachments = {
|
|||
parent.Signal = Signal.setup({
|
||||
Attachments,
|
||||
userDataPath: '/',
|
||||
// tslint:disable-next-line:no-backbone-get-set-outside-model
|
||||
getRegionCode: () => parent.storage.get('regionCode'),
|
||||
});
|
||||
parent.SignalService = SignalService;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue