1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-13 00:10:37 +02:00

Tools: Add class member accessibility modifiers and converted rule @typescript-eslint/explicit-member-accessibility to an error

This commit is contained in:
Laurent Cozic
2023-03-06 14:22:01 +00:00
parent aa4af69afc
commit c1db7182ac
129 changed files with 1252 additions and 1296 deletions

View File

@ -41,7 +41,7 @@ interface ReportItem {
}
export default class ReportService {
csvEscapeCell(cell: string) {
public csvEscapeCell(cell: string) {
cell = this.csvValueToString(cell);
const output = cell.replace(/"/, '""');
if (this.csvCellRequiresQuotes(cell, ',')) {
@ -50,26 +50,26 @@ export default class ReportService {
return output;
}
csvCellRequiresQuotes(cell: string, delimiter: string) {
public csvCellRequiresQuotes(cell: string, delimiter: string) {
if (cell.indexOf('\n') >= 0) return true;
if (cell.indexOf('"') >= 0) return true;
if (cell.indexOf(delimiter) >= 0) return true;
return false;
}
csvValueToString(v: string) {
public csvValueToString(v: string) {
if (v === undefined || v === null) return '';
return v.toString();
}
csvCreateLine(row: string[]) {
public csvCreateLine(row: string[]) {
for (let i = 0; i < row.length; i++) {
row[i] = this.csvEscapeCell(row[i]);
}
return row.join(',');
}
csvCreate(rows: any[]) {
public csvCreate(rows: any[]) {
const output = [];
for (let i = 0; i < rows.length; i++) {
output.push(this.csvCreateLine(rows[i]));
@ -77,7 +77,7 @@ export default class ReportService {
return output.join('\n');
}
async basicItemList(option: any = null) {
public async basicItemList(option: any = null) {
if (!option) option = {};
if (!option.format) option.format = 'array';
@ -100,7 +100,7 @@ export default class ReportService {
return option.format === 'csv' ? this.csvCreate(output) : output;
}
async syncStatus(syncTarget: number) {
public async syncStatus(syncTarget: number) {
const output: any = {
items: {},
total: {},
@ -162,7 +162,7 @@ export default class ReportService {
return section;
}
async status(syncTarget: number): Promise<ReportSection[]> {
public async status(syncTarget: number): Promise<ReportSection[]> {
const r = await this.syncStatus(syncTarget);
const sections: ReportSection[] = [];
let section: ReportSection = null;