mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-08 13:06:15 +02:00
This commit is contained in:
parent
e21a5c1b80
commit
28923a69b2
@ -108,6 +108,9 @@ module.exports = {
|
||||
'semi': ['error', 'always'],
|
||||
'eol-last': ['error', 'always'],
|
||||
'quotes': ['error', 'single'],
|
||||
|
||||
// Note that "indent" only applies to JavaScript files. See
|
||||
// https://github.com/laurent22/joplin/issues/8360
|
||||
'indent': ['error', 'tab'],
|
||||
'comma-dangle': ['error', {
|
||||
'arrays': 'always-multiline',
|
||||
@ -184,6 +187,12 @@ module.exports = {
|
||||
'project': './tsconfig.eslint.json',
|
||||
},
|
||||
'rules': {
|
||||
'@typescript-eslint/indent': ['error', 'tab', {
|
||||
'ignoredNodes': [
|
||||
// See https://github.com/typescript-eslint/typescript-eslint/issues/1824
|
||||
'TSUnionType',
|
||||
],
|
||||
}],
|
||||
'@typescript-eslint/ban-ts-comment': ['error'],
|
||||
'@typescript-eslint/ban-types': 'error',
|
||||
'@typescript-eslint/explicit-member-accessibility': ['error'],
|
||||
|
@ -25,9 +25,9 @@ export const defaultSearchState: SearchState = {
|
||||
};
|
||||
|
||||
export interface SearchPanelProps {
|
||||
searchControl: SearchControl;
|
||||
searchState: SearchState;
|
||||
editorSettings: EditorSettings;
|
||||
searchControl: SearchControl;
|
||||
searchState: SearchState;
|
||||
editorSettings: EditorSettings;
|
||||
}
|
||||
|
||||
interface ActionButtonProps {
|
||||
|
@ -15,9 +15,9 @@ export interface EditorSettings {
|
||||
// [themeStyle(themeId: number)] doesn't work. As such, we need both
|
||||
// the [themeId] and [themeData].
|
||||
themeId: number;
|
||||
themeData: Theme;
|
||||
themeData: Theme;
|
||||
|
||||
katexEnabled: boolean;
|
||||
katexEnabled: boolean;
|
||||
spellcheckEnabled: boolean;
|
||||
}
|
||||
|
||||
@ -41,14 +41,14 @@ export interface SelectionChangeEvent {
|
||||
}
|
||||
|
||||
export interface SearchControl {
|
||||
findNext(): void;
|
||||
findPrevious(): void;
|
||||
replaceCurrent(): void;
|
||||
replaceAll(): void;
|
||||
findNext(): void;
|
||||
findPrevious(): void;
|
||||
replaceCurrent(): void;
|
||||
replaceAll(): void;
|
||||
setSearchState(state: SearchState): void;
|
||||
|
||||
showSearch(): void;
|
||||
hideSearch(): void;
|
||||
showSearch(): void;
|
||||
hideSearch(): void;
|
||||
}
|
||||
|
||||
export interface SearchState {
|
||||
@ -57,7 +57,7 @@ export interface SearchState {
|
||||
|
||||
searchText: string;
|
||||
replaceText: string;
|
||||
dialogVisible: boolean;
|
||||
dialogVisible: boolean;
|
||||
}
|
||||
|
||||
// Possible types of lists in the editor
|
||||
|
@ -17,15 +17,15 @@ import { Dimensions } from 'react-native';
|
||||
|
||||
export interface ValueMap {
|
||||
// Value to use on small-width displays
|
||||
sm?: number;
|
||||
sm?: number;
|
||||
// Value to use on medium-width displays
|
||||
md?: number;
|
||||
md?: number;
|
||||
// Value to use on large-width displays
|
||||
lg?: number;
|
||||
lg?: number;
|
||||
// Value to use on extra-large width displays
|
||||
xl?: number;
|
||||
xl?: number;
|
||||
// Value to use on extra-extra-large width displays
|
||||
xxl?: number;
|
||||
xxl?: number;
|
||||
}
|
||||
|
||||
export default function getResponsiveValue(valueMap: ValueMap): number {
|
||||
|
@ -3,8 +3,8 @@ import { Dispatch } from 'redux';
|
||||
const { NativeEventEmitter, NativeModules, Platform } = require('react-native');
|
||||
|
||||
interface NotificationData {
|
||||
joplinNotificationId: string;
|
||||
noteId: string;
|
||||
joplinNotificationId: string;
|
||||
noteId: string;
|
||||
}
|
||||
|
||||
export default async (dispatch: Dispatch) => {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import EventDispatcher from './EventDispatcher';
|
||||
|
||||
enum TestKey {
|
||||
FooEvent,
|
||||
BarEvent,
|
||||
BazEvent,
|
||||
FooEvent,
|
||||
BarEvent,
|
||||
BazEvent,
|
||||
}
|
||||
|
||||
describe('EventDispatcher', () => {
|
||||
|
@ -19,14 +19,14 @@ export function getTagCallbackUrl(tagId: string) {
|
||||
}
|
||||
|
||||
export const enum CallbackUrlCommand {
|
||||
OpenNote = 'openNote',
|
||||
OpenFolder = 'openFolder',
|
||||
OpenTag = 'openTag',
|
||||
OpenNote = 'openNote',
|
||||
OpenFolder = 'openFolder',
|
||||
OpenTag = 'openTag',
|
||||
}
|
||||
|
||||
export interface CallbackUrlInfo {
|
||||
command: CallbackUrlCommand;
|
||||
params: Record<string, string>;
|
||||
command: CallbackUrlCommand;
|
||||
params: Record<string, string>;
|
||||
}
|
||||
|
||||
export function parseCallbackUrl(s: string): CallbackUrlInfo {
|
||||
|
@ -3,8 +3,8 @@ const { useCallback, useEffect, useState } = shim.react();
|
||||
import useEventListener from './useEventListener';
|
||||
|
||||
interface Size {
|
||||
width: number;
|
||||
height: number;
|
||||
width: number;
|
||||
height: number;
|
||||
}
|
||||
|
||||
function useElementSize(elementRef: any): Size {
|
||||
|
@ -2,7 +2,7 @@ import Setting from '../models/Setting';
|
||||
import checkProviderIsSupported from '../utils/webDAVUtils';
|
||||
|
||||
interface Script {
|
||||
exec: ()=> Promise<void>;
|
||||
exec: ()=> Promise<void>;
|
||||
}
|
||||
|
||||
const script: Script = <Script>{};
|
||||
|
@ -38,7 +38,7 @@ export interface DefaultPluginSettings {
|
||||
}
|
||||
|
||||
export interface DefaultPluginsInfo {
|
||||
[pluginId: string]: DefaultPluginSettings;
|
||||
[pluginId: string]: DefaultPluginSettings;
|
||||
}
|
||||
|
||||
export interface PluginSetting {
|
||||
|
@ -9,8 +9,8 @@ interface Term {
|
||||
}
|
||||
|
||||
enum Relation {
|
||||
OR = 'OR',
|
||||
AND = 'AND',
|
||||
OR = 'OR',
|
||||
AND = 'AND',
|
||||
}
|
||||
|
||||
enum Operation {
|
||||
|
@ -4,8 +4,8 @@ import { reg } from './registry';
|
||||
import { Plugins } from './services/plugins/PluginService';
|
||||
|
||||
interface PluginList {
|
||||
completeList: string;
|
||||
summary: string;
|
||||
completeList: string;
|
||||
summary: string;
|
||||
}
|
||||
|
||||
function getPluginLists(plugins: Plugins): PluginList {
|
||||
|
@ -2,9 +2,9 @@ import { useRef, useEffect, MutableRefObject } from 'react';
|
||||
|
||||
export interface VisibleOnSelect {
|
||||
container: MutableRefObject<HTMLElement>;
|
||||
wrapperRef: MutableRefObject<HTMLElement>;
|
||||
wrapperRef: MutableRefObject<HTMLElement>;
|
||||
isVisible: boolean;
|
||||
isSelected: boolean;
|
||||
isSelected: boolean;
|
||||
}
|
||||
|
||||
// Used in thumbnail view, to scroll to the newly selected page.
|
||||
|
@ -5,9 +5,9 @@ export interface ScaledSize {
|
||||
}
|
||||
|
||||
export interface IconButtonProps {
|
||||
onClick: ()=> void;
|
||||
size?: number;
|
||||
color?: string;
|
||||
onClick: ()=> void;
|
||||
size?: number;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
export interface RenderRequest {
|
||||
|
@ -24,12 +24,12 @@ const ButtonElement = styled.button<{ hoverColor?: string; size?: number; color?
|
||||
`;
|
||||
|
||||
interface BaseButtonProps {
|
||||
icon: IconDefinition;
|
||||
onClick: ()=> void;
|
||||
name: string;
|
||||
size: number;
|
||||
color: string;
|
||||
hoverColor?: string;
|
||||
icon: IconDefinition;
|
||||
onClick: ()=> void;
|
||||
name: string;
|
||||
size: number;
|
||||
color: string;
|
||||
hoverColor?: string;
|
||||
}
|
||||
|
||||
function BaseButton({ onClick, icon, name, size, color, hoverColor }: BaseButtonProps) {
|
||||
|
@ -29,66 +29,66 @@ export type Encoding = 'utf8' | 'base64' | 'ascii';
|
||||
|
||||
/** Native interface of the module */
|
||||
interface SafxInterface {
|
||||
openDocumentTree(persist: boolean): Promise<DocumentFileDetail | null>;
|
||||
openDocument(
|
||||
persist: boolean,
|
||||
multiple: boolean,
|
||||
): Promise<DocumentFileDetail[] | null>;
|
||||
createDocument(
|
||||
data: string,
|
||||
encoding?: string,
|
||||
initialName?: string,
|
||||
mimeType?: string,
|
||||
): Promise<DocumentFileDetail | null>;
|
||||
hasPermission(uriString: string): Promise<boolean>;
|
||||
exists(uriString: string): Promise<boolean>;
|
||||
readFile(uriString: string, encoding?: Encoding): Promise<string>;
|
||||
writeFile(
|
||||
uriString: string,
|
||||
data: string,
|
||||
encoding?: Encoding,
|
||||
mimeType?: string,
|
||||
append?: boolean,
|
||||
): Promise<void>;
|
||||
createFile(uriString: string, mimeType?: string): Promise<DocumentFileDetail>;
|
||||
unlink(uriString: string): Promise<boolean>;
|
||||
mkdir(uriString: string): Promise<DocumentFileDetail>;
|
||||
rename(uriString: string, newName: string): Promise<DocumentFileDetail>;
|
||||
getPersistedUriPermissions(): Promise<string[]>;
|
||||
releasePersistableUriPermission(uriString: string): Promise<void>;
|
||||
listFiles(uriString: string): Promise<DocumentFileDetail[]>;
|
||||
stat(uriString: string): Promise<DocumentFileDetail>;
|
||||
transferFile(
|
||||
srcUri: string,
|
||||
destUri: string,
|
||||
replaceIfDestExist: boolean,
|
||||
copy: boolean,
|
||||
): Promise<DocumentFileDetail | null>;
|
||||
openDocumentTree(persist: boolean): Promise<DocumentFileDetail | null>;
|
||||
openDocument(
|
||||
persist: boolean,
|
||||
multiple: boolean,
|
||||
): Promise<DocumentFileDetail[] | null>;
|
||||
createDocument(
|
||||
data: string,
|
||||
encoding?: string,
|
||||
initialName?: string,
|
||||
mimeType?: string,
|
||||
): Promise<DocumentFileDetail | null>;
|
||||
hasPermission(uriString: string): Promise<boolean>;
|
||||
exists(uriString: string): Promise<boolean>;
|
||||
readFile(uriString: string, encoding?: Encoding): Promise<string>;
|
||||
writeFile(
|
||||
uriString: string,
|
||||
data: string,
|
||||
encoding?: Encoding,
|
||||
mimeType?: string,
|
||||
append?: boolean,
|
||||
): Promise<void>;
|
||||
createFile(uriString: string, mimeType?: string): Promise<DocumentFileDetail>;
|
||||
unlink(uriString: string): Promise<boolean>;
|
||||
mkdir(uriString: string): Promise<DocumentFileDetail>;
|
||||
rename(uriString: string, newName: string): Promise<DocumentFileDetail>;
|
||||
getPersistedUriPermissions(): Promise<string[]>;
|
||||
releasePersistableUriPermission(uriString: string): Promise<void>;
|
||||
listFiles(uriString: string): Promise<DocumentFileDetail[]>;
|
||||
stat(uriString: string): Promise<DocumentFileDetail>;
|
||||
transferFile(
|
||||
srcUri: string,
|
||||
destUri: string,
|
||||
replaceIfDestExist: boolean,
|
||||
copy: boolean,
|
||||
): Promise<DocumentFileDetail | null>;
|
||||
}
|
||||
|
||||
export type DocumentFileDetail = {
|
||||
uri: string;
|
||||
name: string;
|
||||
type: 'directory' | 'file';
|
||||
lastModified: number;
|
||||
mime: string;
|
||||
size: number;
|
||||
uri: string;
|
||||
name: string;
|
||||
type: 'directory' | 'file';
|
||||
lastModified: number;
|
||||
mime: string;
|
||||
size: number;
|
||||
};
|
||||
|
||||
export type FileOperationOptions = {
|
||||
/** Defaults to `'utf8'` */
|
||||
encoding?: Encoding;
|
||||
/** Defaults to `'utf8'` */
|
||||
encoding?: Encoding;
|
||||
|
||||
/** Append data to the file. If not set file content will be overwritten. */
|
||||
append?: boolean;
|
||||
/** Append data to the file. If not set file content will be overwritten. */
|
||||
append?: boolean;
|
||||
|
||||
/** mime type of the file being saved. Defaults to '\*\/\*' */
|
||||
mimeType?: string;
|
||||
/** mime type of the file being saved. Defaults to '\*\/\*' */
|
||||
mimeType?: string;
|
||||
};
|
||||
|
||||
export type CreateDocumentOptions = FileOperationOptions & {
|
||||
/** initial display name when opening file picker */
|
||||
initialName?: string;
|
||||
/** initial display name when opening file picker */
|
||||
initialName?: string;
|
||||
};
|
||||
|
||||
// Open the Document Picker to select a folder. Read/Write Permission will be granted to the selected folder.
|
||||
@ -98,10 +98,10 @@ export function openDocumentTree(persist: boolean) {
|
||||
}
|
||||
|
||||
export type OpenDocumentOptions = {
|
||||
/** should the permission of returned document(s) be persisted ? */
|
||||
persist?: boolean;
|
||||
/** should the file picker allow multiple documents ? */
|
||||
multiple?: boolean;
|
||||
/** should the permission of returned document(s) be persisted ? */
|
||||
persist?: boolean;
|
||||
/** should the file picker allow multiple documents ? */
|
||||
multiple?: boolean;
|
||||
};
|
||||
|
||||
// Open the Document Picker to select a file.
|
||||
@ -206,7 +206,7 @@ export function stat(uriString: string) {
|
||||
}
|
||||
|
||||
type FileTransferOptions = {
|
||||
replaceIfDestinationExists?: boolean;
|
||||
replaceIfDestinationExists?: boolean;
|
||||
};
|
||||
|
||||
// Copy file from source uri to destination uri.
|
||||
|
@ -18,9 +18,9 @@ require('pg').types.setTypeParser(20, (val: any) => {
|
||||
// Also need this to get integers for count() queries.
|
||||
// https://knexjs.org/#Builder-count
|
||||
declare module 'knex/types/result' {
|
||||
interface Registry {
|
||||
Count: number;
|
||||
}
|
||||
interface Registry {
|
||||
Count: number;
|
||||
}
|
||||
}
|
||||
|
||||
const logger = Logger.create('db');
|
||||
|
@ -12,7 +12,7 @@ export enum NotificationLevel {
|
||||
}
|
||||
|
||||
export enum ItemType {
|
||||
Item = 1,
|
||||
Item = 1,
|
||||
UserItem = 2,
|
||||
User,
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ import { execCommand } from '@joplin/utils';
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
interface PluginAndVersion {
|
||||
[pluginId: string]: string;
|
||||
[pluginId: string]: string;
|
||||
}
|
||||
|
||||
interface PluginIdAndName {
|
||||
|
Loading…
Reference in New Issue
Block a user