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