Remove TSLint
Co-authored-by: Chris Svenningsen <chris@carbonfive.com>
This commit is contained in:
parent
be705bc312
commit
dabab60f56
|
@ -33,9 +33,8 @@
|
||||||
"test-node-coverage": "nyc --reporter=lcov --reporter=text mocha --recursive test/app test/modules ts/test",
|
"test-node-coverage": "nyc --reporter=lcov --reporter=text mocha --recursive test/app test/modules ts/test",
|
||||||
"eslint": "eslint .",
|
"eslint": "eslint .",
|
||||||
"lint": "yarn format --list-different && yarn lint-windows",
|
"lint": "yarn format --list-different && yarn lint-windows",
|
||||||
"lint-windows": "yarn eslint && yarn tslint",
|
"lint-windows": "yarn eslint",
|
||||||
"lint-deps": "node ts/util/lint/linter.js",
|
"lint-deps": "node ts/util/lint/linter.js",
|
||||||
"tslint": "tslint --format stylish --project .",
|
|
||||||
"format": "prettier --write \"*.{css,js,json,md,scss,ts,tsx}\" \"./**/*.{css,js,json,md,scss,ts,tsx}\"",
|
"format": "prettier --write \"*.{css,js,json,md,scss,ts,tsx}\" \"./**/*.{css,js,json,md,scss,ts,tsx}\"",
|
||||||
"transpile": "tsc",
|
"transpile": "tsc",
|
||||||
"clean-transpile": "rimraf ts/**/*.js && rimraf ts/*.js",
|
"clean-transpile": "rimraf ts/**/*.js && rimraf ts/*.js",
|
||||||
|
@ -252,9 +251,6 @@
|
||||||
"style-loader": "1.0.0",
|
"style-loader": "1.0.0",
|
||||||
"ts-loader": "4.1.0",
|
"ts-loader": "4.1.0",
|
||||||
"ts-node": "8.3.0",
|
"ts-node": "8.3.0",
|
||||||
"tslint": "6",
|
|
||||||
"tslint-microsoft-contrib": "6.2.0",
|
|
||||||
"tslint-react": "3.6.0",
|
|
||||||
"typed-scss-modules": "0.0.11",
|
"typed-scss-modules": "0.0.11",
|
||||||
"typescript": "3.7.4",
|
"typescript": "3.7.4",
|
||||||
"webpack": "4.39.2",
|
"webpack": "4.39.2",
|
||||||
|
|
|
@ -10,7 +10,6 @@ import { ConfirmModal } from '../../components/ConfirmModal';
|
||||||
import { stickersDuck } from '../../store';
|
import { stickersDuck } from '../../store';
|
||||||
import { useI18n } from '../../util/i18n';
|
import { useI18n } from '../../util/i18n';
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
export const MetaStage: React.ComponentType = () => {
|
export const MetaStage: React.ComponentType = () => {
|
||||||
const i18n = useI18n();
|
const i18n = useI18n();
|
||||||
const actions = stickersDuck.useStickerActions();
|
const actions = stickersDuck.useStickerActions();
|
||||||
|
@ -91,7 +90,6 @@ export const MetaStage: React.ComponentType = () => {
|
||||||
alt="Cover"
|
alt="Cover"
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{/* tslint:disable-next-line react-a11y-input-elements */}
|
|
||||||
<input {...getInputProps()} />
|
<input {...getInputProps()} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -25,7 +25,6 @@ export const UploadStage: React.ComponentType = () => {
|
||||||
const [complete, setComplete] = React.useState(0);
|
const [complete, setComplete] = React.useState(0);
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
// tslint:disable-next-line: no-floating-promises
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const onProgress = () => {
|
const onProgress = () => {
|
||||||
setComplete(i => i + 1);
|
setComplete(i => i + 1);
|
||||||
|
|
|
@ -5,37 +5,34 @@ import { ConfirmDialog, Props } from '../elements/ConfirmDialog';
|
||||||
|
|
||||||
export type Mode = 'removable' | 'pick-emoji' | 'add';
|
export type Mode = 'removable' | 'pick-emoji' | 'add';
|
||||||
|
|
||||||
export const ConfirmModal = React.memo(
|
export const ConfirmModal = React.memo((props: Props) => {
|
||||||
// tslint:disable-next-line max-func-body-length
|
const { onCancel } = props;
|
||||||
(props: Props) => {
|
const [popperRoot, setPopperRoot] = React.useState<HTMLDivElement>();
|
||||||
const { onCancel } = props;
|
|
||||||
const [popperRoot, setPopperRoot] = React.useState<HTMLDivElement>();
|
|
||||||
|
|
||||||
// Create popper root and handle outside clicks
|
// Create popper root and handle outside clicks
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
const root = document.createElement('div');
|
const root = document.createElement('div');
|
||||||
setPopperRoot(root);
|
setPopperRoot(root);
|
||||||
document.body.appendChild(root);
|
document.body.appendChild(root);
|
||||||
const handleOutsideClick = ({ target }: MouseEvent) => {
|
const handleOutsideClick = ({ target }: MouseEvent) => {
|
||||||
if (!root.contains(target as Node)) {
|
if (!root.contains(target as Node)) {
|
||||||
onCancel();
|
onCancel();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
document.addEventListener('click', handleOutsideClick);
|
document.addEventListener('click', handleOutsideClick);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.body.removeChild(root);
|
document.body.removeChild(root);
|
||||||
document.removeEventListener('click', handleOutsideClick);
|
document.removeEventListener('click', handleOutsideClick);
|
||||||
};
|
};
|
||||||
}, [onCancel]);
|
}, [onCancel]);
|
||||||
|
|
||||||
return popperRoot
|
return popperRoot
|
||||||
? createPortal(
|
? createPortal(
|
||||||
<div className={styles.facade}>
|
<div className={styles.facade}>
|
||||||
<ConfirmDialog {...props} />
|
<ConfirmDialog {...props} />
|
||||||
</div>,
|
</div>,
|
||||||
popperRoot
|
popperRoot
|
||||||
)
|
)
|
||||||
: null;
|
: null;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
|
@ -63,7 +63,6 @@ const ImageHandle = SortableHandle((props: { src: string }) => (
|
||||||
));
|
));
|
||||||
|
|
||||||
export const StickerFrame = React.memo(
|
export const StickerFrame = React.memo(
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
({
|
({
|
||||||
id,
|
id,
|
||||||
emojiData,
|
emojiData,
|
||||||
|
|
|
@ -50,7 +50,6 @@ const InnerGrid = SortableContainer(
|
||||||
async paths => {
|
async paths => {
|
||||||
actions.initializeStickers(paths);
|
actions.initializeStickers(paths);
|
||||||
paths.forEach(path => {
|
paths.forEach(path => {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
queue.add(async () => {
|
queue.add(async () => {
|
||||||
try {
|
try {
|
||||||
const webp = await convertToWebp(path);
|
const webp = await convertToWebp(path);
|
||||||
|
|
|
@ -45,7 +45,6 @@ export const DropZone: React.ComponentType<Props> = props => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div {...getRootProps({ className: getClassName(props, isDragActive) })}>
|
<div {...getRootProps({ className: getClassName(props, isDragActive) })}>
|
||||||
{/* tslint:disable-next-line */}
|
|
||||||
<input {...getInputProps()} />
|
<input {...getInputProps()} />
|
||||||
<svg viewBox="0 0 36 36" width="36px" height="36px">
|
<svg viewBox="0 0 36 36" width="36px" height="36px">
|
||||||
<path d="M32 17.25H18.75V4h-1.5v13.25H4v1.5h13.25V32h1.5V18.75H32v-1.5z" />
|
<path d="M32 17.25H18.75V4h-1.5v13.25H4v1.5h13.25V32h1.5V18.75H32v-1.5z" />
|
||||||
|
|
|
@ -26,7 +26,6 @@ export const LabeledCheckbox = React.memo(
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<label className={styles.base}>
|
<label className={styles.base}>
|
||||||
{/* tslint:disable-next-line react-a11y-input-elements */}
|
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
className={styles.input}
|
className={styles.input}
|
||||||
|
|
|
@ -246,7 +246,6 @@ export class ConversationController {
|
||||||
*
|
*
|
||||||
* highTrust = uuid/e164 pairing came from CDS, the server, or your own device
|
* highTrust = uuid/e164 pairing came from CDS, the server, or your own device
|
||||||
*/
|
*/
|
||||||
// tslint:disable-next-line cyclomatic-complexity max-func-body-length
|
|
||||||
ensureContactIds({
|
ensureContactIds({
|
||||||
e164,
|
e164,
|
||||||
uuid,
|
uuid,
|
||||||
|
|
|
@ -23,7 +23,6 @@ export type Props = OwnProps &
|
||||||
>;
|
>;
|
||||||
|
|
||||||
export const EmojiButton = React.memo(
|
export const EmojiButton = React.memo(
|
||||||
// tslint:disable-next-line:max-func-body-length
|
|
||||||
({
|
({
|
||||||
i18n,
|
i18n,
|
||||||
doSend,
|
doSend,
|
||||||
|
|
|
@ -57,7 +57,6 @@ const categories = [
|
||||||
|
|
||||||
export const EmojiPicker = React.memo(
|
export const EmojiPicker = React.memo(
|
||||||
React.forwardRef<HTMLDivElement, Props>(
|
React.forwardRef<HTMLDivElement, Props>(
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
i18n,
|
i18n,
|
||||||
|
|
|
@ -82,7 +82,6 @@ const data = (untypedData as Array<EmojiData>)
|
||||||
);
|
);
|
||||||
|
|
||||||
const ROOT_PATH = get(
|
const ROOT_PATH = get(
|
||||||
// tslint:disable-next-line no-typeof-undefined
|
|
||||||
typeof window !== 'undefined' ? window : null,
|
typeof window !== 'undefined' ? window : null,
|
||||||
'ROOT_PATH',
|
'ROOT_PATH',
|
||||||
''
|
''
|
||||||
|
@ -104,7 +103,6 @@ export const preloadImages = async (): Promise<void> => {
|
||||||
img.onerror = reject;
|
img.onerror = reject;
|
||||||
img.src = src;
|
img.src = src;
|
||||||
images.add(img);
|
images.add(img);
|
||||||
// tslint:disable-next-line no-string-based-set-timeout
|
|
||||||
setTimeout(reject, 5000);
|
setTimeout(reject, 5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -112,12 +110,10 @@ export const preloadImages = async (): Promise<void> => {
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
|
|
||||||
data.forEach(emoji => {
|
data.forEach(emoji => {
|
||||||
// tslint:disable-next-line no-floating-promises promise-function-async
|
|
||||||
imageQueue.add(() => preload(makeImagePath(emoji.image)));
|
imageQueue.add(() => preload(makeImagePath(emoji.image)));
|
||||||
|
|
||||||
if (emoji.skin_variations) {
|
if (emoji.skin_variations) {
|
||||||
Object.values(emoji.skin_variations).forEach(variation => {
|
Object.values(emoji.skin_variations).forEach(variation => {
|
||||||
// tslint:disable-next-line no-floating-promises promise-function-async
|
|
||||||
imageQueue.add(() => preload(makeImagePath(variation.image)));
|
imageQueue.add(() => preload(makeImagePath(variation.image)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,6 @@ function getTodayInEpoch() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function sleep(ms: number) {
|
async function sleep(ms: number) {
|
||||||
// tslint:disable-next-line no-string-based-set-timeout
|
|
||||||
return new Promise(resolve => setTimeout(resolve, ms));
|
return new Promise(resolve => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ export function notify({
|
||||||
|
|
||||||
if (!silent && audioNotificationSupport === AudioNotificationSupport.Custom) {
|
if (!silent && audioNotificationSupport === AudioNotificationSupport.Custom) {
|
||||||
// We kick off the sound to be played. No neet to await it.
|
// We kick off the sound to be played. No neet to await it.
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
new Sound({ src: 'sounds/notification.ogg' }).play();
|
new Sound({ src: 'sounds/notification.ogg' }).play();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,6 @@ type GeneratedManifestType = {
|
||||||
storageManifest: StorageManifestClass;
|
storageManifest: StorageManifestClass;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* tslint:disable-next-line max-func-body-length */
|
|
||||||
async function generateManifest(
|
async function generateManifest(
|
||||||
version: number,
|
version: number,
|
||||||
isNewManifest = false
|
isNewManifest = false
|
||||||
|
@ -581,7 +580,6 @@ async function mergeRecord(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* tslint:disable-next-line max-func-body-length */
|
|
||||||
async function processManifest(
|
async function processManifest(
|
||||||
manifest: ManifestRecordClass
|
manifest: ManifestRecordClass
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
/* tslint:disable no-backbone-get-set-outside-model */
|
|
||||||
import { isNumber } from 'lodash';
|
import { isNumber } from 'lodash';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
@ -405,7 +404,6 @@ export async function mergeGroupV2Record(
|
||||||
|
|
||||||
const isFirstSync = !isNumber(window.storage.get('manifestVersion'));
|
const isFirstSync = !isNumber(window.storage.get('manifestVersion'));
|
||||||
const dropInitialJoinMessage = isFirstSync;
|
const dropInitialJoinMessage = isFirstSync;
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
waitThenMaybeUpdateGroup({
|
waitThenMaybeUpdateGroup({
|
||||||
conversation,
|
conversation,
|
||||||
dropInitialJoinMessage,
|
dropInitialJoinMessage,
|
||||||
|
|
|
@ -273,10 +273,8 @@ function _cleanData(data: any, path = 'root') {
|
||||||
|
|
||||||
if (isFunction(value)) {
|
if (isFunction(value)) {
|
||||||
// To prepare for Electron v9 IPC, we need to take functions off of any object
|
// To prepare for Electron v9 IPC, we need to take functions off of any object
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
delete data[key];
|
delete data[key];
|
||||||
} else if (isFunction(value.toNumber)) {
|
} else if (isFunction(value.toNumber)) {
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
data[key] = value.toNumber();
|
data[key] = value.toNumber();
|
||||||
} else if (Array.isArray(value)) {
|
} else if (Array.isArray(value)) {
|
||||||
data[key] = value.map((item, mapIndex) =>
|
data[key] = value.map((item, mapIndex) =>
|
||||||
|
@ -398,7 +396,6 @@ function _removeJob(id: number) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
delete _jobs[id];
|
delete _jobs[id];
|
||||||
|
|
||||||
if (_shutdownCallback) {
|
if (_shutdownCallback) {
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
/* eslint-disable no-restricted-syntax */
|
/* eslint-disable no-restricted-syntax */
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
// tslint:disable no-console no-default-export no-unnecessary-local-variable
|
|
||||||
|
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import mkdirp from 'mkdirp';
|
import mkdirp from 'mkdirp';
|
||||||
|
@ -1340,7 +1339,6 @@ async function updateToSchemaVersion19(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
async function updateToSchemaVersion20(
|
async function updateToSchemaVersion20(
|
||||||
currentVersion: number,
|
currentVersion: number,
|
||||||
instance: PromisifiedSQLDatabase
|
instance: PromisifiedSQLDatabase
|
||||||
|
@ -1453,7 +1451,6 @@ async function updateToSchemaVersion20(
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update group conversations, point members at new conversation ids
|
// Update group conversations, point members at new conversation ids
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
migrationJobQueue.addAll(
|
migrationJobQueue.addAll(
|
||||||
groupConverations.map(groupRow => async () => {
|
groupConverations.map(groupRow => async () => {
|
||||||
const members = groupRow.members.split(/\s?\+/).filter(Boolean);
|
const members = groupRow.members.split(/\s?\+/).filter(Boolean);
|
||||||
|
@ -1649,7 +1646,6 @@ let globalInstance: PromisifiedSQLDatabase | undefined;
|
||||||
let databaseFilePath: string | undefined;
|
let databaseFilePath: string | undefined;
|
||||||
let indexedDBPath: string | undefined;
|
let indexedDBPath: string | undefined;
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
async function initialize({
|
async function initialize({
|
||||||
configDir,
|
configDir,
|
||||||
key,
|
key,
|
||||||
|
@ -2418,7 +2414,6 @@ async function getMessageCount(conversationId?: string) {
|
||||||
return row['count(*)'];
|
return row['count(*)'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
async function saveMessage(
|
async function saveMessage(
|
||||||
data: MessageType,
|
data: MessageType,
|
||||||
{ forceSave }: { forceSave?: boolean } = {}
|
{ forceSave }: { forceSave?: boolean } = {}
|
||||||
|
@ -3956,7 +3951,6 @@ async function removeKnownAttachments(allAttachments: Array<string>) {
|
||||||
forEach(messages, message => {
|
forEach(messages, message => {
|
||||||
const externalFiles = getExternalFilesForMessage(message);
|
const externalFiles = getExternalFilesForMessage(message);
|
||||||
forEach(externalFiles, file => {
|
forEach(externalFiles, file => {
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
delete lookup[file];
|
delete lookup[file];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -4000,7 +3994,6 @@ async function removeKnownAttachments(allAttachments: Array<string>) {
|
||||||
forEach(conversations, conversation => {
|
forEach(conversations, conversation => {
|
||||||
const externalFiles = getExternalFilesForConversation(conversation);
|
const externalFiles = getExternalFilesForConversation(conversation);
|
||||||
forEach(externalFiles, file => {
|
forEach(externalFiles, file => {
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
delete lookup[file];
|
delete lookup[file];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -4048,7 +4041,6 @@ async function removeKnownStickers(allStickers: Array<string>) {
|
||||||
|
|
||||||
const files: Array<StickerType> = map(rows, row => row.path);
|
const files: Array<StickerType> = map(rows, row => row.path);
|
||||||
forEach(files, file => {
|
forEach(files, file => {
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
delete lookup[file];
|
delete lookup[file];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4101,7 +4093,6 @@ async function removeKnownDraftAttachments(allStickers: Array<string>) {
|
||||||
forEach(conversations, conversation => {
|
forEach(conversations, conversation => {
|
||||||
const externalFiles = getExternalDraftFilesForConversation(conversation);
|
const externalFiles = getExternalDraftFilesForConversation(conversation);
|
||||||
forEach(externalFiles, file => {
|
forEach(externalFiles, file => {
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
delete lookup[file];
|
delete lookup[file];
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -27,7 +27,6 @@ const directConsole = {
|
||||||
group: console.group,
|
group: console.group,
|
||||||
groupEnd: console.groupEnd,
|
groupEnd: console.groupEnd,
|
||||||
warn: console.warn,
|
warn: console.warn,
|
||||||
// tslint:disable-next-line no-console
|
|
||||||
error: console.error,
|
error: console.error,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,6 @@ export type CallingActionType =
|
||||||
function acceptCall(
|
function acceptCall(
|
||||||
payload: AcceptCallType
|
payload: AcceptCallType
|
||||||
): AcceptCallActionType | NoopActionType {
|
): AcceptCallActionType | NoopActionType {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
await calling.accept(payload.callId, payload.asVideoCall);
|
await calling.accept(payload.callId, payload.asVideoCall);
|
||||||
|
@ -317,7 +316,6 @@ function incomingCall(payload: IncomingCallType): IncomingCallActionType {
|
||||||
}
|
}
|
||||||
|
|
||||||
function outgoingCall(payload: OutgoingCallType): OutgoingCallActionType {
|
function outgoingCall(payload: OutgoingCallType): OutgoingCallActionType {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
callingTones.playRingtone();
|
callingTones.playRingtone();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -436,7 +434,6 @@ function getEmptyState(): CallingStateType {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
export function reducer(
|
export function reducer(
|
||||||
state: CallingStateType = getEmptyState(),
|
state: CallingStateType = getEmptyState(),
|
||||||
action: CallingActionType
|
action: CallingActionType
|
||||||
|
|
|
@ -601,7 +601,6 @@ function getEmptyState(): ConversationsStateType {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line cyclomatic-complexity
|
|
||||||
function hasMessageHeightChanged(
|
function hasMessageHeightChanged(
|
||||||
message: MessageType,
|
message: MessageType,
|
||||||
previous: MessageType
|
previous: MessageType
|
||||||
|
@ -673,7 +672,6 @@ function hasMessageHeightChanged(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line cyclomatic-complexity max-func-body-length
|
|
||||||
export function reducer(
|
export function reducer(
|
||||||
state: ConversationsStateType = getEmptyState(),
|
state: ConversationsStateType = getEmptyState(),
|
||||||
action: ConversationActionType
|
action: ConversationActionType
|
||||||
|
|
|
@ -80,7 +80,6 @@ function putItemExternal(key: string, value: unknown): ItemPutExternalAction {
|
||||||
}
|
}
|
||||||
|
|
||||||
function removeItem(key: string): ItemRemoveAction {
|
function removeItem(key: string): ItemRemoveAction {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
storageShim.remove(key);
|
storageShim.remove(key);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -333,7 +333,6 @@ function getEmptyState(): SearchStateType {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line cyclomatic-complexity max-func-body-length
|
|
||||||
export function reducer(
|
export function reducer(
|
||||||
state: SearchStateType = getEmptyState(),
|
state: SearchStateType = getEmptyState(),
|
||||||
action: SearchActionType
|
action: SearchActionType
|
||||||
|
|
|
@ -222,7 +222,6 @@ function downloadStickerPack(
|
||||||
const { finalStatus } = options || { finalStatus: undefined };
|
const { finalStatus } = options || { finalStatus: undefined };
|
||||||
|
|
||||||
// We're just kicking this off, since it will generate more redux events
|
// We're just kicking this off, since it will generate more redux events
|
||||||
// tslint:disable-next-line:no-floating-promises
|
|
||||||
externalDownloadStickerPack(packId, packKey, { finalStatus });
|
externalDownloadStickerPack(packId, packKey, { finalStatus });
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -370,7 +369,6 @@ function getEmptyState(): StickersStateType {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
export function reducer(
|
export function reducer(
|
||||||
state: StickersStateType = getEmptyState(),
|
state: StickersStateType = getEmptyState(),
|
||||||
action: StickersActionType
|
action: StickersActionType
|
||||||
|
|
|
@ -85,7 +85,6 @@ export const getSearchResults = createSelector(
|
||||||
lookup: ConversationLookupType,
|
lookup: ConversationLookupType,
|
||||||
selectedConversationId?: string,
|
selectedConversationId?: string,
|
||||||
selectedMessageId?: string
|
selectedMessageId?: string
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
): SearchResultsPropsType | undefined => {
|
): SearchResultsPropsType | undefined => {
|
||||||
const {
|
const {
|
||||||
contacts,
|
contacts,
|
||||||
|
|
|
@ -169,7 +169,6 @@ export default class AccountManager extends EventTarget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
async registerSecondDevice(
|
async registerSecondDevice(
|
||||||
setProvisioningUrl: Function,
|
setProvisioningUrl: Function,
|
||||||
confirmNumber: (number?: string) => Promise<string>,
|
confirmNumber: (number?: string) => Promise<string>,
|
||||||
|
@ -385,7 +384,6 @@ export default class AccountManager extends EventTarget {
|
||||||
e.code <= 599
|
e.code <= 599
|
||||||
) {
|
) {
|
||||||
const rejections =
|
const rejections =
|
||||||
// tslint:disable-next-line restrict-plus-operands
|
|
||||||
1 + window.textsecure.storage.get('signedKeyRotationRejected', 0);
|
1 + window.textsecure.storage.get('signedKeyRotationRejected', 0);
|
||||||
await window.textsecure.storage.put(
|
await window.textsecure.storage.put(
|
||||||
'signedKeyRotationRejected',
|
'signedKeyRotationRejected',
|
||||||
|
@ -476,7 +474,6 @@ export default class AccountManager extends EventTarget {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable max-func-body-length
|
|
||||||
async createAccount(
|
async createAccount(
|
||||||
number: string,
|
number: string,
|
||||||
verificationCode: string,
|
verificationCode: string,
|
||||||
|
|
|
@ -76,7 +76,6 @@ export default class EventTarget {
|
||||||
extend(source: any): any {
|
extend(source: any): any {
|
||||||
const target = this as any;
|
const target = this as any;
|
||||||
|
|
||||||
// tslint:disable-next-line forin no-for-in no-default-export
|
|
||||||
for (const prop in source) {
|
for (const prop in source) {
|
||||||
target[prop] = source[prop];
|
target[prop] = source[prop];
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
/* eslint-disable no-restricted-syntax */
|
/* eslint-disable no-restricted-syntax */
|
||||||
/* eslint-disable no-proto */
|
/* eslint-disable no-proto */
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
// tslint:disable no-default-export
|
|
||||||
|
|
||||||
import { ByteBufferClass } from '../window.d';
|
import { ByteBufferClass } from '../window.d';
|
||||||
|
|
||||||
|
|
|
@ -197,7 +197,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (options.retryCached) {
|
if (options.retryCached) {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.pendingQueue.add(async () => this.queueAllCached());
|
this.pendingQueue.add(async () => this.queueAllCached());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -307,7 +306,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
async dispatchAndWait(event: Event) {
|
async dispatchAndWait(event: Event) {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.appQueue.add(async () => Promise.all(this.dispatchEvent(event)));
|
this.appQueue.add(async () => Promise.all(this.dispatchEvent(event)));
|
||||||
|
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
|
@ -353,7 +351,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
request.respond(200, 'OK');
|
request.respond(200, 'OK');
|
||||||
|
|
||||||
if (request.verb === 'PUT' && request.path === '/api/v1/queue/empty') {
|
if (request.verb === 'PUT' && request.path === '/api/v1/queue/empty') {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.incomingQueue.add(() => {
|
this.incomingQueue.add(() => {
|
||||||
this.onEmpty();
|
this.onEmpty();
|
||||||
});
|
});
|
||||||
|
@ -427,7 +424,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.incomingQueue.add(job);
|
this.incomingQueue.add(job);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -496,12 +492,10 @@ class MessageReceiverInner extends EventTarget {
|
||||||
);
|
);
|
||||||
|
|
||||||
// We don't await here because we don't want this to gate future message processing
|
// We don't await here because we don't want this to gate future message processing
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.appQueue.add(emitEmpty);
|
this.appQueue.add(emitEmpty);
|
||||||
};
|
};
|
||||||
|
|
||||||
const waitForIncomingQueue = () => {
|
const waitForIncomingQueue = () => {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.addToQueue(waitForPendingQueue);
|
this.addToQueue(waitForPendingQueue);
|
||||||
|
|
||||||
// Note: this.count is used in addToQueue
|
// Note: this.count is used in addToQueue
|
||||||
|
@ -511,11 +505,9 @@ class MessageReceiverInner extends EventTarget {
|
||||||
|
|
||||||
const waitForCacheAddBatcher = async () => {
|
const waitForCacheAddBatcher = async () => {
|
||||||
await this.cacheAddBatcher.onIdle();
|
await this.cacheAddBatcher.onIdle();
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.incomingQueue.add(waitForIncomingQueue);
|
this.incomingQueue.add(waitForIncomingQueue);
|
||||||
};
|
};
|
||||||
|
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
waitForCacheAddBatcher();
|
waitForCacheAddBatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,10 +582,8 @@ class MessageReceiverInner extends EventTarget {
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Cached decrypted value was not a string!');
|
throw new Error('Cached decrypted value was not a string!');
|
||||||
}
|
}
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.queueDecryptedEnvelope(envelope, payloadPlaintext);
|
this.queueDecryptedEnvelope(envelope, payloadPlaintext);
|
||||||
} else {
|
} else {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.queueEnvelope(envelope);
|
this.queueEnvelope(envelope);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -639,7 +629,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
if (this.isEmptied) {
|
if (this.isEmptied) {
|
||||||
this.clearRetryTimeout();
|
this.clearRetryTimeout();
|
||||||
this.retryCachedTimeout = setTimeout(() => {
|
this.retryCachedTimeout = setTimeout(() => {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.pendingQueue.add(async () => this.queueAllCached());
|
this.pendingQueue.add(async () => this.queueAllCached());
|
||||||
}, RETRY_TIMEOUT);
|
}, RETRY_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
@ -695,7 +684,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
await window.textsecure.storage.unprocessed.batchAdd(dataArray);
|
await window.textsecure.storage.unprocessed.batchAdd(dataArray);
|
||||||
items.forEach(item => {
|
items.forEach(item => {
|
||||||
item.request.respond(200, 'OK');
|
item.request.respond(200, 'OK');
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.queueEnvelope(item.envelope);
|
this.queueEnvelope(item.envelope);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -862,7 +850,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
}
|
}
|
||||||
|
|
||||||
async onDeliveryReceipt(envelope: EnvelopeClass) {
|
async onDeliveryReceipt(envelope: EnvelopeClass) {
|
||||||
// tslint:disable-next-line promise-must-complete
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const ev = new Event('delivery');
|
const ev = new Event('delivery');
|
||||||
ev.confirm = this.removeFromCache.bind(this, envelope);
|
ev.confirm = this.removeFromCache.bind(this, envelope);
|
||||||
|
@ -894,7 +881,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
return plaintext;
|
return plaintext;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
async decrypt(
|
async decrypt(
|
||||||
envelope: EnvelopeClass,
|
envelope: EnvelopeClass,
|
||||||
ciphertext: any
|
ciphertext: any
|
||||||
|
@ -1505,7 +1491,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
return sentMessage.destination || sentMessage.destinationUuid;
|
return sentMessage.destination || sentMessage.destinationUuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line cyclomatic-complexity
|
|
||||||
async handleSyncMessage(
|
async handleSyncMessage(
|
||||||
envelope: EnvelopeClass,
|
envelope: EnvelopeClass,
|
||||||
syncMessage: SyncMessageClass
|
syncMessage: SyncMessageClass
|
||||||
|
@ -1767,7 +1752,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
|
|
||||||
// Note: we do not return here because we don't want to block the next message on
|
// Note: we do not return here because we don't want to block the next message on
|
||||||
// this attachment download and a lot of processing of that attachment.
|
// this attachment download and a lot of processing of that attachment.
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.handleAttachment(blob).then(async attachmentPointer => {
|
this.handleAttachment(blob).then(async attachmentPointer => {
|
||||||
const results = [];
|
const results = [];
|
||||||
const contactBuffer = new ContactBuffer(attachmentPointer.data);
|
const contactBuffer = new ContactBuffer(attachmentPointer.data);
|
||||||
|
@ -1806,7 +1790,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
|
|
||||||
// Note: we do not return here because we don't want to block the next message on
|
// Note: we do not return here because we don't want to block the next message on
|
||||||
// this attachment download and a lot of processing of that attachment.
|
// this attachment download and a lot of processing of that attachment.
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.handleAttachment(blob).then(async attachmentPointer => {
|
this.handleAttachment(blob).then(async attachmentPointer => {
|
||||||
const groupBuffer = new GroupBuffer(attachmentPointer.data);
|
const groupBuffer = new GroupBuffer(attachmentPointer.data);
|
||||||
let groupDetails = groupBuffer.next() as any;
|
let groupDetails = groupBuffer.next() as any;
|
||||||
|
@ -1966,7 +1949,6 @@ class MessageReceiverInner extends EventTarget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length cyclomatic-complexity
|
|
||||||
async processDecrypted(envelope: EnvelopeClass, decrypted: DataMessageClass) {
|
async processDecrypted(envelope: EnvelopeClass, decrypted: DataMessageClass) {
|
||||||
/* eslint-disable no-bitwise, no-param-reassign */
|
/* eslint-disable no-bitwise, no-param-reassign */
|
||||||
const FLAGS = window.textsecure.protobuf.DataMessage.Flags;
|
const FLAGS = window.textsecure.protobuf.DataMessage.Flags;
|
||||||
|
|
|
@ -148,7 +148,6 @@ export default class OutgoingMessage {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
async getKeysForIdentifier(
|
async getKeysForIdentifier(
|
||||||
identifier: string,
|
identifier: string,
|
||||||
updateDevices: Array<number>
|
updateDevices: Array<number>
|
||||||
|
@ -322,7 +321,6 @@ export default class OutgoingMessage {
|
||||||
return this.plaintext;
|
return this.plaintext;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
async doSendMessage(
|
async doSendMessage(
|
||||||
identifier: string,
|
identifier: string,
|
||||||
deviceIds: Array<number>,
|
deviceIds: Array<number>,
|
||||||
|
@ -357,7 +355,6 @@ export default class OutgoingMessage {
|
||||||
const ourUuid = window.textsecure.storage.user.getUuid();
|
const ourUuid = window.textsecure.storage.user.getUuid();
|
||||||
const ourDeviceId = window.textsecure.storage.user.getDeviceId();
|
const ourDeviceId = window.textsecure.storage.user.getDeviceId();
|
||||||
if ((identifier === ourNumber || identifier === ourUuid) && !sealedSender) {
|
if ((identifier === ourNumber || identifier === ourUuid) && !sealedSender) {
|
||||||
// tslint:disable-next-line no-parameter-reassignment
|
|
||||||
deviceIds = reject(
|
deviceIds = reject(
|
||||||
deviceIds,
|
deviceIds,
|
||||||
deviceId =>
|
deviceId =>
|
||||||
|
|
|
@ -152,7 +152,6 @@ class Message {
|
||||||
|
|
||||||
attachmentPointers?: Array<any>;
|
attachmentPointers?: Array<any>;
|
||||||
|
|
||||||
// tslint:disable cyclomatic-complexity
|
|
||||||
constructor(options: MessageOptionsType) {
|
constructor(options: MessageOptionsType) {
|
||||||
this.attachments = options.attachments || [];
|
this.attachments = options.attachments || [];
|
||||||
this.body = options.body;
|
this.body = options.body;
|
||||||
|
@ -600,7 +599,6 @@ export default class MessageSender {
|
||||||
);
|
);
|
||||||
|
|
||||||
recipients.forEach(identifier => {
|
recipients.forEach(identifier => {
|
||||||
// tslint:disable-next-line no-floating-promises
|
|
||||||
this.queueJobForIdentifier(identifier, async () =>
|
this.queueJobForIdentifier(identifier, async () =>
|
||||||
outgoing.sendToIdentifier(identifier)
|
outgoing.sendToIdentifier(identifier)
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// tslint:disable no-default-export
|
|
||||||
|
|
||||||
export default function createTaskWithTimeout<T>(
|
export default function createTaskWithTimeout<T>(
|
||||||
task: () => Promise<T>,
|
task: () => Promise<T>,
|
||||||
id: string,
|
id: string,
|
||||||
|
|
|
@ -134,7 +134,6 @@ export default class WebSocketResource extends EventTarget {
|
||||||
|
|
||||||
keepalive?: KeepAlive;
|
keepalive?: KeepAlive;
|
||||||
|
|
||||||
// tslint:disable-next-line max-func-body-length
|
|
||||||
constructor(socket: WebSocket, opts: any = {}) {
|
constructor(socket: WebSocket, opts: any = {}) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
// tslint:disable no-default-export
|
|
||||||
|
|
||||||
import EventTarget from './EventTarget';
|
import EventTarget from './EventTarget';
|
||||||
import AccountManager from './AccountManager';
|
import AccountManager from './AccountManager';
|
||||||
import MessageReceiver from './MessageReceiver';
|
import MessageReceiver from './MessageReceiver';
|
||||||
|
|
|
@ -29,7 +29,6 @@ export type BatcherType<ItemType> = {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function sleep(ms: number): Promise<void> {
|
async function sleep(ms: number): Promise<void> {
|
||||||
// tslint:disable-next-line:no-string-based-set-timeout
|
|
||||||
await new Promise(resolve => setTimeout(resolve, ms));
|
await new Promise(resolve => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +43,6 @@ export function createBatcher<ItemType>(
|
||||||
function _kickBatchOff() {
|
function _kickBatchOff() {
|
||||||
const itemsRef = items;
|
const itemsRef = items;
|
||||||
items = [];
|
items = [];
|
||||||
// tslint:disable-next-line:no-floating-promises
|
|
||||||
queue.add(async () => {
|
queue.add(async () => {
|
||||||
await options.processBatch(itemsRef);
|
await options.processBatch(itemsRef);
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,8 +4,6 @@
|
||||||
|
|
||||||
// From https://github.com/mathiasbynens/unicode-12.1.0/tree/master/Block
|
// From https://github.com/mathiasbynens/unicode-12.1.0/tree/master/Block
|
||||||
|
|
||||||
// tslint:disable variable-name
|
|
||||||
|
|
||||||
const CJK_Compatibility = /[\u3300-\u33FF]/;
|
const CJK_Compatibility = /[\u3300-\u33FF]/;
|
||||||
const CJK_Compatibility_Forms = /[\uFE30-\uFE4F]/;
|
const CJK_Compatibility_Forms = /[\uFE30-\uFE4F]/;
|
||||||
const CJK_Compatibility_Ideographs = /[\uF900-\uFAFF]/;
|
const CJK_Compatibility_Ideographs = /[\uF900-\uFAFF]/;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
// tslint:disable no-console
|
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import { join, relative } from 'path';
|
import { join, relative } from 'path';
|
||||||
import normalizePath from 'normalize-path';
|
import normalizePath from 'normalize-path';
|
||||||
|
@ -236,7 +235,6 @@ const excludedFilesRegexps = [
|
||||||
'^node_modules/trough/.+',
|
'^node_modules/trough/.+',
|
||||||
'^node_modules/ts-loader/.+',
|
'^node_modules/ts-loader/.+',
|
||||||
'^node_modules/ts-node/.+',
|
'^node_modules/ts-node/.+',
|
||||||
'^node_modules/tslint.+',
|
|
||||||
'^node_modules/tweetnacl/.+',
|
'^node_modules/tweetnacl/.+',
|
||||||
'^node_modules/typed-scss-modules/.+',
|
'^node_modules/typed-scss-modules/.+',
|
||||||
'^node_modules/typescript/.+',
|
'^node_modules/typescript/.+',
|
||||||
|
@ -362,7 +360,6 @@ async function main(): Promise<void> {
|
||||||
|
|
||||||
const exception = exceptionsLookup[exceptionKey];
|
const exception = exceptionsLookup[exceptionKey];
|
||||||
if (exception && (!exception.line || exception.line === line)) {
|
if (exception && (!exception.line || exception.line === line)) {
|
||||||
// tslint:disable-next-line no-dynamic-delete
|
|
||||||
delete exceptionsLookup[exceptionKey];
|
delete exceptionsLookup[exceptionKey];
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -40,7 +40,6 @@ type BatcherType<ItemType> = {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function sleep(ms: number): Promise<void> {
|
async function sleep(ms: number): Promise<void> {
|
||||||
// tslint:disable-next-line:no-string-based-set-timeout
|
|
||||||
await new Promise(resolve => setTimeout(resolve, ms));
|
await new Promise(resolve => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +54,6 @@ export function createWaitBatcher<ItemType>(
|
||||||
function _kickBatchOff() {
|
function _kickBatchOff() {
|
||||||
const itemsRef = items;
|
const itemsRef = items;
|
||||||
items = [];
|
items = [];
|
||||||
// tslint:disable-next-line:no-floating-promises
|
|
||||||
queue.add(async () => {
|
queue.add(async () => {
|
||||||
try {
|
try {
|
||||||
await options.processBatch(itemsRef.map(item => item.item));
|
await options.processBatch(itemsRef.map(item => item.item));
|
||||||
|
|
|
@ -28,7 +28,6 @@ export async function writeWindowsZoneIdentifier(
|
||||||
throw new Error('writeWindowsZoneIdentifier should only run on Windows');
|
throw new Error('writeWindowsZoneIdentifier should only run on Windows');
|
||||||
}
|
}
|
||||||
|
|
||||||
// tslint:disable-next-line non-literal-fs-path
|
|
||||||
if (!fs.existsSync(filePath)) {
|
if (!fs.existsSync(filePath)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'writeWindowsZoneIdentifier could not find the original file'
|
'writeWindowsZoneIdentifier could not find the original file'
|
||||||
|
|
206
tslint.json
206
tslint.json
|
@ -1,206 +0,0 @@
|
||||||
{
|
|
||||||
"defaultSeverity": "error",
|
|
||||||
"extends": ["tslint:recommended", "tslint-react", "tslint-microsoft-contrib"],
|
|
||||||
"jsRules": {},
|
|
||||||
"rules": {
|
|
||||||
// prettier is handling this
|
|
||||||
"align": false,
|
|
||||||
"newline-per-chained-call": false,
|
|
||||||
"array-type": [true, "generic"],
|
|
||||||
"number-literal-format": false,
|
|
||||||
|
|
||||||
// Preferred by Prettier:
|
|
||||||
"arrow-parens": [true, "ban-single-arg-parens"],
|
|
||||||
|
|
||||||
// Breaks when we use .extend() to create a Backbone subclass
|
|
||||||
"no-invalid-this": false,
|
|
||||||
|
|
||||||
"import-spacing": false,
|
|
||||||
"indent": [true, "spaces", 2],
|
|
||||||
"interface-name": [true, "never-prefix"],
|
|
||||||
"member-access": false,
|
|
||||||
"member-ordering": false,
|
|
||||||
"newline-before-return": false,
|
|
||||||
"prefer-for-of": false,
|
|
||||||
"no-this-assignment": false,
|
|
||||||
"binary-expression-operand-order": false,
|
|
||||||
"no-backbone-get-set-outside-model": false,
|
|
||||||
|
|
||||||
// Allows us to write inline `style`s. Revisit when we have a more sophisticated
|
|
||||||
// CSS-in-JS solution:
|
|
||||||
"jsx-no-multiline-js": false,
|
|
||||||
|
|
||||||
// We'll make tradeoffs where appropriate
|
|
||||||
"jsx-no-lambda": false,
|
|
||||||
"react-this-binding-issue": false,
|
|
||||||
|
|
||||||
"linebreak-style": [true, "LF"],
|
|
||||||
|
|
||||||
// Prettier handles this for us
|
|
||||||
"max-line-length": false,
|
|
||||||
|
|
||||||
"mocha-avoid-only": true,
|
|
||||||
// Disabled until we can allow dynamically generated tests:
|
|
||||||
// https://github.com/Microsoft/tslint-microsoft-contrib/issues/85#issuecomment-371749352
|
|
||||||
"mocha-no-side-effect-code": false,
|
|
||||||
"mocha-unneeded-done": true,
|
|
||||||
|
|
||||||
// We always want 'as Type'
|
|
||||||
"no-angle-bracket-type-assertion": true,
|
|
||||||
|
|
||||||
// mostly always a false positive
|
|
||||||
"no-backbone-get-set-outside-model": false,
|
|
||||||
|
|
||||||
"no-consecutive-blank-lines": [true, 2],
|
|
||||||
"object-literal-key-quotes": [true, "as-needed"],
|
|
||||||
"object-literal-sort-keys": false,
|
|
||||||
|
|
||||||
// Ignore import sources order until we can specify that we want ordering
|
|
||||||
// based on import name vs module name:
|
|
||||||
"ordered-imports": [
|
|
||||||
true,
|
|
||||||
{
|
|
||||||
"import-sources-order": "any",
|
|
||||||
"named-imports-order": "case-insensitive-legacy"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"quotemark": [
|
|
||||||
true,
|
|
||||||
"single",
|
|
||||||
"jsx-double",
|
|
||||||
"avoid-template",
|
|
||||||
"avoid-escape"
|
|
||||||
],
|
|
||||||
|
|
||||||
// Preferred by Prettier:
|
|
||||||
"semicolon": [true, "always", "ignore-bound-class-methods"],
|
|
||||||
|
|
||||||
// Preferred by Prettier:
|
|
||||||
"trailing-comma": [
|
|
||||||
true,
|
|
||||||
{
|
|
||||||
"singleline": "never",
|
|
||||||
"multiline": {
|
|
||||||
"objects": "always",
|
|
||||||
"arrays": "always",
|
|
||||||
"functions": "never",
|
|
||||||
"typeLiterals": "always"
|
|
||||||
},
|
|
||||||
"esSpecCompliant": true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
// Crashing!
|
|
||||||
"use-default-type-parameter": false,
|
|
||||||
|
|
||||||
// Disabling a large set of Microsoft-recommended rules
|
|
||||||
|
|
||||||
// Modifying:
|
|
||||||
|
|
||||||
// React components and namespaces are Pascal case
|
|
||||||
"variable-name": [true, "allow-pascal-case"],
|
|
||||||
"variable-name": [
|
|
||||||
true,
|
|
||||||
"check-format",
|
|
||||||
"allow-leading-underscore",
|
|
||||||
"allow-pascal-case"
|
|
||||||
],
|
|
||||||
|
|
||||||
"function-name": [
|
|
||||||
true,
|
|
||||||
{
|
|
||||||
"function-regex": "^_?[A-Za-z][\\w\\d]+$",
|
|
||||||
"method-regex": "^_?[a-z][\\w\\d]+$",
|
|
||||||
"static-method-regex": "^_?[a-z][\\w\\d]+$"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
// Adding select dev dependencies here for now, may turn on all in the future
|
|
||||||
"no-implicit-dependencies": [
|
|
||||||
true,
|
|
||||||
[
|
|
||||||
"dashdash",
|
|
||||||
"electron",
|
|
||||||
"@storybook/react",
|
|
||||||
"@storybook/addon-actions",
|
|
||||||
"@storybook/addon-knobs"
|
|
||||||
]
|
|
||||||
],
|
|
||||||
|
|
||||||
// So things like "autoplay" on <video> work
|
|
||||||
"jsx-boolean-value": false,
|
|
||||||
|
|
||||||
// Maybe will turn on:
|
|
||||||
|
|
||||||
// We're not trying to be comprehensive with JSDoc right now. We have the style guide.
|
|
||||||
"completed-docs": false,
|
|
||||||
// Today we have files with a single named export which isn't the filename. Eventually.
|
|
||||||
"export-name": false,
|
|
||||||
// We have a lot of 'any' in our code today
|
|
||||||
"no-any": false,
|
|
||||||
// We use this today, could get rid of it
|
|
||||||
"no-increment-decrement": false,
|
|
||||||
// This seems to detect false positives: any multi-level object literal, for example
|
|
||||||
"no-object-literal-type-assertion": false,
|
|
||||||
// I like relative references to the current dir, or absolute. Maybe can do this?
|
|
||||||
"no-relative-imports": false,
|
|
||||||
// We have a lot of 'any' in our code today
|
|
||||||
"no-unsafe-any": false,
|
|
||||||
// Not everything needs to be typed right now
|
|
||||||
"typedef": false,
|
|
||||||
|
|
||||||
// Probably won't turn on:
|
|
||||||
|
|
||||||
"possible-timing-attack": false,
|
|
||||||
// We use null
|
|
||||||
"no-null-keyword": false,
|
|
||||||
// We want to import a capitalized React, for example
|
|
||||||
"import-name": false,
|
|
||||||
// We have the styleguide for better docs
|
|
||||||
"missing-jsdoc": false,
|
|
||||||
// 'type' and 'number' are just too common
|
|
||||||
"no-reserved-keywords": false,
|
|
||||||
// The style guide needs JSDoc-style block comments to extract proptype documentation
|
|
||||||
"no-single-line-block-comment": false,
|
|
||||||
// Out-of-order functions can improve readability
|
|
||||||
"no-use-before-declare": false,
|
|
||||||
// We use Array<type> syntax
|
|
||||||
"prefer-array-literal": false,
|
|
||||||
// We prefer key: () => void syntax, because it suggests an object instead of a class
|
|
||||||
"prefer-method-signature": false,
|
|
||||||
// 'as' is nicer than angle brackets.
|
|
||||||
"prefer-type-cast": false,
|
|
||||||
// We use || and && shortcutting because we're javascript programmers
|
|
||||||
"strict-boolean-expressions": false
|
|
||||||
},
|
|
||||||
"rulesDirectory": ["node_modules/tslint-microsoft-contrib"],
|
|
||||||
"linterOptions": {
|
|
||||||
"exclude": [
|
|
||||||
"sticker-creator/**/*.ts",
|
|
||||||
"sticker-creator/**/*.tsx",
|
|
||||||
"ts/*.ts",
|
|
||||||
"ts/backbone/**",
|
|
||||||
"ts/build/**",
|
|
||||||
"ts/components/*.ts[x]",
|
|
||||||
"ts/components/conversation/**",
|
|
||||||
"ts/components/emoji/**",
|
|
||||||
"ts/components/stickers/**",
|
|
||||||
"ts/models/**",
|
|
||||||
"ts/notifications/**",
|
|
||||||
"ts/protobuf/**",
|
|
||||||
"ts/scripts/**",
|
|
||||||
"ts/services/**",
|
|
||||||
"ts/shims/**",
|
|
||||||
"ts/sql/**",
|
|
||||||
"ts/state/**",
|
|
||||||
"ts/storybook/**",
|
|
||||||
"ts/test/**",
|
|
||||||
"ts/textsecure/**",
|
|
||||||
"ts/types/**",
|
|
||||||
"ts/updater/**",
|
|
||||||
"ts/util/**",
|
|
||||||
"ts/views/**"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||||
import { Configuration, EnvironmentPlugin } from 'webpack';
|
import { Configuration, EnvironmentPlugin } from 'webpack';
|
||||||
// tslint:disable-next-line no-require-imports
|
|
||||||
import HtmlWebpackPlugin = require('html-webpack-plugin');
|
import HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
|
|
||||||
const context = __dirname;
|
const context = __dirname;
|
||||||
|
@ -86,5 +85,4 @@ const stickerCreatorConfig: Configuration = {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// tslint:disable-next-line no-default-export
|
|
||||||
export default [stickerCreatorConfig];
|
export default [stickerCreatorConfig];
|
||||||
|
|
66
yarn.lock
66
yarn.lock
|
@ -4369,7 +4369,7 @@ builder-util@22.3.6, builder-util@~22.3.6:
|
||||||
stat-mode "^1.0.0"
|
stat-mode "^1.0.0"
|
||||||
temp-file "^3.3.7"
|
temp-file "^3.3.7"
|
||||||
|
|
||||||
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
|
builtin-modules@^1.0.0:
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
|
resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"
|
||||||
|
|
||||||
|
@ -4982,10 +4982,6 @@ commander@2.17.x:
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
|
||||||
integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==
|
integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==
|
||||||
|
|
||||||
commander@^2.12.1:
|
|
||||||
version "2.15.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.15.1.tgz#df46e867d0fc2aec66a34662b406a9ccafff5b0f"
|
|
||||||
|
|
||||||
commander@^2.19.0, commander@^2.20.0, commander@~2.20.0:
|
commander@^2.19.0, commander@^2.20.0, commander@~2.20.0:
|
||||||
version "2.20.0"
|
version "2.20.0"
|
||||||
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
|
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
|
||||||
|
@ -10859,7 +10855,7 @@ mkdirp@0.5.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
minimist "^1.2.5"
|
minimist "^1.2.5"
|
||||||
|
|
||||||
mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.1:
|
mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.1:
|
||||||
version "0.5.5"
|
version "0.5.5"
|
||||||
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
|
||||||
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
|
||||||
|
@ -16073,11 +16069,6 @@ tslib@1.11.1, tslib@^1, tslib@^1.10.0, tslib@^1.11.1, tslib@^1.9.3:
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35"
|
||||||
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
|
integrity sha512-aZW88SY8kQbU7gpV19lN24LtXh/yD4ZZg6qieAJDDg+YBsJcSmLGK9QpnUjAKVG/xefmvJGd1WUmfpT/g6AJGA==
|
||||||
|
|
||||||
tslib@^1.13.0:
|
|
||||||
version "1.13.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.13.0.tgz#c881e13cc7015894ed914862d276436fa9a47043"
|
|
||||||
integrity sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==
|
|
||||||
|
|
||||||
tslib@^1.8.1:
|
tslib@^1.8.1:
|
||||||
version "1.9.0"
|
version "1.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8"
|
||||||
|
@ -16087,59 +16078,6 @@ tslib@^1.9.0:
|
||||||
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
|
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
|
||||||
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
|
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
|
||||||
|
|
||||||
tslint-microsoft-contrib@6.2.0:
|
|
||||||
version "6.2.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/tslint-microsoft-contrib/-/tslint-microsoft-contrib-6.2.0.tgz#8aa0f40584d066d05e6a5e7988da5163b85f2ad4"
|
|
||||||
integrity sha512-6tfi/2tHqV/3CL77pULBcK+foty11Rr0idRDxKnteTaKm6gWF9qmaCNU17HVssOuwlYNyOmd9Jsmjd+1t3a3qw==
|
|
||||||
dependencies:
|
|
||||||
tsutils "^2.27.2 <2.29.0"
|
|
||||||
|
|
||||||
tslint-react@3.6.0:
|
|
||||||
version "3.6.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/tslint-react/-/tslint-react-3.6.0.tgz#7f462c95c4a0afaae82507f06517ff02942196a1"
|
|
||||||
integrity sha512-AIv1QcsSnj7e9pFir6cJ6vIncTqxfqeFF3Lzh8SuuBljueYzEAtByuB6zMaD27BL0xhMEqsZ9s5eHuCONydjBw==
|
|
||||||
dependencies:
|
|
||||||
tsutils "^2.13.1"
|
|
||||||
|
|
||||||
tslint@6:
|
|
||||||
version "6.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/tslint/-/tslint-6.1.3.tgz#5c23b2eccc32487d5523bd3a470e9aa31789d904"
|
|
||||||
integrity sha512-IbR4nkT96EQOvKE2PW/djGz8iGNeJ4rF2mBfiYaR/nvUWYKJhLwimoJKgjIFEIDibBtOevj7BqCRL4oHeWWUCg==
|
|
||||||
dependencies:
|
|
||||||
"@babel/code-frame" "^7.0.0"
|
|
||||||
builtin-modules "^1.1.1"
|
|
||||||
chalk "^2.3.0"
|
|
||||||
commander "^2.12.1"
|
|
||||||
diff "^4.0.1"
|
|
||||||
glob "^7.1.1"
|
|
||||||
js-yaml "^3.13.1"
|
|
||||||
minimatch "^3.0.4"
|
|
||||||
mkdirp "^0.5.3"
|
|
||||||
resolve "^1.3.2"
|
|
||||||
semver "^5.3.0"
|
|
||||||
tslib "^1.13.0"
|
|
||||||
tsutils "^2.29.0"
|
|
||||||
|
|
||||||
tsutils@^2.13.1:
|
|
||||||
version "2.25.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.25.1.tgz#24a46342ab8b174a3fbde632e60dcd11b64982f9"
|
|
||||||
dependencies:
|
|
||||||
tslib "^1.8.1"
|
|
||||||
|
|
||||||
"tsutils@^2.27.2 <2.29.0":
|
|
||||||
version "2.28.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.28.0.tgz#6bd71e160828f9d019b6f4e844742228f85169a1"
|
|
||||||
integrity sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA==
|
|
||||||
dependencies:
|
|
||||||
tslib "^1.8.1"
|
|
||||||
|
|
||||||
tsutils@^2.29.0:
|
|
||||||
version "2.29.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.29.0.tgz#32b488501467acbedd4b85498673a0812aca0b99"
|
|
||||||
integrity sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==
|
|
||||||
dependencies:
|
|
||||||
tslib "^1.8.1"
|
|
||||||
|
|
||||||
tsutils@^3.17.1:
|
tsutils@^3.17.1:
|
||||||
version "3.17.1"
|
version "3.17.1"
|
||||||
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
|
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"
|
||||||
|
|
Loading…
Reference in New Issue