@@ -25,7 +25,7 @@ import {
2525 addIcon ,
2626 pythonIcon ,
2727 fileIcon ,
28- rKernelIcon
28+ rKernelIcon ,
2929} from '@jupyterlab/ui-components' ;
3030import { CodeEditor , IEditorServices } from '@jupyterlab/codeeditor' ;
3131import * as nbformat from '@jupyterlab/nbformat' ;
@@ -35,7 +35,7 @@ import {
3535 CodeCellModel ,
3636 ICodeCellModel ,
3737 MarkdownCell ,
38- CodeCell
38+ CodeCell ,
3939} from '@jupyterlab/cells' ;
4040
4141import { Widget } from '@lumino/widgets' ;
@@ -92,7 +92,7 @@ import {
9292 sbtIcon ,
9393 rustIcon ,
9494 qsharpIcon ,
95- sasIcon
95+ sasIcon ,
9696} from './CodeSnippetLanguages' ;
9797
9898/**
@@ -141,7 +141,7 @@ const JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';
141141 */
142142const moreOptionsIcon = new LabIcon ( {
143143 name : 'custom-ui-components:moreOptions' ,
144- svgstr : moreSVGstr
144+ svgstr : moreSVGstr ,
145145} ) ;
146146
147147/**
@@ -183,7 +183,7 @@ export class CodeSnippetDisplay extends React.Component<
183183 codeSnippets : props . codeSnippets ,
184184 matchIndices : [ ] ,
185185 searchValue : '' ,
186- filterTags : [ ]
186+ filterTags : [ ] ,
187187 } ;
188188 this . _drag = null ;
189189 this . _dragData = null ;
@@ -278,7 +278,7 @@ export class CodeSnippetDisplay extends React.Component<
278278 '" is incompatible with ' +
279279 editorLanguage +
280280 '. Continue?' ,
281- buttons : [ Dialog . cancelButton ( ) , Dialog . okButton ( ) ]
281+ buttons : [ Dialog . cancelButton ( ) , Dialog . okButton ( ) ] ,
282282 } ) ;
283283 } ;
284284
@@ -287,7 +287,7 @@ export class CodeSnippetDisplay extends React.Component<
287287 return showDialog ( {
288288 title : 'Error' ,
289289 body : errMsg ,
290- buttons : [ Dialog . okButton ( ) ]
290+ buttons : [ Dialog . okButton ( ) ] ,
291291 } ) ;
292292 } ;
293293
@@ -412,7 +412,7 @@ export class CodeSnippetDisplay extends React.Component<
412412 await showDialog ( {
413413 title : 'Duplicate Name of Code Snippet' ,
414414 body : < p > { `"${ newName } " already exists.` } </ p > ,
415- buttons : [ Dialog . okButton ( { label : 'Dismiss' } ) ]
415+ buttons : [ Dialog . okButton ( { label : 'Dismiss' } ) ] ,
416416 } ) ;
417417 return ;
418418 }
@@ -464,7 +464,7 @@ export class CodeSnippetDisplay extends React.Component<
464464 this . _dragData = {
465465 pressX : event . clientX ,
466466 pressY : event . clientY ,
467- dragImage : target . nextSibling . firstChild . cloneNode ( true ) as HTMLElement
467+ dragImage : target . nextSibling . firstChild . cloneNode ( true ) as HTMLElement ,
468468 } ;
469469
470470 const dragImageTextColor = getComputedStyle ( document . body ) . getPropertyValue (
@@ -563,7 +563,7 @@ export class CodeSnippetDisplay extends React.Component<
563563 dragImage : dragImage ,
564564 supportedActions : 'copy-move' ,
565565 proposedAction : 'copy' ,
566- source : this
566+ source : this ,
567567 } ) ;
568568
569569 this . _drag . mimeData . setData ( JUPYTER_CELL_MIME , selected ) ;
@@ -1142,8 +1142,8 @@ export class CodeSnippetDisplay extends React.Component<
11421142 ) : void => {
11431143 showMoreOptions ( { body : new OptionsHandler ( this , codeSnippet ) } ) ;
11441144 this . _setOptionsPosition ( event ) ;
1145- }
1146- }
1145+ } ,
1146+ } ,
11471147 ] ;
11481148 return (
11491149 < div
@@ -1173,7 +1173,7 @@ export class CodeSnippetDisplay extends React.Component<
11731173 id : id ,
11741174 title : displayName ,
11751175 body : new PreviewHandler ( ) ,
1176- codeSnippet : codeSnippet
1176+ codeSnippet : codeSnippet ,
11771177 } ,
11781178 this . props . editorServices
11791179 ) ;
@@ -1189,7 +1189,7 @@ export class CodeSnippetDisplay extends React.Component<
11891189 { this . boldNameOnSearch ( id , language , name ) }
11901190 </ div >
11911191 < div className = { ACTION_BUTTONS_WRAPPER_CLASS } id = { id . toString ( ) } >
1192- { actionButtons . map ( btn => {
1192+ { actionButtons . map ( ( btn ) => {
11931193 return (
11941194 < button
11951195 key = { btn . title }
@@ -1234,7 +1234,7 @@ export class CodeSnippetDisplay extends React.Component<
12341234 codeSnippets : nextProps . codeSnippetManager . snippets ,
12351235 matchIndices : [ ] ,
12361236 searchValue : '' ,
1237- filterTags : [ ]
1237+ filterTags : [ ] ,
12381238 } ;
12391239 }
12401240
@@ -1254,7 +1254,7 @@ export class CodeSnippetDisplay extends React.Component<
12541254 codeSnippets : prevState . codeSnippets ,
12551255 matchIndices : prevState . matchIndices ,
12561256 searchValue : prevState . searchValue ,
1257- filterTags : prevState . filterTags
1257+ filterTags : prevState . filterTags ,
12581258 } ;
12591259 }
12601260 return null ;
@@ -1270,7 +1270,7 @@ export class CodeSnippetDisplay extends React.Component<
12701270 snippet : ICodeSnippet ;
12711271 } [ ] = [ ] ;
12721272 if ( searchValue !== '' ) {
1273- filteredSnippets . forEach ( snippet => {
1273+ filteredSnippets . forEach ( ( snippet ) => {
12741274 const matchResult = StringExt . matchSumOfSquares (
12751275 ( snippet . language + snippet . name ) . toLowerCase ( ) ,
12761276 searchValue . replace ( ' ' , '' ) . toLowerCase ( )
@@ -1280,29 +1280,29 @@ export class CodeSnippetDisplay extends React.Component<
12801280 matchResults . push ( matchResult ) ;
12811281 filteredSnippetsScore . push ( {
12821282 score : matchResult . score ,
1283- snippet : snippet
1283+ snippet : snippet ,
12841284 } ) ;
12851285 }
12861286 } ) ;
12871287
12881288 // sort snippets by its score
12891289 filteredSnippetsScore . sort ( ( a , b ) => a . score - b . score ) ;
12901290 const newFilteredSnippets : ICodeSnippet [ ] = [ ] ;
1291- filteredSnippetsScore . forEach ( snippetScore =>
1291+ filteredSnippetsScore . forEach ( ( snippetScore ) =>
12921292 newFilteredSnippets . push ( snippetScore . snippet )
12931293 ) ;
12941294 filteredSnippets = newFilteredSnippets ;
12951295
12961296 // sort the matchResults by its score
12971297 matchResults . sort ( ( a , b ) => a . score - b . score ) ;
1298- matchResults . forEach ( res => matchIndices . push ( res . indices ) ) ;
1298+ matchResults . forEach ( ( res ) => matchIndices . push ( res . indices ) ) ;
12991299 }
13001300
13011301 // filter with tags
13021302 if ( filterTags . length !== 0 ) {
13031303 const newMatchIndices = matchIndices . slice ( ) ;
13041304 filteredSnippets = filteredSnippets . filter ( ( codeSnippet , id ) => {
1305- return filterTags . some ( tag => {
1305+ return filterTags . some ( ( tag ) => {
13061306 if ( codeSnippet . tags ) {
13071307 if ( codeSnippet . tags . includes ( tag ) ) {
13081308 return true ;
@@ -1323,7 +1323,7 @@ export class CodeSnippetDisplay extends React.Component<
13231323 codeSnippets : filteredSnippets ,
13241324 matchIndices : matchIndices ,
13251325 searchValue : searchValue ,
1326- filterTags : filterTags
1326+ filterTags : filterTags ,
13271327 } ,
13281328 ( ) => {
13291329 console . log ( 'snippets filtered' ) ;
@@ -1352,10 +1352,10 @@ export class CodeSnippetDisplay extends React.Component<
13521352 buttons : [
13531353 Dialog . okButton ( {
13541354 label : 'Delete' ,
1355- displayType : 'warn'
1355+ displayType : 'warn' ,
13561356 } ) ,
1357- Dialog . cancelButton ( )
1358- ]
1357+ Dialog . cancelButton ( ) ,
1358+ ] ,
13591359 } ) . then ( ( response : any ) : void => {
13601360 if ( response . button . accept ) {
13611361 const widgetId = `${ CODE_SNIPPET_EDITOR } -${ codeSnippet . id } ` ;
@@ -1447,7 +1447,7 @@ export class CodeSnippetDisplay extends React.Component<
14471447 id : codeSnippet . id ,
14481448 selectedTags : codeSnippet . tags ,
14491449 allTags : allTags ,
1450- fromScratch : false
1450+ fromScratch : false ,
14511451 } ) ;
14521452 this . removeOptionsNode ( ) ;
14531453 } ;
@@ -1481,7 +1481,7 @@ export class CodeSnippetDisplay extends React.Component<
14811481 code : [ ] ,
14821482 id : 0 ,
14831483 allTags : this . getActiveTags ( ) ,
1484- fromScratch : true
1484+ fromScratch : true ,
14851485 } ) ;
14861486 } }
14871487 >
0 commit comments