mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-08 13:06:15 +02:00
Tools: Add eslint rule @typescript-eslint/array-type
This commit is contained in:
parent
e89b59be8e
commit
c6a15b3186
@ -183,6 +183,7 @@ module.exports = {
|
||||
'rules': {
|
||||
'@typescript-eslint/explicit-member-accessibility': ['error'],
|
||||
'@typescript-eslint/type-annotation-spacing': ['error', { 'before': false, 'after': true }],
|
||||
'@typescript-eslint/array-type': 'error',
|
||||
'@typescript-eslint/no-inferrable-types': ['error'],
|
||||
'@typescript-eslint/comma-dangle': ['error', {
|
||||
'arrays': 'always-multiline',
|
||||
|
@ -10,7 +10,7 @@ export const declaration: CommandDeclaration = {
|
||||
|
||||
export const runtime = (): CommandRuntime => {
|
||||
return {
|
||||
execute: async (_context: CommandContext, field?: string | Array<any>, reverse?: boolean) => {
|
||||
execute: async (_context: CommandContext, field?: string | any[], reverse?: boolean) => {
|
||||
// field: Sort order's field. undefined means switching a field.
|
||||
// reverse: whether the sort order is reversed or not. undefined means toggling.
|
||||
//
|
||||
|
@ -20,7 +20,7 @@ const { clipboard } = require('electron');
|
||||
|
||||
interface Props {
|
||||
themeId: number;
|
||||
noteIds: Array<string>;
|
||||
noteIds: string[];
|
||||
onClose: Function;
|
||||
shares: StateShare[];
|
||||
syncTargetId: number;
|
||||
|
@ -6,7 +6,7 @@ type CallbackHandler<EventType> = (data: EventType)=> void;
|
||||
export default class EventDispatcher<EventKeyType extends string|symbol|number, EventMessageType> {
|
||||
// Partial marks all fields as optional. To initialize with an empty object, this is required.
|
||||
// See https://stackoverflow.com/a/64526384
|
||||
private listeners: Partial<Record<EventKeyType, Array<Listener<EventMessageType>>>>;
|
||||
private listeners: Partial<Record<EventKeyType, Listener<EventMessageType>[]>>;
|
||||
public constructor() {
|
||||
this.listeners = {};
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ const markdownUtils = {
|
||||
},
|
||||
|
||||
// Returns the **encoded** URLs, so to be useful they should be decoded again before use.
|
||||
extractFileUrls(md: string, onlyType: string = null): Array<string> {
|
||||
extractFileUrls(md: string, onlyType: string = null): string[] {
|
||||
const markdownIt = new MarkdownIt();
|
||||
markdownIt.validateLink = validateLinks; // Necessary to support file:/// links
|
||||
|
||||
|
@ -2082,7 +2082,7 @@ class Setting extends BaseModel {
|
||||
// If yes, then it just returns 'true'. If its not present then, it will
|
||||
// update it and return 'false'
|
||||
public static setArrayValue(settingName: string, value: string): boolean {
|
||||
const settingValue: Array<any> = this.value(settingName);
|
||||
const settingValue: any[] = this.value(settingName);
|
||||
if (settingValue.includes(value)) return true;
|
||||
settingValue.push(value);
|
||||
this.setValue(settingName, settingValue);
|
||||
|
@ -10,7 +10,7 @@ const shared = require('../../../components/shared/config-shared.js');
|
||||
const logger = Logger.create('defaultPluginsUtils');
|
||||
|
||||
export function checkPreInstalledDefaultPlugins(defaultPluginsId: string[], pluginSettings: PluginSettings) {
|
||||
const installedDefaultPlugins: Array<string> = Setting.value('installedDefaultPlugins');
|
||||
const installedDefaultPlugins: string[] = Setting.value('installedDefaultPlugins');
|
||||
for (const pluginId of defaultPluginsId) {
|
||||
// if pluginId is present in pluginSettings and not in installedDefaultPlugins array,
|
||||
// then its either pre-installed by user or just uninstalled
|
||||
|
@ -55,7 +55,7 @@ interface SafxInterface {
|
||||
unlink(uriString: string): Promise<boolean>;
|
||||
mkdir(uriString: string): Promise<DocumentFileDetail>;
|
||||
rename(uriString: string, newName: string): Promise<DocumentFileDetail>;
|
||||
getPersistedUriPermissions(): Promise<Array<string>>;
|
||||
getPersistedUriPermissions(): Promise<string[]>;
|
||||
releasePersistableUriPermission(uriString: string): Promise<void>;
|
||||
listFiles(uriString: string): Promise<DocumentFileDetail[]>;
|
||||
stat(uriString: string): Promise<DocumentFileDetail>;
|
||||
|
Loading…
Reference in New Issue
Block a user