Add array-type
TypeScript ESLint rule
This commit is contained in:
parent
7efa4f1a8a
commit
da27a6ac64
6 changed files with 15 additions and 7 deletions
|
@ -117,6 +117,8 @@ const rules = {
|
||||||
const typescriptRules = {
|
const typescriptRules = {
|
||||||
...rules,
|
...rules,
|
||||||
|
|
||||||
|
'@typescript-eslint/array-type': ['error', { default: 'generic' }],
|
||||||
|
|
||||||
// Overrides recommended by typescript-eslint
|
// Overrides recommended by typescript-eslint
|
||||||
// https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0
|
// https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0
|
||||||
'@typescript-eslint/no-redeclare': 'error',
|
'@typescript-eslint/no-redeclare': 'error',
|
||||||
|
|
|
@ -66,7 +66,7 @@ export class Linkify extends React.Component<Props> {
|
||||||
|
|
||||||
const chunkData: Array<{
|
const chunkData: Array<{
|
||||||
chunk: string;
|
chunk: string;
|
||||||
matchData: LinkifyIt.Match[];
|
matchData: ReadonlyArray<LinkifyIt.Match>;
|
||||||
}> = splitByEmoji(text).map(({ type, value: chunk }) => {
|
}> = splitByEmoji(text).map(({ type, value: chunk }) => {
|
||||||
if (type === 'text') {
|
if (type === 'text') {
|
||||||
return { chunk, matchData: linkify.match(chunk) || [] };
|
return { chunk, matchData: linkify.match(chunk) || [] };
|
||||||
|
|
|
@ -10,8 +10,11 @@ export interface MinimalIPC {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
sendSync(channel: string): any;
|
sendSync(channel: string): any;
|
||||||
|
|
||||||
|
on(
|
||||||
|
channel: string,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
on(channel: string, listener: (event: unknown, ...args: any[]) => void): this;
|
listener: (event: unknown, ...args: ReadonlyArray<any>) => void
|
||||||
|
): this;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SystemThemeHolder = { systemTheme: 'dark' | 'light' };
|
export type SystemThemeHolder = { systemTheme: 'dark' | 'light' };
|
||||||
|
|
|
@ -248,7 +248,7 @@ const dataInterface: ServerInterface = {
|
||||||
};
|
};
|
||||||
export default dataInterface;
|
export default dataInterface;
|
||||||
|
|
||||||
type DatabaseQueryCache = Map<string, Statement<any[]>>;
|
type DatabaseQueryCache = Map<string, Statement<Array<any>>>;
|
||||||
|
|
||||||
const statementCache = new WeakMap<Database, DatabaseQueryCache>();
|
const statementCache = new WeakMap<Database, DatabaseQueryCache>();
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,10 @@ describe('MentionCompletion', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('onTextChange', () => {
|
describe('onTextChange', () => {
|
||||||
let possiblyShowMemberResultsStub: sinon.SinonStub<[], ConversationType[]>;
|
let possiblyShowMemberResultsStub: sinon.SinonStub<
|
||||||
|
[],
|
||||||
|
Array<ConversationType>
|
||||||
|
>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
possiblyShowMemberResultsStub = sinon.stub(
|
possiblyShowMemberResultsStub = sinon.stub(
|
||||||
|
|
|
@ -81,7 +81,7 @@ declare global {
|
||||||
| DhImportKeyParams
|
| DhImportKeyParams
|
||||||
| AesKeyAlgorithm,
|
| AesKeyAlgorithm,
|
||||||
extractable: boolean,
|
extractable: boolean,
|
||||||
keyUsages: string[]
|
keyUsages: Array<string>
|
||||||
): Promise<CryptoKey>;
|
): Promise<CryptoKey>;
|
||||||
|
|
||||||
importKey(
|
importKey(
|
||||||
|
@ -107,7 +107,7 @@ declare global {
|
||||||
| DhImportKeyParams
|
| DhImportKeyParams
|
||||||
| AesKeyAlgorithm,
|
| AesKeyAlgorithm,
|
||||||
extractable: boolean,
|
extractable: boolean,
|
||||||
keyUsages: string[]
|
keyUsages: Array<string>
|
||||||
): Promise<CryptoKey>;
|
): Promise<CryptoKey>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue