@@ -31,7 +31,7 @@ import {
3131 pythonIcon ,
3232 fileIcon ,
3333 rKernelIcon ,
34- markdownIcon
34+ markdownIcon ,
3535} from '@jupyterlab/ui-components' ;
3636import { CodeEditor , IEditorServices } from '@jupyterlab/codeeditor' ;
3737import * as nbformat from '@jupyterlab/nbformat' ;
@@ -41,7 +41,7 @@ import {
4141 CodeCellModel ,
4242 ICodeCellModel ,
4343 MarkdownCell ,
44- CodeCell
44+ CodeCell ,
4545} from '@jupyterlab/cells' ;
4646
4747import { Widget } from '@lumino/widgets' ;
@@ -97,7 +97,7 @@ import {
9797 sbtIcon ,
9898 rustIcon ,
9999 qsharpIcon ,
100- sasIcon
100+ sasIcon ,
101101} from './CodeSnippetLanguages' ;
102102import { ICodeSnippetEditorMetadata } from './CodeSnippetEditor' ;
103103// import { CodeSnippetContentsService } from './CodeSnippetContentsService';
@@ -152,7 +152,7 @@ const JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';
152152 */
153153const moreOptionsIcon = new LabIcon ( {
154154 name : 'custom-ui-components:moreOptions' ,
155- svgstr : moreSVGstr
155+ svgstr : moreSVGstr ,
156156} ) ;
157157
158158/**
@@ -196,7 +196,7 @@ export class CodeSnippetDisplay extends React.Component<
196196 matchIndices : [ ] ,
197197 searchValue : '' ,
198198 filterTags : [ ] ,
199- searchOptions : [ ]
199+ searchOptions : [ ] ,
200200 } ;
201201 this . _drag = null ;
202202 this . _dragData = null ;
@@ -292,7 +292,7 @@ export class CodeSnippetDisplay extends React.Component<
292292 '" is incompatible with ' +
293293 editorLanguage +
294294 '. Continue?' ,
295- buttons : [ Dialog . cancelButton ( ) , Dialog . okButton ( ) ]
295+ buttons : [ Dialog . cancelButton ( ) , Dialog . okButton ( ) ] ,
296296 } ) ;
297297 } ;
298298
@@ -301,7 +301,7 @@ export class CodeSnippetDisplay extends React.Component<
301301 return showDialog ( {
302302 title : 'Error' ,
303303 body : errMsg ,
304- buttons : [ Dialog . okButton ( ) ]
304+ buttons : [ Dialog . okButton ( ) ] ,
305305 } ) ;
306306 } ;
307307
@@ -429,7 +429,7 @@ export class CodeSnippetDisplay extends React.Component<
429429 await showDialog ( {
430430 title : 'Duplicate Name of Code Snippet' ,
431431 body : < p > { `"${ newName } " already exists.` } </ p > ,
432- buttons : [ Dialog . okButton ( { label : 'Dismiss' } ) ]
432+ buttons : [ Dialog . okButton ( { label : 'Dismiss' } ) ] ,
433433 } ) ;
434434 } else {
435435 this . props . codeSnippetManager
@@ -494,7 +494,7 @@ export class CodeSnippetDisplay extends React.Component<
494494 this . _dragData = {
495495 pressX : event . clientX ,
496496 pressY : event . clientY ,
497- dragImage : target . nextSibling . firstChild . cloneNode ( true ) as HTMLElement
497+ dragImage : target . nextSibling . firstChild . cloneNode ( true ) as HTMLElement ,
498498 } ;
499499
500500 const dragImageTextColor = getComputedStyle ( document . body ) . getPropertyValue (
@@ -593,7 +593,7 @@ export class CodeSnippetDisplay extends React.Component<
593593 dragImage : dragImage ,
594594 supportedActions : 'copy-move' ,
595595 proposedAction : 'copy' ,
596- source : this
596+ source : this ,
597597 } ) ;
598598
599599 this . _drag . mimeData . setData ( JUPYTER_CELL_MIME , selected ) ;
@@ -1181,8 +1181,8 @@ export class CodeSnippetDisplay extends React.Component<
11811181 onClick : ( event : React . MouseEvent < HTMLElement , MouseEvent > ) : void => {
11821182 showMoreOptions ( { body : new OptionsHandler ( this , codeSnippet ) } ) ;
11831183 this . _setOptionsPosition ( event ) ;
1184- }
1185- }
1184+ } ,
1185+ } ,
11861186 ] ;
11871187 return (
11881188 < div
@@ -1220,7 +1220,7 @@ export class CodeSnippetDisplay extends React.Component<
12201220 id : id ,
12211221 title : displayName ,
12221222 body : new PreviewHandler ( ) ,
1223- codeSnippet : codeSnippet
1223+ codeSnippet : codeSnippet ,
12241224 } ,
12251225 this . props . editorServices
12261226 ) ;
@@ -1236,7 +1236,7 @@ export class CodeSnippetDisplay extends React.Component<
12361236 { this . boldNameOnSearch ( id , language , name ) }
12371237 </ div >
12381238 < div className = { ACTION_BUTTONS_WRAPPER_CLASS } id = { id . toString ( ) } >
1239- { actionButtons . map ( btn => {
1239+ { actionButtons . map ( ( btn ) => {
12401240 return (
12411241 < button
12421242 key = { btn . title }
@@ -1288,7 +1288,7 @@ export class CodeSnippetDisplay extends React.Component<
12881288 matchIndices : [ ] ,
12891289 searchValue : '' ,
12901290 filterTags : [ ] ,
1291- searchOptions : [ ]
1291+ searchOptions : [ ] ,
12921292 } ;
12931293 }
12941294
@@ -1298,7 +1298,7 @@ export class CodeSnippetDisplay extends React.Component<
12981298 matchIndices : prevState . matchIndices ,
12991299 searchValue : prevState . searchValue ,
13001300 filterTags : prevState . filterTags ,
1301- searchOptions : prevState . searchOptions
1301+ searchOptions : prevState . searchOptions ,
13021302 } ;
13031303 }
13041304 return null ;
@@ -1315,7 +1315,7 @@ export class CodeSnippetDisplay extends React.Component<
13151315 } [ ] = [ ] ;
13161316 if ( searchValue !== '' ) {
13171317 // language, title, code
1318- filteredSnippets . forEach ( snippet => {
1318+ filteredSnippets . forEach ( ( snippet ) => {
13191319 const matchResult = StringExt . matchSumOfSquares (
13201320 (
13211321 snippet . language +
@@ -1329,28 +1329,28 @@ export class CodeSnippetDisplay extends React.Component<
13291329 matchResults . push ( matchResult ) ;
13301330 filteredSnippetsScore . push ( {
13311331 score : matchResult . score ,
1332- snippet : snippet
1332+ snippet : snippet ,
13331333 } ) ;
13341334 }
13351335 } ) ;
13361336
13371337 // sort snippets by its score
13381338 filteredSnippetsScore . sort ( ( a , b ) => a . score - b . score ) ;
13391339 const newFilteredSnippets : ICodeSnippet [ ] = [ ] ;
1340- filteredSnippetsScore . forEach ( snippetScore =>
1340+ filteredSnippetsScore . forEach ( ( snippetScore ) =>
13411341 newFilteredSnippets . push ( snippetScore . snippet )
13421342 ) ;
13431343 filteredSnippets = newFilteredSnippets ;
13441344
13451345 // sort the matchResults by its score
13461346 matchResults . sort ( ( a , b ) => a . score - b . score ) ;
1347- matchResults . forEach ( res => matchIndices . push ( res . indices ) ) ;
1347+ matchResults . forEach ( ( res ) => matchIndices . push ( res . indices ) ) ;
13481348 }
13491349
13501350 if ( filterTags . length !== 0 ) {
13511351 const newMatchIndices = matchIndices . slice ( ) ;
13521352 filteredSnippets = filteredSnippets . filter ( ( codeSnippet , id ) => {
1353- return filterTags . some ( tag => {
1353+ return filterTags . some ( ( tag ) => {
13541354 if ( codeSnippet . tags ) {
13551355 if (
13561356 codeSnippet . tags . includes ( tag ) ||
@@ -1374,15 +1374,15 @@ export class CodeSnippetDisplay extends React.Component<
13741374 codeSnippets : filteredSnippets ,
13751375 matchIndices : matchIndices ,
13761376 searchValue : searchValue ,
1377- filterTags : filterTags
1377+ filterTags : filterTags ,
13781378 } ,
13791379 ( ) => {
13801380 console . log ( 'snippets filtered' ) ;
13811381 }
13821382 ) ;
13831383 } ;
13841384
1385- getActiveTags ( ) : [ string [ ] , string [ ] ] {
1385+ getActiveTags ( ) : string [ ] [ ] {
13861386 const tags : string [ ] = [ ] ;
13871387 const languages : string [ ] = [ ] ;
13881388 for ( const codeSnippet of this . props . codeSnippets ) {
@@ -1407,10 +1407,10 @@ export class CodeSnippetDisplay extends React.Component<
14071407 buttons : [
14081408 Dialog . okButton ( {
14091409 label : 'Delete' ,
1410- displayType : 'warn'
1410+ displayType : 'warn' ,
14111411 } ) ,
1412- Dialog . cancelButton ( )
1413- ]
1412+ Dialog . cancelButton ( ) ,
1413+ ] ,
14141414 } ) . then ( ( response : any ) : void => {
14151415 if ( response . button . accept ) {
14161416 const widgetId = `${ CODE_SNIPPET_EDITOR } -${ codeSnippet . id } ` ;
@@ -1513,7 +1513,7 @@ export class CodeSnippetDisplay extends React.Component<
15131513 id : codeSnippet . id ,
15141514 selectedTags : codeSnippet . tags ,
15151515 allTags : allTags ,
1516- fromScratch : false
1516+ fromScratch : false ,
15171517 } ) ;
15181518 this . removeOptionsNode ( ) ;
15191519 } ;
@@ -1544,7 +1544,7 @@ export class CodeSnippetDisplay extends React.Component<
15441544
15451545 setSearchOptions ( selectedOptions : string [ ] ) : void {
15461546 this . setState ( {
1547- searchOptions : selectedOptions
1547+ searchOptions : selectedOptions ,
15481548 } ) ;
15491549 }
15501550
@@ -1564,7 +1564,7 @@ export class CodeSnippetDisplay extends React.Component<
15641564 id : this . state . codeSnippets . length ,
15651565 selectedTags : [ ] ,
15661566 allTags : this . getActiveTags ( ) [ 0 ] ,
1567- fromScratch : true
1567+ fromScratch : true ,
15681568 } ) ;
15691569 } }
15701570 >
0 commit comments