Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1f24f26

Browse files
committed
Fix linting errors.
1 parent 13b40ea commit 1f24f26

File tree

6 files changed

+62
-46
lines changed

6 files changed

+62
-46
lines changed

‎src/CodeSnippetDisplay.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,8 @@ export class CodeSnippetDisplay extends React.Component<
525525
if (target.innerHTML !== new_element.value) {
526526
const newName = new_element.value;
527527

528-
const isDuplicateName = this.props.codeSnippetManager.duplicateNameExists(
529-
newName
530-
);
528+
const isDuplicateName =
529+
this.props.codeSnippetManager.duplicateNameExists(newName);
531530

532531
if (isDuplicateName) {
533532
await showDialog({
@@ -605,8 +604,8 @@ export class CodeSnippetDisplay extends React.Component<
605604
'--jp-content-font-color3'
606605
);
607606

608-
(this._dragData.dragImage
609-
.children[0]asHTMLElement).style.color=dragImageTextColor;
607+
(this._dragData.dragImage.children[0]asHTMLElement).style.color=
608+
dragImageTextColor;
610609

611610
// add CSS style
612611
this._dragData.dragImage.classList.add(SNIPPET_DRAG_IMAGE);
@@ -1498,7 +1497,8 @@ export class CodeSnippetDisplay extends React.Component<
14981497
if (value.button.accept) {
14991498
const dirs = value.value.split('/');
15001499

1501-
const codeSnippetContentsManager = CodeSnippetContentsService.getInstance();
1500+
const codeSnippetContentsManager =
1501+
CodeSnippetContentsService.getInstance();
15021502

15031503
let path = '';
15041504
for (let i = 0; i < dirs.length; i++) {

‎src/CodeSnippetEditor.tsx

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ export class CodeSnippetEditor extends ReactWidget {
177177
document.getElementById('code-' + this._codeSnippetEditorMetaData.id)
178178
) {
179179
const editorFactory = this.editorServices.factoryService.newInlineEditor;
180-
const getMimeTypeByLanguage =this.editorServices.mimeTypeService
181-
.getMimeTypeByLanguage;
180+
const getMimeTypeByLanguage =
181+
this.editorServices.mimeTypeService.getMimeTypeByLanguage;
182182

183183
this.editor = editorFactory({
184184
host: document.getElementById(
@@ -257,15 +257,21 @@ export class CodeSnippetEditor extends ReactWidget {
257257
this.dispose();
258258
super.onCloseRequest(msg);
259259
} else if (response.button.label === 'Save') {
260-
const name = (document.querySelector(
261-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_NAME_INPUT}`
262-
) as HTMLInputElement).value;
263-
const description = (document.querySelector(
264-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_DESC_INPUT}`
265-
) as HTMLInputElement).value;
266-
const language = (document.querySelector(
267-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_LANG_INPUT}`
268-
) as HTMLSelectElement).value;
260+
const name = (
261+
document.querySelector(
262+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_NAME_INPUT}`
263+
) as HTMLInputElement
264+
).value;
265+
const description = (
266+
document.querySelector(
267+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_DESC_INPUT}`
268+
) as HTMLInputElement
269+
).value;
270+
const language = (
271+
document.querySelector(
272+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_LANG_INPUT}`
273+
) as HTMLSelectElement
274+
).value;
269275

270276
const validity = validateInputs(name, description, language);
271277
if (validity) {
@@ -333,15 +339,21 @@ export class CodeSnippetEditor extends ReactWidget {
333339
}
334340

335341
saveChange(event: React.MouseEvent<HTMLElement, MouseEvent>): void {
336-
const name = (document.querySelector(
337-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_NAME_INPUT}`
338-
) as HTMLInputElement).value;
339-
const description = (document.querySelector(
340-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_DESC_INPUT}`
341-
) as HTMLInputElement).value;
342-
const language = (document.querySelector(
343-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_LANG_INPUT}`
344-
) as HTMLSelectElement).value;
342+
const name = (
343+
document.querySelector(
344+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_NAME_INPUT}`
345+
) as HTMLInputElement
346+
).value;
347+
const description = (
348+
document.querySelector(
349+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_DESC_INPUT}`
350+
) as HTMLInputElement
351+
).value;
352+
const language = (
353+
document.querySelector(
354+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_LANG_INPUT}`
355+
) as HTMLSelectElement
356+
).value;
345357

346358
const validity = validateInputs(name, description, language);
347359
if (validity) {
@@ -350,15 +362,21 @@ export class CodeSnippetEditor extends ReactWidget {
350362
}
351363

352364
async updateSnippet(): Promise<boolean> {
353-
const name = (document.querySelector(
354-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_NAME_INPUT}`
355-
) as HTMLInputElement).value;
356-
const description = (document.querySelector(
357-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_DESC_INPUT}`
358-
) as HTMLInputElement).value;
359-
const language = (document.querySelector(
360-
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_LANG_INPUT}`
361-
) as HTMLSelectElement).value;
365+
const name = (
366+
document.querySelector(
367+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_NAME_INPUT}`
368+
) as HTMLInputElement
369+
).value;
370+
const description = (
371+
document.querySelector(
372+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_DESC_INPUT}`
373+
) as HTMLInputElement
374+
).value;
375+
const language = (
376+
document.querySelector(
377+
`.${CODE_SNIPPET_EDITOR}-${this._codeSnippetEditorMetaData.id} .${CODE_SNIPPET_EDITOR_LANG_INPUT}`
378+
) as HTMLSelectElement
379+
).value;
362380

363381
this._codeSnippetEditorMetaData.name = name;
364382
this._codeSnippetEditorMetaData.description = description;
@@ -409,11 +427,10 @@ export class CodeSnippetEditor extends ReactWidget {
409427
).then((res: boolean) => {
410428
if (res) {
411429
// get the id of snippet you are editting
412-
const removedSnippet = this.contentsService.getSnippet(
413-
oldName
414-
)[0];
430+
const removedSnippet =
431+
this.contentsService.getSnippet(oldName)[0];
415432

416-
// delete the one you are editting
433+
// delete the one you are editing
417434
this.contentsService.deleteSnippet(removedSnippet.id);
418435
} else {
419436
return false;

‎src/CodeSnippetInputDialog.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const FILE_DIALOG_CLASS = 'jp-codeSnippet-fileDialog';
2323
/**
2424
* CSS STYLING
2525
*/
26-
// const CODE_SNIPPET_DIALOG_INPUT = 'jp-codeSnippet-dialog-input';
2726
const CODE_SNIPPET_DIALOG_NAME_INPUT = 'jp-codeSnippet-dialog-name-input';
2827
const CODE_SNIPPET_DIALOG_DESC_INPUT = 'jp-codeSnippet-dialog-desc-input';
2928
const CODE_SNIPPET_DIALOG_LANG_INPUT = 'jp-codeSnippet-dialog-lang-input';

‎src/CodeSnippetPreview.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { ArrayExt } from '@lumino/algorithm';
1212
import { ICodeSnippet, CodeSnippetService } from './CodeSnippetService';
1313

1414
/**
15-
* The class name for preview box
15+
* The class name for preview box.
1616
*/
1717
const PREVIEW_CLASS = 'jp-codeSnippet-preview';
1818
const PREVIEW_CONTENT = 'jp-codeSnippet-preview-content';
@@ -156,8 +156,8 @@ export class Preview<T> extends Widget {
156156

157157
if (!this.editor && document.getElementById(PREVIEW_CONTENT + this._id)) {
158158
const editorFactory = this.editorServices.factoryService.newInlineEditor;
159-
const getMimeTypeByLanguage = this.editorServices.mimeTypeService
160-
.getMimeTypeByLanguage;
159+
const getMimeTypeByLanguage =
160+
this.editorServices.mimeTypeService.getMimeTypeByLanguage;
161161

162162
let previewFontSize = this.codeSnippetService.settings.get(
163163
'snippetPreviewFontSize'

‎src/CodeSnippetService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface ICodeSnippet {
88
name: string;
99
description: string;
1010
language: string;
11-
// code separated by new line
11+
// code separated by a new line
1212
code: string[];
1313
id: number;
1414
tags?: string[];

‎src/CodeSnippetWidget.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ export class CodeSnippetWidget extends ReactWidget {
290290
this.moveCodeSnippet(srcIdx, idx);
291291
}
292292
} else {
293-
const notebook: Notebook =event.mimeData.getData('internal:cells')[0]
294-
.parent;
293+
const notebook: Notebook =
294+
event.mimeData.getData('internal:cells')[0].parent;
295295

296296
const language = notebook.model.defaultKernelLanguage;
297297
// Handle the case where we are copying cells

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /