Browse Source

Fix more eslint errors.

Jason Grout 5 years ago
parent
commit
a8c279b488

+ 2 - 2
packages/documentsearch/src/providers/genericsearchprovider.ts

@@ -198,8 +198,8 @@ export class GenericSearchProvider implements ISearchProvider<Widget> {
     matches.forEach((match, idx) => {
       // This may be changed when this is a subprovider :/
       match.index = idx;
-      // @ts-ignore
-      match.matchesIndex = idx;
+      // TODO: matchesIndex is declared as readonly. Why are we setting it here?
+      (match as any).matchesIndex = idx;
     });
     if (!this.isSubProvider && matches.length > 0) {
       this._currentMatch = matches[0];

+ 1 - 1
packages/outputarea/src/model.ts

@@ -451,7 +451,7 @@ namespace Private {
     do {
       txt = tmp;
       // Cancel out anything-but-newline followed by backspace
-      tmp = txt.replace(/[^\n]\x08/gm, '');
+      tmp = txt.replace(/[^\n]\x08/gm, ''); // eslint-disable-line no-control-regex
     } while (tmp.length < txt.length);
     return txt;
   }

+ 1 - 1
packages/rendermime/src/renderers.ts

@@ -985,7 +985,7 @@ namespace Private {
    * This is supposed to have the same behavior as nbconvert.filters.ansi2html()
    */
   export function ansiSpan(str: string): string {
-    const ansiRe = /\x1b\[(.*?)([@-~])/g;
+    const ansiRe = /\x1b\[(.*?)([@-~])/g; // eslint-disable-line no-control-regex
     let fg: number | Array<number> = [];
     let bg: number | Array<number> = [];
     let bold = false;

+ 0 - 1
packages/services/test/target.ts

@@ -7,7 +7,6 @@ import 'jest';
 declare let define: any;
 
 if (typeof define !== 'function') {
-  // @ts-ignore
   const define = require('amdefine')(module); // eslint-disable-line
 }
 

+ 1 - 1
packages/terminal/src/widget.ts

@@ -47,7 +47,7 @@ export class Terminal extends Widget implements ITerminal.ITerminal {
     // Initialize settings.
     this._options = { ...ITerminal.defaultOptions, ...options };
 
-    const { initialCommand, theme, ...other } = this._options;
+    const { theme, ...other } = this._options;
     const xtermOptions = {
       theme: Private.getXTermTheme(theme),
       ...other