Remove TSLint

Co-authored-by: Chris Svenningsen <chris@carbonfive.com>
This commit is contained in:
Sidney Keese 2020-09-24 18:02:01 -07:00 committed by Josh Perez
parent be705bc312
commit dabab60f56
42 changed files with 31 additions and 394 deletions

View File

@ -33,9 +33,8 @@
"test-node-coverage": "nyc --reporter=lcov --reporter=text mocha --recursive test/app test/modules ts/test",
"eslint": "eslint .",
"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",
"tslint": "tslint --format stylish --project .",
"format": "prettier --write \"*.{css,js,json,md,scss,ts,tsx}\" \"./**/*.{css,js,json,md,scss,ts,tsx}\"",
"transpile": "tsc",
"clean-transpile": "rimraf ts/**/*.js && rimraf ts/*.js",
@ -252,9 +251,6 @@
"style-loader": "1.0.0",
"ts-loader": "4.1.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",
"typescript": "3.7.4",
"webpack": "4.39.2",

View File

@ -10,7 +10,6 @@ import { ConfirmModal } from '../../components/ConfirmModal';
import { stickersDuck } from '../../store';
import { useI18n } from '../../util/i18n';
// tslint:disable-next-line max-func-body-length
export const MetaStage: React.ComponentType = () => {
const i18n = useI18n();
const actions = stickersDuck.useStickerActions();
@ -91,7 +90,6 @@ export const MetaStage: React.ComponentType = () => {
alt="Cover"
/>
) : null}
{/* tslint:disable-next-line react-a11y-input-elements */}
<input {...getInputProps()} />
</div>
</div>

View File

@ -25,7 +25,6 @@ export const UploadStage: React.ComponentType = () => {
const [complete, setComplete] = React.useState(0);
React.useEffect(() => {
// tslint:disable-next-line: no-floating-promises
(async () => {
const onProgress = () => {
setComplete(i => i + 1);

View File

@ -5,37 +5,34 @@ import { ConfirmDialog, Props } from '../elements/ConfirmDialog';
export type Mode = 'removable' | 'pick-emoji' | 'add';
export const ConfirmModal = React.memo(
// tslint:disable-next-line max-func-body-length
(props: Props) => {
const { onCancel } = props;
const [popperRoot, setPopperRoot] = React.useState<HTMLDivElement>();
export const ConfirmModal = React.memo((props: Props) => {
const { onCancel } = props;
const [popperRoot, setPopperRoot] = React.useState<HTMLDivElement>();
// Create popper root and handle outside clicks
React.useEffect(() => {
const root = document.createElement('div');
setPopperRoot(root);
document.body.appendChild(root);
const handleOutsideClick = ({ target }: MouseEvent) => {
if (!root.contains(target as Node)) {
onCancel();
}
};
document.addEventListener('click', handleOutsideClick);
// Create popper root and handle outside clicks
React.useEffect(() => {
const root = document.createElement('div');
setPopperRoot(root);
document.body.appendChild(root);
const handleOutsideClick = ({ target }: MouseEvent) => {
if (!root.contains(target as Node)) {
onCancel();
}
};
document.addEventListener('click', handleOutsideClick);
return () => {
document.body.removeChild(root);
document.removeEventListener('click', handleOutsideClick);
};
}, [onCancel]);
return () => {
document.body.removeChild(root);
document.removeEventListener('click', handleOutsideClick);
};
}, [onCancel]);
return popperRoot
? createPortal(
<div className={styles.facade}>
<ConfirmDialog {...props} />
</div>,
popperRoot
)
: null;
}
);
return popperRoot
? createPortal(
<div className={styles.facade}>
<ConfirmDialog {...props} />
</div>,
popperRoot
)
: null;
});

View File

@ -63,7 +63,6 @@ const ImageHandle = SortableHandle((props: { src: string }) => (
));
export const StickerFrame = React.memo(
// tslint:disable-next-line max-func-body-length
({
id,
emojiData,

View File

@ -50,7 +50,6 @@ const InnerGrid = SortableContainer(
async paths => {
actions.initializeStickers(paths);
paths.forEach(path => {
// tslint:disable-next-line no-floating-promises
queue.add(async () => {
try {
const webp = await convertToWebp(path);

View File

@ -45,7 +45,6 @@ export const DropZone: React.ComponentType<Props> = props => {
return (
<div {...getRootProps({ className: getClassName(props, isDragActive) })}>
{/* tslint:disable-next-line */}
<input {...getInputProps()} />
<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" />

View File

@ -26,7 +26,6 @@ export const LabeledCheckbox = React.memo(
return (
<label className={styles.base}>
{/* tslint:disable-next-line react-a11y-input-elements */}
<input
type="checkbox"
className={styles.input}

View File

@ -246,7 +246,6 @@ export class ConversationController {
*
* highTrust = uuid/e164 pairing came from CDS, the server, or your own device
*/
// tslint:disable-next-line cyclomatic-complexity max-func-body-length
ensureContactIds({
e164,
uuid,

View File

@ -23,7 +23,6 @@ export type Props = OwnProps &
>;
export const EmojiButton = React.memo(
// tslint:disable-next-line:max-func-body-length
({
i18n,
doSend,

View File

@ -57,7 +57,6 @@ const categories = [
export const EmojiPicker = React.memo(
React.forwardRef<HTMLDivElement, Props>(
// tslint:disable-next-line max-func-body-length
(
{
i18n,

View File

@ -82,7 +82,6 @@ const data = (untypedData as Array<EmojiData>)
);
const ROOT_PATH = get(
// tslint:disable-next-line no-typeof-undefined
typeof window !== 'undefined' ? window : null,
'ROOT_PATH',
''
@ -104,7 +103,6 @@ export const preloadImages = async (): Promise<void> => {
img.onerror = reject;
img.src = src;
images.add(img);
// tslint:disable-next-line no-string-based-set-timeout
setTimeout(reject, 5000);
});
@ -112,12 +110,10 @@ export const preloadImages = async (): Promise<void> => {
const start = Date.now();
data.forEach(emoji => {
// tslint:disable-next-line no-floating-promises promise-function-async
imageQueue.add(() => preload(makeImagePath(emoji.image)));
if (emoji.skin_variations) {
Object.values(emoji.skin_variations).forEach(variation => {
// tslint:disable-next-line no-floating-promises promise-function-async
imageQueue.add(() => preload(makeImagePath(variation.image)));
});
}

View File

@ -31,7 +31,6 @@ function getTodayInEpoch() {
}
async function sleep(ms: number) {
// tslint:disable-next-line no-string-based-set-timeout
return new Promise(resolve => setTimeout(resolve, ms));
}

View File

@ -41,7 +41,6 @@ export function notify({
if (!silent && audioNotificationSupport === AudioNotificationSupport.Custom) {
// 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();
}

View File

@ -117,7 +117,6 @@ type GeneratedManifestType = {
storageManifest: StorageManifestClass;
};
/* tslint:disable-next-line max-func-body-length */
async function generateManifest(
version: number,
isNewManifest = false
@ -581,7 +580,6 @@ async function mergeRecord(
};
}
/* tslint:disable-next-line max-func-body-length */
async function processManifest(
manifest: ManifestRecordClass
): Promise<boolean> {

View File

@ -1,4 +1,3 @@
/* tslint:disable no-backbone-get-set-outside-model */
import { isNumber } from 'lodash';
import {
@ -405,7 +404,6 @@ export async function mergeGroupV2Record(
const isFirstSync = !isNumber(window.storage.get('manifestVersion'));
const dropInitialJoinMessage = isFirstSync;
// tslint:disable-next-line no-floating-promises
waitThenMaybeUpdateGroup({
conversation,
dropInitialJoinMessage,

View File

@ -273,10 +273,8 @@ function _cleanData(data: any, path = 'root') {
if (isFunction(value)) {
// 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];
} else if (isFunction(value.toNumber)) {
// tslint:disable-next-line no-dynamic-delete
data[key] = value.toNumber();
} else if (Array.isArray(value)) {
data[key] = value.map((item, mapIndex) =>
@ -398,7 +396,6 @@ function _removeJob(id: number) {
return;
}
// tslint:disable-next-line no-dynamic-delete
delete _jobs[id];
if (_shutdownCallback) {

View File

@ -5,7 +5,6 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-explicit-any */
// tslint:disable no-console no-default-export no-unnecessary-local-variable
import { join } from 'path';
import mkdirp from 'mkdirp';
@ -1340,7 +1339,6 @@ async function updateToSchemaVersion19(
}
}
// tslint:disable-next-line max-func-body-length
async function updateToSchemaVersion20(
currentVersion: number,
instance: PromisifiedSQLDatabase
@ -1453,7 +1451,6 @@ async function updateToSchemaVersion20(
);
// Update group conversations, point members at new conversation ids
// tslint:disable-next-line no-floating-promises
migrationJobQueue.addAll(
groupConverations.map(groupRow => async () => {
const members = groupRow.members.split(/\s?\+/).filter(Boolean);
@ -1649,7 +1646,6 @@ let globalInstance: PromisifiedSQLDatabase | undefined;
let databaseFilePath: string | undefined;
let indexedDBPath: string | undefined;
// tslint:disable-next-line max-func-body-length
async function initialize({
configDir,
key,
@ -2418,7 +2414,6 @@ async function getMessageCount(conversationId?: string) {
return row['count(*)'];
}
// tslint:disable-next-line max-func-body-length
async function saveMessage(
data: MessageType,
{ forceSave }: { forceSave?: boolean } = {}
@ -3956,7 +3951,6 @@ async function removeKnownAttachments(allAttachments: Array<string>) {
forEach(messages, message => {
const externalFiles = getExternalFilesForMessage(message);
forEach(externalFiles, file => {
// tslint:disable-next-line no-dynamic-delete
delete lookup[file];
});
});
@ -4000,7 +3994,6 @@ async function removeKnownAttachments(allAttachments: Array<string>) {
forEach(conversations, conversation => {
const externalFiles = getExternalFilesForConversation(conversation);
forEach(externalFiles, file => {
// tslint:disable-next-line no-dynamic-delete
delete lookup[file];
});
});
@ -4048,7 +4041,6 @@ async function removeKnownStickers(allStickers: Array<string>) {
const files: Array<StickerType> = map(rows, row => row.path);
forEach(files, file => {
// tslint:disable-next-line no-dynamic-delete
delete lookup[file];
});
@ -4101,7 +4093,6 @@ async function removeKnownDraftAttachments(allStickers: Array<string>) {
forEach(conversations, conversation => {
const externalFiles = getExternalDraftFilesForConversation(conversation);
forEach(externalFiles, file => {
// tslint:disable-next-line no-dynamic-delete
delete lookup[file];
});
});

View File

@ -27,7 +27,6 @@ const directConsole = {
group: console.group,
groupEnd: console.groupEnd,
warn: console.warn,
// tslint:disable-next-line no-console
error: console.error,
};

View File

@ -203,7 +203,6 @@ export type CallingActionType =
function acceptCall(
payload: AcceptCallType
): AcceptCallActionType | NoopActionType {
// tslint:disable-next-line no-floating-promises
(async () => {
try {
await calling.accept(payload.callId, payload.asVideoCall);
@ -317,7 +316,6 @@ function incomingCall(payload: IncomingCallType): IncomingCallActionType {
}
function outgoingCall(payload: OutgoingCallType): OutgoingCallActionType {
// tslint:disable-next-line no-floating-promises
callingTones.playRingtone();
return {
@ -436,7 +434,6 @@ function getEmptyState(): CallingStateType {
};
}
// tslint:disable-next-line max-func-body-length
export function reducer(
state: CallingStateType = getEmptyState(),
action: CallingActionType

View File

@ -601,7 +601,6 @@ function getEmptyState(): ConversationsStateType {
};
}
// tslint:disable-next-line cyclomatic-complexity
function hasMessageHeightChanged(
message: MessageType,
previous: MessageType
@ -673,7 +672,6 @@ function hasMessageHeightChanged(
return false;
}
// tslint:disable-next-line cyclomatic-complexity max-func-body-length
export function reducer(
state: ConversationsStateType = getEmptyState(),
action: ConversationActionType

View File

@ -80,7 +80,6 @@ function putItemExternal(key: string, value: unknown): ItemPutExternalAction {
}
function removeItem(key: string): ItemRemoveAction {
// tslint:disable-next-line no-floating-promises
storageShim.remove(key);
return {

View File

@ -333,7 +333,6 @@ function getEmptyState(): SearchStateType {
};
}
// tslint:disable-next-line cyclomatic-complexity max-func-body-length
export function reducer(
state: SearchStateType = getEmptyState(),
action: SearchActionType

View File

@ -222,7 +222,6 @@ function downloadStickerPack(
const { finalStatus } = options || { finalStatus: undefined };
// We're just kicking this off, since it will generate more redux events
// tslint:disable-next-line:no-floating-promises
externalDownloadStickerPack(packId, packKey, { finalStatus });
return {
@ -370,7 +369,6 @@ function getEmptyState(): StickersStateType {
};
}
// tslint:disable-next-line max-func-body-length
export function reducer(
state: StickersStateType = getEmptyState(),
action: StickersActionType

View File

@ -85,7 +85,6 @@ export const getSearchResults = createSelector(
lookup: ConversationLookupType,
selectedConversationId?: string,
selectedMessageId?: string
// tslint:disable-next-line max-func-body-length
): SearchResultsPropsType | undefined => {
const {
contacts,

View File

@ -169,7 +169,6 @@ export default class AccountManager extends EventTarget {
);
}
// tslint:disable-next-line max-func-body-length
async registerSecondDevice(
setProvisioningUrl: Function,
confirmNumber: (number?: string) => Promise<string>,
@ -385,7 +384,6 @@ export default class AccountManager extends EventTarget {
e.code <= 599
) {
const rejections =
// tslint:disable-next-line restrict-plus-operands
1 + window.textsecure.storage.get('signedKeyRotationRejected', 0);
await window.textsecure.storage.put(
'signedKeyRotationRejected',
@ -476,7 +474,6 @@ export default class AccountManager extends EventTarget {
});
}
// tslint:disable max-func-body-length
async createAccount(
number: string,
verificationCode: string,

View File

@ -76,7 +76,6 @@ export default class EventTarget {
extend(source: any): any {
const target = this as any;
// tslint:disable-next-line forin no-for-in no-default-export
for (const prop in source) {
target[prop] = source[prop];
}

View File

@ -2,7 +2,6 @@
/* eslint-disable no-restricted-syntax */
/* eslint-disable no-proto */
/* eslint-disable @typescript-eslint/no-explicit-any */
// tslint:disable no-default-export
import { ByteBufferClass } from '../window.d';

View File

@ -197,7 +197,6 @@ class MessageReceiverInner extends EventTarget {
});
if (options.retryCached) {
// tslint:disable-next-line no-floating-promises
this.pendingQueue.add(async () => this.queueAllCached());
}
}
@ -307,7 +306,6 @@ class MessageReceiverInner extends EventTarget {
}
async dispatchAndWait(event: Event) {
// tslint:disable-next-line no-floating-promises
this.appQueue.add(async () => Promise.all(this.dispatchEvent(event)));
return Promise.resolve();
@ -353,7 +351,6 @@ class MessageReceiverInner extends EventTarget {
request.respond(200, 'OK');
if (request.verb === 'PUT' && request.path === '/api/v1/queue/empty') {
// tslint:disable-next-line no-floating-promises
this.incomingQueue.add(() => {
this.onEmpty();
});
@ -427,7 +424,6 @@ class MessageReceiverInner extends EventTarget {
}
};
// tslint:disable-next-line no-floating-promises
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
// tslint:disable-next-line no-floating-promises
this.appQueue.add(emitEmpty);
};
const waitForIncomingQueue = () => {
// tslint:disable-next-line no-floating-promises
this.addToQueue(waitForPendingQueue);
// Note: this.count is used in addToQueue
@ -511,11 +505,9 @@ class MessageReceiverInner extends EventTarget {
const waitForCacheAddBatcher = async () => {
await this.cacheAddBatcher.onIdle();
// tslint:disable-next-line no-floating-promises
this.incomingQueue.add(waitForIncomingQueue);
};
// tslint:disable-next-line no-floating-promises
waitForCacheAddBatcher();
}
@ -590,10 +582,8 @@ class MessageReceiverInner extends EventTarget {
} else {
throw new Error('Cached decrypted value was not a string!');
}
// tslint:disable-next-line no-floating-promises
this.queueDecryptedEnvelope(envelope, payloadPlaintext);
} else {
// tslint:disable-next-line no-floating-promises
this.queueEnvelope(envelope);
}
} catch (error) {
@ -639,7 +629,6 @@ class MessageReceiverInner extends EventTarget {
if (this.isEmptied) {
this.clearRetryTimeout();
this.retryCachedTimeout = setTimeout(() => {
// tslint:disable-next-line no-floating-promises
this.pendingQueue.add(async () => this.queueAllCached());
}, RETRY_TIMEOUT);
}
@ -695,7 +684,6 @@ class MessageReceiverInner extends EventTarget {
await window.textsecure.storage.unprocessed.batchAdd(dataArray);
items.forEach(item => {
item.request.respond(200, 'OK');
// tslint:disable-next-line no-floating-promises
this.queueEnvelope(item.envelope);
});
@ -862,7 +850,6 @@ class MessageReceiverInner extends EventTarget {
}
async onDeliveryReceipt(envelope: EnvelopeClass) {
// tslint:disable-next-line promise-must-complete
return new Promise((resolve, reject) => {
const ev = new Event('delivery');
ev.confirm = this.removeFromCache.bind(this, envelope);
@ -894,7 +881,6 @@ class MessageReceiverInner extends EventTarget {
return plaintext;
}
// tslint:disable-next-line max-func-body-length
async decrypt(
envelope: EnvelopeClass,
ciphertext: any
@ -1505,7 +1491,6 @@ class MessageReceiverInner extends EventTarget {
return sentMessage.destination || sentMessage.destinationUuid;
}
// tslint:disable-next-line cyclomatic-complexity
async handleSyncMessage(
envelope: EnvelopeClass,
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
// this attachment download and a lot of processing of that attachment.
// tslint:disable-next-line no-floating-promises
this.handleAttachment(blob).then(async attachmentPointer => {
const results = [];
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
// this attachment download and a lot of processing of that attachment.
// tslint:disable-next-line no-floating-promises
this.handleAttachment(blob).then(async attachmentPointer => {
const groupBuffer = new GroupBuffer(attachmentPointer.data);
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) {
/* eslint-disable no-bitwise, no-param-reassign */
const FLAGS = window.textsecure.protobuf.DataMessage.Flags;

View File

@ -148,7 +148,6 @@ export default class OutgoingMessage {
});
}
// tslint:disable-next-line max-func-body-length
async getKeysForIdentifier(
identifier: string,
updateDevices: Array<number>
@ -322,7 +321,6 @@ export default class OutgoingMessage {
return this.plaintext;
}
// tslint:disable-next-line max-func-body-length
async doSendMessage(
identifier: string,
deviceIds: Array<number>,
@ -357,7 +355,6 @@ export default class OutgoingMessage {
const ourUuid = window.textsecure.storage.user.getUuid();
const ourDeviceId = window.textsecure.storage.user.getDeviceId();
if ((identifier === ourNumber || identifier === ourUuid) && !sealedSender) {
// tslint:disable-next-line no-parameter-reassignment
deviceIds = reject(
deviceIds,
deviceId =>

View File

@ -152,7 +152,6 @@ class Message {
attachmentPointers?: Array<any>;
// tslint:disable cyclomatic-complexity
constructor(options: MessageOptionsType) {
this.attachments = options.attachments || [];
this.body = options.body;
@ -600,7 +599,6 @@ export default class MessageSender {
);
recipients.forEach(identifier => {
// tslint:disable-next-line no-floating-promises
this.queueJobForIdentifier(identifier, async () =>
outgoing.sendToIdentifier(identifier)
);

View File

@ -1,5 +1,3 @@
// tslint:disable no-default-export
export default function createTaskWithTimeout<T>(
task: () => Promise<T>,
id: string,

View File

@ -134,7 +134,6 @@ export default class WebSocketResource extends EventTarget {
keepalive?: KeepAlive;
// tslint:disable-next-line max-func-body-length
constructor(socket: WebSocket, opts: any = {}) {
super();

View File

@ -1,5 +1,3 @@
// tslint:disable no-default-export
import EventTarget from './EventTarget';
import AccountManager from './AccountManager';
import MessageReceiver from './MessageReceiver';

View File

@ -29,7 +29,6 @@ export type BatcherType<ItemType> = {
};
async function sleep(ms: number): Promise<void> {
// tslint:disable-next-line:no-string-based-set-timeout
await new Promise(resolve => setTimeout(resolve, ms));
}
@ -44,7 +43,6 @@ export function createBatcher<ItemType>(
function _kickBatchOff() {
const itemsRef = items;
items = [];
// tslint:disable-next-line:no-floating-promises
queue.add(async () => {
await options.processBatch(itemsRef);
});

View File

@ -4,8 +4,6 @@
// From https://github.com/mathiasbynens/unicode-12.1.0/tree/master/Block
// tslint:disable variable-name
const CJK_Compatibility = /[\u3300-\u33FF]/;
const CJK_Compatibility_Forms = /[\uFE30-\uFE4F]/;
const CJK_Compatibility_Ideographs = /[\uF900-\uFAFF]/;

View File

@ -1,5 +1,4 @@
/* eslint-disable no-console */
// tslint:disable no-console
import * as fs from 'fs';
import { join, relative } from 'path';
import normalizePath from 'normalize-path';
@ -236,7 +235,6 @@ const excludedFilesRegexps = [
'^node_modules/trough/.+',
'^node_modules/ts-loader/.+',
'^node_modules/ts-node/.+',
'^node_modules/tslint.+',
'^node_modules/tweetnacl/.+',
'^node_modules/typed-scss-modules/.+',
'^node_modules/typescript/.+',
@ -362,7 +360,6 @@ async function main(): Promise<void> {
const exception = exceptionsLookup[exceptionKey];
if (exception && (!exception.line || exception.line === line)) {
// tslint:disable-next-line no-dynamic-delete
delete exceptionsLookup[exceptionKey];
return;

View File

@ -40,7 +40,6 @@ type BatcherType<ItemType> = {
};
async function sleep(ms: number): Promise<void> {
// tslint:disable-next-line:no-string-based-set-timeout
await new Promise(resolve => setTimeout(resolve, ms));
}
@ -55,7 +54,6 @@ export function createWaitBatcher<ItemType>(
function _kickBatchOff() {
const itemsRef = items;
items = [];
// tslint:disable-next-line:no-floating-promises
queue.add(async () => {
try {
await options.processBatch(itemsRef.map(item => item.item));

View File

@ -28,7 +28,6 @@ export async function writeWindowsZoneIdentifier(
throw new Error('writeWindowsZoneIdentifier should only run on Windows');
}
// tslint:disable-next-line non-literal-fs-path
if (!fs.existsSync(filePath)) {
throw new Error(
'writeWindowsZoneIdentifier could not find the original file'

View File

@ -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/**"
]
}
}

View File

@ -1,7 +1,6 @@
import { resolve } from 'path';
// eslint-disable-next-line import/no-extraneous-dependencies
import { Configuration, EnvironmentPlugin } from 'webpack';
// tslint:disable-next-line no-require-imports
import HtmlWebpackPlugin = require('html-webpack-plugin');
const context = __dirname;
@ -86,5 +85,4 @@ const stickerCreatorConfig: Configuration = {
},
};
// tslint:disable-next-line no-default-export
export default [stickerCreatorConfig];

View File

@ -4369,7 +4369,7 @@ builder-util@22.3.6, builder-util@~22.3.6:
stat-mode "^1.0.0"
temp-file "^3.3.7"
builtin-modules@^1.0.0, builtin-modules@^1.1.1:
builtin-modules@^1.0.0:
version "1.1.1"
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"
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:
version "2.20.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.0.tgz#d58bb2b5c1ee8f87b0d340027e9e94e222c5a422"
@ -10859,7 +10855,7 @@ mkdirp@0.5.2:
dependencies:
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"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
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"
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:
version "1.9.0"
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"
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:
version "3.17.1"
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759"