' +
@@ -335,7 +333,7 @@ export class Diff extends MonacoPane
{
private id: number;
private ourCompilers: Record;
@@ -134,7 +132,7 @@ export class Editor extends MonacoPane {
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
decoration.filter &&
this.currentLanguage?.name &&
!decoration.filter.includes(this.currentLanguage.name.toLowerCase())
@@ -258,7 +250,6 @@ export class Editor extends MonacoPane, dragConfig) => {
this.container.layoutManager
.createDragSource(dragSource, dragConfig)
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error: createDragSource returns not void
._dragListener.on('dragStart', () => {
paneAdderDropdown.dropdown('toggle');
@@ -653,7 +642,6 @@ export class Editor extends MonacoPane 0) {
trees[0].multifileService.includeByEditorId(this.id).then(() => {
trees[0].refresh();
@@ -683,7 +671,7 @@ export class Editor extends MonacoPane {
element.hide();
}, 2000);
this.nothingCtrlSTimes = undefined;
@@ -710,7 +698,7 @@ export class Editor extends MonacoPane {
- return String.fromCharCode(parseInt(v, 16));
+ return String.fromCharCode(Number.parseInt(v, 16));
}),
).toString('base64');
}
@@ -726,13 +714,11 @@ export class Editor extends MonacoPane c.id === compilerId,
);
if (glCompiler) {
@@ -1087,10 +1073,8 @@ export class Editor extends MonacoPane c.id === compilerId,
);
if (glCompiler) {
const selected = options.compilers.find(compiler => {
@@ -1442,9 +1422,8 @@ export class Editor extends MonacoPane 0) {
if (obj.tag.file) {
if (this.id !== trees[0].multifileService.getEditorIdByFilename(obj.tag.file)) {
@@ -1497,7 +1475,7 @@ export class Editor extends MonacoPane ({
range: new monaco.Range(tag.startLineNumber, tag.startColumn, tag.startLineNumber + 1, 1),
options: {
isWholeLine: false,
inlineClassName: 'error-code',
},
- };
- }, this);
+ }),
+ this,
+ );
this.updateDecorations();
}
@@ -1602,7 +1581,6 @@ export class Editor extends MonacoPane {
@@ -1894,11 +1871,11 @@ export class Editor extends MonacoPane {
return result.execResult.stdout;
}
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
return result.stdout || [];
}
@@ -571,7 +570,6 @@ export class Executor extends Pane {
return result.execResult.stderr;
}
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
return result.stderr || [];
}
@@ -706,7 +704,7 @@ export class Executor extends Pane {
group: artifact.type,
collapseSimilar: false,
dismissTime: 10000,
- onBeforeShow: function (elem) {
+ onBeforeShow: elem => {
elem.find('#download_link').on('click', () => {
const tmstr = Date.now();
const live_url = 'https://static.ce-cdn.net/speedscope/index.html';
@@ -1005,7 +1003,6 @@ export class Executor extends Pane {
this.eventHub.on('initialised', this.undefer, this);
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (MutationObserver !== undefined) {
new MutationObserver(this.resize.bind(this)).observe(this.execStdinField[0], {
attributes: true,
@@ -1106,7 +1103,7 @@ export class Executor extends Pane {
// We can't immediately close as an outer loop somewhere in GoldenLayout is iterating over
// the hierarchy. We can't modify while it's being iterated over.
this.close();
- _.defer(function (self) {
+ _.defer(self => {
self.container.close();
}, this);
}
@@ -1156,9 +1153,8 @@ export class Executor extends Pane {
getLinkHint(): string {
if (this.sourceTreeId) {
return 'Tree #' + this.sourceTreeId;
- } else {
- return 'Editor #' + this.sourceEditorId;
}
+ return 'Editor #' + this.sourceEditorId;
}
override getPaneName(): string {
@@ -1214,9 +1210,8 @@ export class Executor extends Pane {
if (status.code === 4) return 'Compiling';
if (status.didExecute) {
return 'Program compiled & executed';
- } else {
- return 'Program could not be executed';
}
+ return 'Program could not be executed';
}
private color(status: CompilationStatus) {
@@ -1265,7 +1260,7 @@ export class Executor extends Pane {
this.currentLangId = newLangId;
// Store the current selected stuff to come back to it later in the same session (Not state stored!)
this.infoByLang[oldLangId] = {
- compiler: this.compiler && this.compiler.id ? this.compiler.id : options.defaultCompiler[oldLangId],
+ compiler: this.compiler?.id ? this.compiler.id : options.defaultCompiler[oldLangId],
options: this.options,
execArgs: this.executionArguments,
execStdin: this.executionStdin,
diff --git a/static/panes/flags-view.ts b/static/panes/flags-view.ts
index f6254400f..c92798992 100644
--- a/static/panes/flags-view.ts
+++ b/static/panes/flags-view.ts
@@ -22,18 +22,18 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
+import {Container} from 'golden-layout';
import $ from 'jquery';
import * as monaco from 'monaco-editor';
import _, {Cancelable} from 'underscore';
-import {MonacoPane} from './pane.js';
-import * as monacoConfig from '../monaco-config.js';
-import {FlagsViewState} from './flags-view.interfaces.js';
-import {Container} from 'golden-layout';
-import {MonacoPaneState} from './pane.interfaces.js';
-import {Settings, SiteSettings} from '../settings.js';
-import {Hub} from '../hub.js';
-import {CompilerInfo} from '../compiler.interfaces.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
+import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import * as monacoConfig from '../monaco-config.js';
+import {Settings, SiteSettings} from '../settings.js';
+import {FlagsViewState} from './flags-view.interfaces.js';
+import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
export class Flags extends MonacoPane {
debouncedEmitChange: (e: boolean) => void = () => {};
diff --git a/static/panes/gccdump-view.ts b/static/panes/gccdump-view.ts
index 90ebbff94..fe44749cf 100644
--- a/static/panes/gccdump-view.ts
+++ b/static/panes/gccdump-view.ts
@@ -33,13 +33,13 @@ import TomSelect from 'tom-select';
import {Toggles} from '../widgets/toggles.js';
import * as monaco from 'monaco-editor';
-import {MonacoPane} from './pane.js';
-import {MonacoPaneState, PaneState} from './pane.interfaces.js';
import * as monacoConfig from '../monaco-config.js';
+import {MonacoPaneState, PaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {GccDumpFiltersState, GccDumpViewState, GccDumpViewSelectedPass} from './gccdump-view.interfaces.js';
+import {GccDumpFiltersState, GccDumpViewSelectedPass, GccDumpViewState} from './gccdump-view.interfaces.js';
-import {unwrap, assert} from '../assert.js';
+import {assert, unwrap} from '../assert.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
@@ -323,7 +323,7 @@ export class GccDump extends MonacoPane {
self.container.close();
}, this);
}
diff --git a/static/panes/gnatdebug-view.ts b/static/panes/gnatdebug-view.ts
index 34a3f0bae..66ac033eb 100644
--- a/static/panes/gnatdebug-view.ts
+++ b/static/panes/gnatdebug-view.ts
@@ -22,20 +22,20 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
import {GnatDebugState} from './gnatdebug-view.interfaces.js';
import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
+import {unwrap} from '../assert.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
-import {unwrap} from '../assert.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class GnatDebug extends MonacoPane {
constructor(hub: Hub, container: Container, state: GnatDebugState & MonacoPaneState) {
diff --git a/static/panes/gnatdebugtree-view.ts b/static/panes/gnatdebugtree-view.ts
index 07fe70b76..94be08d29 100644
--- a/static/panes/gnatdebugtree-view.ts
+++ b/static/panes/gnatdebugtree-view.ts
@@ -22,20 +22,20 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
import {GnatDebugTreeState} from './gnatdebugtree-view.interfaces.js';
import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
-import {CompilerInfo} from '../compiler.interfaces.js';
-import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {unwrap} from '../assert.js';
+import {CompilationResult} from '../compilation/compilation.interfaces.js';
+import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class GnatDebugTree extends MonacoPane {
constructor(hub: Hub, container: Container, state: GnatDebugTreeState & MonacoPaneState) {
diff --git a/static/panes/haskellcmm-view.ts b/static/panes/haskellcmm-view.ts
index 6fba666c1..9cad8504f 100644
--- a/static/panes/haskellcmm-view.ts
+++ b/static/panes/haskellcmm-view.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
-import {MonacoPaneState} from './pane.interfaces.js';
import {HaskellCmmState} from './haskellcmm-view.interfaces.js';
+import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class HaskellCmm extends MonacoPane {
constructor(hub: Hub, container: Container, state: HaskellCmmState & MonacoPaneState) {
diff --git a/static/panes/haskellcore-view.ts b/static/panes/haskellcore-view.ts
index e4cdcb7ee..66e163f4d 100644
--- a/static/panes/haskellcore-view.ts
+++ b/static/panes/haskellcore-view.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
-import {MonacoPaneState} from './pane.interfaces.js';
import {HaskellCoreState} from './haskellcore-view.interfaces.js';
+import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class HaskellCore extends MonacoPane {
constructor(hub: Hub, container: Container, state: HaskellCoreState & MonacoPaneState) {
diff --git a/static/panes/haskellstg-view.ts b/static/panes/haskellstg-view.ts
index 6af6e9e71..8128d264f 100644
--- a/static/panes/haskellstg-view.ts
+++ b/static/panes/haskellstg-view.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
-import {MonacoPaneState} from './pane.interfaces.js';
import {HaskellStgState} from './haskellstg-view.interfaces.js';
+import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class HaskellStg extends MonacoPane {
constructor(hub: Hub, container: Container, state: HaskellStgState & MonacoPaneState) {
diff --git a/static/panes/ir-view.ts b/static/panes/ir-view.ts
index f7ac38ea9..58afeebbd 100644
--- a/static/panes/ir-view.ts
+++ b/static/panes/ir-view.ts
@@ -22,32 +22,32 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
import {editor} from 'monaco-editor';
import IEditorMouseEvent = editor.IEditorMouseEvent;
-import {MonacoPane} from './pane.js';
import {IrState} from './ir-view.interfaces.js';
import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {extendConfig} from '../monaco-config.js';
import {applyColours} from '../colour.js';
+import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
-import * as Components from '../components.js';
import {unwrap} from '../assert.js';
+import * as Components from '../components.js';
+import {Hub} from '../hub.js';
import {Toggles} from '../widgets/toggles.js';
import {LLVMIrBackendOptions} from '../../types/compilation/ir.interfaces.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
-import {Compiler} from './compiler.js';
-import {Alert} from '../widgets/alert.js';
import {SentryCapture} from '../sentry.js';
+import {Alert} from '../widgets/alert.js';
+import {Compiler} from './compiler.js';
export class Ir extends MonacoPane {
private linkedFadeTimeoutId: NodeJS.Timeout | null = null;
diff --git a/static/panes/opt-pipeline.ts b/static/panes/opt-pipeline.ts
index e68ebbd2b..cdb9f2ecd 100644
--- a/static/panes/opt-pipeline.ts
+++ b/static/panes/opt-pipeline.ts
@@ -22,32 +22,32 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import * as sifter from '@orchidjs/sifter';
import {Container} from 'golden-layout';
-import TomSelect from 'tom-select';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
import scrollIntoView from 'scroll-into-view-if-needed';
+import TomSelect from 'tom-select';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
import {OptPipelineViewState} from './opt-pipeline.interfaces.js';
import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
-import {extendConfig} from '../monaco-config.js';
import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
import * as utils from '../utils.js';
import {Toggles} from '../widgets/toggles.js';
+import {escapeHTML} from '../../shared/common-utils.js';
+import {unwrap, unwrapString} from '../assert.js';
+import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {
OptPipelineBackendOptions,
OptPipelineOutput,
OptPipelineResults,
} from '../compilation/opt-pipeline-output.interfaces.js';
-import {unwrap, unwrapString} from '../assert.js';
-import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
-import {escapeHTML} from '../../shared/common-utils.js';
const MIN_SIDEBAR_WIDTH = 100;
@@ -94,7 +94,7 @@ export class OptPipeline extends MonacoPane {
- state.sidebarWidth = parseInt(
+ state.sidebarWidth = Number.parseInt(
unwrap(document.defaultView).getComputedStyle(this.passesColumn.get()[0]).width,
10,
);
@@ -248,7 +248,7 @@ export class OptPipeline extends MonacoPane= passes.length) {
@@ -487,7 +487,7 @@ export class OptPipeline extends MonacoPane {
return (
- /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */ // TODO
!!rem.DebugLoc &&
((rem.optType === 'Missed' && includeMissed) ||
(rem.optType === 'Passed' && includePassed) ||
@@ -210,7 +209,7 @@ export class Opt extends MonacoPane {
if (line.optClass !== 'None') {
optDecorations.push({
- range: new monaco.Range(lineNum + 1, 1, lineNum + 1, Infinity),
+ range: new monaco.Range(lineNum + 1, 1, lineNum + 1, Number.POSITIVE_INFINITY),
options: {
isWholeLine: true,
after: {
diff --git a/static/panes/output.ts b/static/panes/output.ts
index 6b67445f7..552513caa 100644
--- a/static/panes/output.ts
+++ b/static/panes/output.ts
@@ -22,20 +22,20 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import {Toggles} from '../widgets/toggles.js';
-import _ from 'underscore';
-import {Pane} from './pane.js';
-import {updateAndCalcTopBarHeight} from '../utils.js';
import {Container} from 'golden-layout';
-import {PaneState} from './pane.interfaces.js';
-import {Hub} from '../hub.js';
-import * as AnsiToHtml from '../ansi-to-html.js';
-import {OutputState} from './output.interfaces.js';
-import {FontScale} from '../widgets/fontscale.js';
+import $ from 'jquery';
+import _ from 'underscore';
+import {escapeHTML} from '../../shared/common-utils.js';
import {CompilationResult} from '../../types/compilation/compilation.interfaces.js';
import {CompilerInfo} from '../../types/compiler.interfaces.js';
-import {escapeHTML} from '../../shared/common-utils.js';
+import * as AnsiToHtml from '../ansi-to-html.js';
+import {Hub} from '../hub.js';
+import {updateAndCalcTopBarHeight} from '../utils.js';
+import {FontScale} from '../widgets/fontscale.js';
+import {Toggles} from '../widgets/toggles.js';
+import {OutputState} from './output.interfaces.js';
+import {PaneState} from './pane.interfaces.js';
+import {Pane} from './pane.js';
function makeAnsiToHtml(color?: string) {
return new AnsiToHtml.Filter({
@@ -334,7 +334,7 @@ export class Output extends Pane {
protected sendPrintData() {
this.eventHub.emit(
'printdata',
- // eslint-disable-next-line no-useless-concat
+
`Output Pane: ${escapeHTML(this.getPaneName())}
` + `${this.contentRoot.html()}`,
);
}
diff --git a/static/panes/pane.ts b/static/panes/pane.ts
index a54646bf6..df260f3cf 100644
--- a/static/panes/pane.ts
+++ b/static/panes/pane.ts
@@ -22,23 +22,23 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import _ from 'underscore';
import {Container} from 'golden-layout';
import * as monaco from 'monaco-editor';
+import _ from 'underscore';
import {MonacoPaneState, PaneCompilerState, PaneState} from './pane.interfaces.js';
-import {FontScale} from '../widgets/fontscale.js';
import {Settings, SiteSettings} from '../settings.js';
import * as utils from '../utils.js';
+import {FontScale} from '../widgets/fontscale.js';
-import {PaneRenaming} from '../widgets/pane-renaming.js';
+import {escapeHTML} from '../../shared/common-utils.js';
+import {unwrap} from '../assert.js';
+import {CompilationResult} from '../compilation/compilation.interfaces.js';
+import {CompilerInfo} from '../compiler.interfaces.js';
import {EventHub} from '../event-hub.js';
import {Hub} from '../hub.js';
-import {unwrap} from '../assert.js';
-import {CompilerInfo} from '../compiler.interfaces.js';
-import {CompilationResult} from '../compilation/compilation.interfaces.js';
-import {escapeHTML} from '../../shared/common-utils.js';
+import {PaneRenaming} from '../widgets/pane-renaming.js';
/**
* Basic container for a tool pane in Compiler Explorer.
@@ -210,9 +210,8 @@ export abstract class Pane {
const {compilerName, editorId, treeId, compilerId} = this.compilerInfo;
if (editorId) {
return `${compilerName} (Editor #${editorId}, Compiler #${compilerId})`;
- } else {
- return `${compilerName} (Tree #${treeId}, Compiler #${compilerId})`;
}
+ return `${compilerName} (Tree #${treeId}, Compiler #${compilerId})`;
}
/** Get name for the pane */
@@ -336,7 +335,7 @@ export abstract class MonacoPane extends Pan
/** Initialize standard lifecycle hooks */
protected override registerStandardCallbacks(): void {
super.registerStandardCallbacks();
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
+
if (this.fontScale) this.fontScale.on('change', this.updateState.bind(this));
this.eventHub.on('broadcastFontScale', (scale: number) => {
this.fontScale.setScale(scale);
diff --git a/static/panes/pp-view.ts b/static/panes/pp-view.ts
index d7abce5a0..1843de68d 100644
--- a/static/panes/pp-view.ts
+++ b/static/panes/pp-view.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
+import {Container} from 'golden-layout';
import $ from 'jquery';
-import {Toggles} from '../widgets/toggles.js';
import * as monaco from 'monaco-editor';
import _ from 'underscore';
-import {MonacoPane} from './pane.js';
-import * as monacoConfig from '../monaco-config.js';
-import {PPViewState} from './pp-view.interfaces.js';
-import {Container} from 'golden-layout';
-import {MonacoPaneState} from './pane.interfaces.js';
-import {Hub} from '../hub.js';
import {unwrap} from '../assert.js';
import {CompilationResult, PPOutput} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import * as monacoConfig from '../monaco-config.js';
+import {Toggles} from '../widgets/toggles.js';
+import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
+import {PPViewState} from './pp-view.interfaces.js';
export class PP extends MonacoPane {
options: any;
@@ -185,7 +185,7 @@ export class PP extends MonacoPane {
self.container.close();
}, this);
}
diff --git a/static/panes/rusthir-view.ts b/static/panes/rusthir-view.ts
index 04c293592..fa969b322 100644
--- a/static/panes/rusthir-view.ts
+++ b/static/panes/rusthir-view.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
import {RustHirState} from './rusthir-view.interfaces.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class RustHir extends MonacoPane {
constructor(hub: Hub, container: Container, state: RustHirState & MonacoPaneState) {
diff --git a/static/panes/rustmacroexp-view.ts b/static/panes/rustmacroexp-view.ts
index 285d98409..42b962240 100644
--- a/static/panes/rustmacroexp-view.ts
+++ b/static/panes/rustmacroexp-view.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
import {RustMacroExpState} from './rustmacroexp-view.interfaces.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class RustMacroExp extends MonacoPane {
constructor(hub: Hub, container: Container, state: RustMacroExpState & MonacoPaneState) {
diff --git a/static/panes/rustmir-view.ts b/static/panes/rustmir-view.ts
index d298657c3..a9ffcb02a 100644
--- a/static/panes/rustmir-view.ts
+++ b/static/panes/rustmir-view.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
-import {MonacoPane} from './pane.js';
import {MonacoPaneState} from './pane.interfaces.js';
+import {MonacoPane} from './pane.js';
import {RustMirState} from './rustmir-view.interfaces.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
export class RustMir extends MonacoPane {
constructor(hub: Hub, container: Container, state: RustMirState & MonacoPaneState) {
diff --git a/static/panes/stack-usage-view.ts b/static/panes/stack-usage-view.ts
index a49f2dae7..55a76b3fe 100644
--- a/static/panes/stack-usage-view.ts
+++ b/static/panes/stack-usage-view.ts
@@ -22,20 +22,20 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import _ from 'underscore';
-import * as monaco from 'monaco-editor';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import * as monaco from 'monaco-editor';
+import _ from 'underscore';
+import {MonacoPaneState} from './pane.interfaces.js';
import {MonacoPane} from './pane.js';
import {StackUsageState, suCodeEntry} from './stack-usage-view.interfaces.js';
-import {MonacoPaneState} from './pane.interfaces.js';
-import {extendConfig} from '../monaco-config.js';
-import {Hub} from '../hub.js';
+import {unwrap} from '../assert.js';
import {CompilationResult} from '../compilation/compilation.interfaces.js';
import {CompilerInfo} from '../compiler.interfaces.js';
-import {unwrap} from '../assert.js';
+import {Hub} from '../hub.js';
+import {extendConfig} from '../monaco-config.js';
import {SentryCapture} from '../sentry.js';
type SuClass = 'None' | 'static' | 'dynamic' | 'dynamic,bounded';
@@ -153,7 +153,6 @@ export class StackUsage extends MonacoPane {
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!line.suClass) {
// Shouldn't be possible, temp SentryCapture here to investigate
// https://compiler-explorer.sentry.io/issues/5374209222/
@@ -165,7 +164,7 @@ export class StackUsage extends MonacoPane {
_toolId: string;
@@ -138,7 +138,7 @@ export class ToolInputView extends MonacoPane {
self.container.close();
}, this);
}
@@ -147,7 +147,7 @@ export class ToolInputView extends MonacoPane {
self.container.close();
}, this);
}
@@ -158,7 +158,7 @@ export class ToolInputView extends MonacoPane {
self.container.close();
}, this);
}
diff --git a/static/panes/tool.ts b/static/panes/tool.ts
index e8195088c..c02903ffa 100644
--- a/static/panes/tool.ts
+++ b/static/panes/tool.ts
@@ -22,26 +22,26 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import _ from 'underscore';
+import * as fileSaver from 'file-saver';
+import {Container} from 'golden-layout';
import $ from 'jquery';
-import * as AnsiToHtml from '../ansi-to-html.js';
-import {Toggles} from '../widgets/toggles.js';
-import * as Components from '../components.js';
import * as monaco from 'monaco-editor';
+import _ from 'underscore';
+import * as AnsiToHtml from '../ansi-to-html.js';
+import {unwrap, unwrapString} from '../assert.js';
+import {CompilationResult} from '../compilation/compilation.interfaces.js';
+import {CompilerService} from '../compiler-service.js';
+import {CompilerInfo} from '../compiler.interfaces.js';
+import {ComponentConfig, NewToolSettings, PopulatedToolInputViewState, ToolState} from '../components.interfaces.js';
+import * as Components from '../components.js';
+import {Hub} from '../hub.js';
+import {LanguageKey} from '../languages.interfaces.js';
import * as monacoConfig from '../monaco-config.js';
import {options as ceoptions} from '../options.js';
import * as utils from '../utils.js';
-import * as fileSaver from 'file-saver';
-import {MonacoPane} from './pane.js';
-import {Hub} from '../hub.js';
-import {Container} from 'golden-layout';
+import {Toggles} from '../widgets/toggles.js';
import {MonacoPaneState} from './pane.interfaces.js';
-import {CompilerService} from '../compiler-service.js';
-import {ComponentConfig, NewToolSettings, PopulatedToolInputViewState, ToolState} from '../components.interfaces.js';
-import {unwrap, unwrapString} from '../assert.js';
-import {CompilationResult} from '../compilation/compilation.interfaces.js';
-import {CompilerInfo} from '../compiler.interfaces.js';
-import {LanguageKey} from '../languages.interfaces.js';
+import {MonacoPane} from './pane.js';
function makeAnsiToHtml(color?: string) {
return new AnsiToHtml.Filter({
@@ -253,9 +253,8 @@ export class Tool extends MonacoPane tool.id === this.toolId);
- } else if (result.result && result.result.tools) {
+ } else if (result.result?.tools) {
toolResult = _.find(result.result.tools, tool => tool.id === this.toolId);
}
diff --git a/static/panes/tree.ts b/static/panes/tree.ts
index 90b40919b..a7962cd52 100644
--- a/static/panes/tree.ts
+++ b/static/panes/tree.ts
@@ -22,26 +22,26 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import {MultifileFile, MultifileService, MultifileServiceState} from '../multifile-service.js';
-import {LineColouring} from '../line-colouring.js';
-import * as utils from '../utils.js';
-import {Settings, SiteSettings} from '../settings.js';
-import {PaneRenaming} from '../widgets/pane-renaming.js';
-import {Hub} from '../hub.js';
-import {EventHub} from '../event-hub.js';
-import {Alert} from '../widgets/alert.js';
-import * as Components from '../components.js';
-import TomSelect from 'tom-select';
-import {Toggles} from '../widgets/toggles.js';
-import {options} from '../options.js';
import {saveAs} from 'file-saver';
import {Container} from 'golden-layout';
+import $ from 'jquery';
+import TomSelect from 'tom-select';
import _ from 'underscore';
-import {assert, unwrap, unwrapString} from '../assert.js';
import {escapeHTML} from '../../shared/common-utils.js';
+import {assert, unwrap, unwrapString} from '../assert.js';
+import * as Components from '../components.js';
+import {EventHub} from '../event-hub.js';
+import {Hub} from '../hub.js';
import {LanguageKey} from '../languages.interfaces.js';
+import {LineColouring} from '../line-colouring.js';
+import {MultifileFile, MultifileService, MultifileServiceState} from '../multifile-service.js';
+import {options} from '../options.js';
import {ResultLine} from '../resultline/resultline.interfaces.js';
+import {Settings, SiteSettings} from '../settings.js';
+import * as utils from '../utils.js';
+import {Alert} from '../widgets/alert.js';
+import {PaneRenaming} from '../widgets/pane-renaming.js';
+import {Toggles} from '../widgets/toggles.js';
const languages = options.languages;
@@ -269,7 +269,7 @@ export class Tree {
private sendChangesToAllEditors() {
for (const compilerId in this.ourCompilers) {
- this.sendCompilerChangesToEditor(parseInt(compilerId));
+ this.sendCompilerChangesToEditor(Number.parseInt(compilerId));
}
}
@@ -500,7 +500,6 @@ export class Tree {
await this.multifileService.saveProjectToZipfile(Tree.triggerSaveAs.bind(this));
});
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
const loadProjectFromFile = this.domRoot.find('.load-project-from-file') as JQuery;
loadProjectFromFile.on('change', async e => {
const files = e.target.files;
@@ -648,7 +647,7 @@ export class Tree {
this.lineColouring.clear();
for (const [compilerId, asm] of Object.entries(this.asmByCompiler)) {
- this.lineColouring.addFromAssembly(parseInt(compilerId), asm);
+ this.lineColouring.addFromAssembly(Number.parseInt(compilerId), asm);
}
this.lineColouring.calculate();
@@ -658,7 +657,7 @@ export class Tree {
private updateColours() {
for (const compilerId in this.ourCompilers) {
- const id: number = parseInt(compilerId);
+ const id: number = Number.parseInt(compilerId);
this.eventHub.emit(
'coloursForCompiler',
id,
@@ -679,7 +678,7 @@ export class Tree {
private updateColoursNone() {
for (const compilerId in this.ourCompilers) {
- this.eventHub.emit('coloursForCompiler', parseInt(compilerId), {}, this.settings.colourScheme);
+ this.eventHub.emit('coloursForCompiler', Number.parseInt(compilerId), {}, this.settings.colourScheme);
}
this.multifileService.forEachOpenFile((file: MultifileFile) => {
@@ -695,10 +694,9 @@ export class Tree {
// todo: parse errors and warnings and relate them to lines in the code
// note: requires info about the filename, do we currently have that?
- // eslint-disable-next-line max-len
// {"text":"/tmp/compiler-explorer-compiler2021428-7126-95g4xc.zfo8p/example.cpp:4:21: error: expected ‘;’ before ‘}’ token"}
- if (result.result && result.result.asm) {
+ if (result.result?.asm) {
this.asmByCompiler[compilerId] = result.result.asm;
} else {
this.asmByCompiler[compilerId] = result.asm;
@@ -738,7 +736,6 @@ export class Tree {
return `Tree #${this.id}`;
}
- // eslint-disable-next-line no-unused-vars
updateTitle() {
const name = this.paneName ? this.paneName : this.getPaneName();
this.container.setTitle(escapeHTML(name));
diff --git a/static/presentation.ts b/static/presentation.ts
index 679413460..97c27f61f 100644
--- a/static/presentation.ts
+++ b/static/presentation.ts
@@ -27,7 +27,7 @@ import {localStorage} from './local.js';
const CURRENT_SLIDE_KEY = 'presentationCurrentSlide';
export class Presentation {
- public currentSlide = parseInt(localStorage.get(CURRENT_SLIDE_KEY, '0'));
+ public currentSlide = Number.parseInt(localStorage.get(CURRENT_SLIDE_KEY, '0'));
public originalLocation = window.location.href;
public constructor(public maxSlides: number) {}
diff --git a/static/print-view.ts b/static/print-view.ts
index d241e0152..fed6a633a 100644
--- a/static/print-view.ts
+++ b/static/print-view.ts
@@ -26,10 +26,10 @@ import $ from 'jquery';
import * as monaco from 'monaco-editor';
-import {Hub} from './hub';
-import {Themer, themes} from './themes';
import {unwrap} from './assert';
import {EventHub} from './event-hub';
+import {Hub} from './hub';
+import {Themer, themes} from './themes';
export class Printerinator {
printview: JQuery;
diff --git a/static/quick-fixes-handler.ts b/static/quick-fixes-handler.ts
index a1a740c99..7a7465dbf 100644
--- a/static/quick-fixes-handler.ts
+++ b/static/quick-fixes-handler.ts
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import _ from 'underscore';
import * as monaco from 'monaco-editor';
+import _ from 'underscore';
type RegisteredQuickFixes = {
compilerId: number;
@@ -88,14 +88,13 @@ function provide(
}),
),
),
- dispose: function () {},
- };
- } else {
- return {
- actions: [],
- dispose: function () {},
+ dispose: () => {},
};
}
+ return {
+ actions: [],
+ dispose: () => {},
+ };
}
export function unregister(compilerId: number): void {
diff --git a/static/real-dark.ts b/static/real-dark.ts
index 710e8a087..e2bfddebb 100644
--- a/static/real-dark.ts
+++ b/static/real-dark.ts
@@ -1,7 +1,7 @@
import $ from 'jquery';
-import {Settings} from './settings.js';
import {Hub} from './hub.js';
+import {Settings} from './settings.js';
import * as local from './local.js';
diff --git a/static/rison.ts b/static/rison.ts
index 2a52e6d25..7ddc43a73 100644
--- a/static/rison.ts
+++ b/static/rison.ts
@@ -105,14 +105,14 @@ class Encoders {
return '!n';
}
static number(x: number) {
- if (!isFinite(x)) return '!n';
+ if (!Number.isFinite(x)) return '!n';
// strip '+' out of exponent, '-' is ok though
return String(x).replace(/\+/, '');
}
static object(x: Record | null) {
if (x) {
// because typeof null === 'object'
- if (x instanceof Array) {
+ if (Array.isArray(x)) {
return Encoders.array(x);
}
@@ -132,7 +132,7 @@ class Encoders {
if (b) {
a[a.length] = ',';
}
- k = isNaN(parseInt(i)) ? Encoders.string(i) : Encoders.number(parseInt(i));
+ k = Number.isNaN(Number.parseInt(i)) ? Encoders.string(i) : Encoders.number(Number.parseInt(i));
a.push(k, ':', v);
b = true;
}
@@ -147,7 +147,7 @@ class Encoders {
if (id_ok.test(x)) return x;
- x = x.replace(/(['!])/g, function (a, b) {
+ x = x.replace(/(['!])/g, (a, b) => {
if (string_table[b as keyof typeof string_table]) return '!' + b;
return b;
});
@@ -192,7 +192,7 @@ export function encode(v: JSONValue | (JSONValue & {toJSON?: () => string})) {
*
*/
export function encode_object(v: JSONValue) {
- if (typeof v != 'object' || v === null || v instanceof Array)
+ if (typeof v != 'object' || v === null || Array.isArray(v))
throw new Error('rison.encode_object expects an object argument');
const r = unwrap(encode_table[typeof v](v));
return r.substring(1, r.length - 1);
@@ -203,7 +203,7 @@ export function encode_object(v: JSONValue) {
*
*/
export function encode_array(v: JSONValue) {
- if (!(v instanceof Array)) throw new Error('rison.encode_array expects an array argument');
+ if (!Array.isArray(v)) throw new Error('rison.encode_array expects an array argument');
const r = unwrap(encode_table[typeof v](v));
return r.substring(2, r.length - 1);
}
@@ -256,15 +256,7 @@ export function decode_array(r: string) {
return decode('!(' + r + ')');
}
-// prettier-ignore
-export type JSONValue =
- | string
- | number
- | boolean
- | null
- | undefined
- | {[x: string]: JSONValue}
- | Array;
+export type JSONValue = string | number | boolean | null | undefined | {[x: string]: JSONValue} | Array;
class Parser {
/**
@@ -295,9 +287,9 @@ class Parser {
if (!c) return this.error('"!" at end of input');
const x = Parser.bangs[c as keyof typeof Parser.bangs];
if (typeof x == 'function') {
- // eslint-disable-next-line no-useless-call
return x.call(null, this);
- } else if (typeof x === 'undefined') {
+ }
+ if (typeof x === 'undefined') {
return this.error('unknown literal: "!' + c + '"');
}
return x;
@@ -388,7 +380,6 @@ class Parser {
this.string = str;
this.index = 0;
const value = this.readValue();
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (this.next()) this.error("unable to parse string as rison: '" + encode(str) + "'");
return value;
}
diff --git a/static/sentry.ts b/static/sentry.ts
index dd4fcf54f..7255e6ef6 100644
--- a/static/sentry.ts
+++ b/static/sentry.ts
@@ -29,8 +29,8 @@ import {options} from './options.js';
import * as Sentry from '@sentry/browser';
import GoldenLayout from 'golden-layout';
-import {serialiseState} from './url.js';
import {SiteSettings} from './settings.js';
+import {serialiseState} from './url.js';
let layout: GoldenLayout;
let allowSendCode: boolean;
@@ -52,7 +52,6 @@ export function setSentryLayout(l: GoldenLayout) {
}
event.extra['full_url'] = window.location.origin + window.httpRoot + '#' + serialiseState(config);
} catch (e) {
- // eslint-disable-next-line no-console
console.log('Error adding full_url to Sentry event', e);
}
return event;
@@ -87,13 +86,13 @@ export function SentryCapture(value: unknown, context?: string) {
}
Sentry.captureException(value);
} else {
- const e = new Error(); // eslint-disable-line unicorn/error-message
+ const e = new Error();
const trace = parse(e);
Sentry.captureMessage(
- `Non-Error capture:\n` +
+ 'Non-Error capture:\n' +
(context ? `Context: ${context}\n` : '') +
`Data:\n${JSON.stringify(value)}\n` +
- `Trace:\n` +
+ 'Trace:\n' +
trace
.map(frame => `${frame.functionName} ${frame.fileName}:${frame.lineNumber}:${frame.columnNumber}`)
.join('\n'),
diff --git a/static/settings.ts b/static/settings.ts
index 845e6c096..4dda404fc 100644
--- a/static/settings.ts
+++ b/static/settings.ts
@@ -23,14 +23,14 @@
// POSSIBILITY OF SUCH DAMAGE.
import $ from 'jquery';
-import {options} from './options.js';
-import * as colour from './colour.js';
-import {themes, Themes} from './themes.js';
-import {AppTheme, ColourScheme, ColourSchemeInfo} from './colour.js';
-import {Hub} from './hub.js';
-import {EventHub} from './event-hub.js';
-import {keys, isString} from '../shared/common-utils.js';
+import {isString, keys} from '../shared/common-utils.js';
import {assert, unwrapString} from './assert.js';
+import * as colour from './colour.js';
+import {AppTheme, ColourScheme, ColourSchemeInfo} from './colour.js';
+import {EventHub} from './event-hub.js';
+import {Hub} from './hub.js';
+import {options} from './options.js';
+import {Themes, themes} from './themes.js';
import {LanguageKey} from '../types/languages.interfaces.js';
import {localStorage} from './local.js';
@@ -125,9 +125,6 @@ class Select extends BaseSetting {
}
class NumericSelect extends Select {
- constructor(elem: JQuery, name: string, populate: {label: string; desc: string}[]) {
- super(elem, name, populate);
- }
override getUi(): number {
return Number(this.val());
}
@@ -169,7 +166,7 @@ class Slider extends BaseSetting {
}
override getUi(): number {
- return parseInt(this.val()?.toString() ?? '0');
+ return Number.parseInt(this.val()?.toString() ?? '0');
}
private updateDisplay() {
@@ -193,7 +190,7 @@ class Numeric extends BaseSetting {
}
override getUi(): number {
- return this.clampValue(parseInt(this.val()?.toString() ?? '0'));
+ return this.clampValue(Number.parseInt(this.val()?.toString() ?? '0'));
}
override putUi(value: number) {
@@ -381,7 +378,7 @@ export class Settings {
).elem;
defaultFontScaleSelector.on('change', e => {
assert(e.target instanceof HTMLSelectElement);
- this.eventHub.emit('broadcastFontScale', parseInt(e.target.value));
+ this.eventHub.emit('broadcastFontScale', Number.parseInt(e.target.value));
});
const formats: FormatBase[] = ['Google', 'LLVM', 'Mozilla', 'Chromium', 'WebKit', 'Microsoft', 'GNU'];
@@ -508,12 +505,10 @@ export class Settings {
// Small check to make sure we aren't getting something completely unexpected, like a string[] or number
assert(
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
isString(oldScheme) || oldScheme === undefined || oldScheme == null,
'Unexpected value received from colourSchemeSelect.val()',
);
assert(
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
isString(newTheme) || newTheme === undefined || newTheme == null,
'Unexpected value received from colourSchemeSelect.val()',
);
diff --git a/static/sharing.ts b/static/sharing.ts
index 4c2fe498a..6717692af 100644
--- a/static/sharing.ts
+++ b/static/sharing.ts
@@ -22,25 +22,25 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
-import GoldenLayout from 'golden-layout';
-import _ from 'underscore';
import ClipboardJS from 'clipboard';
+import GoldenLayout from 'golden-layout';
+import $ from 'jquery';
+import _ from 'underscore';
import {sessionThenLocalStorage} from './local.js';
-import * as url from './url.js';
import {options} from './options.js';
+import * as url from './url.js';
import ClickEvent = JQuery.ClickEvent;
import TriggeredEvent = JQuery.TriggeredEvent;
-import {Settings, SiteSettings} from './settings.js';
import {SentryCapture} from './sentry.js';
+import {Settings, SiteSettings} from './settings.js';
const cloneDeep = require('lodash.clonedeep');
enum LinkType {
- Short,
- Full,
- Embed,
+ Short = 0,
+ Full = 1,
+ Embed = 2,
}
const shareServices = {
@@ -177,7 +177,6 @@ export class Sharing {
}
private onOpenModalPane(event: TriggeredEvent): void {
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore The property is added by bootstrap
const button = $(event.relatedTarget);
const currentBind = Sharing.bindToLinkType(button.data('bind'));
diff --git a/static/tests/motd.ts b/static/tests/motd.ts
index b5352df6b..c14ac8d12 100644
--- a/static/tests/motd.ts
+++ b/static/tests/motd.ts
@@ -22,7 +22,6 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-// eslint-disable-next-line @typescript-eslint/triple-slash-reference
///
import {isValidAd} from '../motd.js';
diff --git a/static/themes.ts b/static/themes.ts
index 6145d0c5c..45cc26f42 100644
--- a/static/themes.ts
+++ b/static/themes.ts
@@ -22,12 +22,12 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
+import GoldenLayout from 'golden-layout';
import $ from 'jquery';
import {editor} from 'monaco-editor';
-import {SiteSettings} from './settings.js';
-import GoldenLayout from 'golden-layout';
import {isString} from '../shared/common-utils.js';
import {options} from './options.js';
+import {SiteSettings} from './settings.js';
export type Themes = 'default' | 'dark' | 'darkplus' | 'pink' | 'onedark' | 'real-dark' | 'system';
diff --git a/static/url.ts b/static/url.ts
index 818fff096..b6feff94d 100644
--- a/static/url.ts
+++ b/static/url.ts
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import _ from 'underscore';
import GoldenLayout from 'golden-layout';
+import _ from 'underscore';
const lzstring = require('lz-string');
const Components = require('./components');
@@ -88,7 +88,7 @@ export function deserialiseState(stateText: string): any {
let exception;
try {
state = unrisonify(stateText);
- if (state && state.z) {
+ if (state?.z) {
const data = lzstring.decompressFromBase64(state.z);
// If lzstring fails to decompress this it'll return an empty string rather than throwing an error
if (data === '') {
@@ -121,7 +121,6 @@ export function serialiseState(stateText: any): string {
const MinimalSavings = 0.2; // at least this ratio smaller
if (compressed.length < uncompressed.length * (1.0 - MinimalSavings)) {
return compressed;
- } else {
- return uncompressed;
}
+ return uncompressed;
}
diff --git a/static/utils.ts b/static/utils.ts
index b041f82e6..e9fc5b094 100644
--- a/static/utils.ts
+++ b/static/utils.ts
@@ -67,9 +67,8 @@ export function formatISODate(dt: Date, full = false) {
':' +
min.padStart(2, '0')
);
- } else {
- return dt.getUTCFullYear() + '-' + month.padStart(2, '0') + '-' + day.padStart(2, '0');
}
+ return dt.getUTCFullYear() + '-' + month.padStart(2, '0') + '-' + day.padStart(2, '0');
}
const hexLike = /^(#?[$]|0x)([0-9a-fA-F]+)$/;
@@ -96,9 +95,8 @@ export function getNumericToolTip(value: string, digitSeparator?: string): strin
const numberString = num.toString(base).toUpperCase();
if (digitSeparator !== undefined) {
return addDigitSeparator(numberString, digitSeparator, chunkSize);
- } else {
- return numberString;
}
+ return numberString;
};
const numericValue = parseNumericValue(value);
if (numericValue === null) return null;
diff --git a/static/widgets/compiler-overrides.ts b/static/widgets/compiler-overrides.ts
index afae239e5..a0d31258b 100644
--- a/static/widgets/compiler-overrides.ts
+++ b/static/widgets/compiler-overrides.ts
@@ -29,10 +29,10 @@ import {
ConfiguredOverrides,
EnvVarOverrides,
} from '../../types/compilation/compiler-overrides.interfaces.js';
-import {options} from '../options.js';
-import {CompilerInfo} from '../compiler.interfaces.js';
import {assert, unwrap} from '../assert.js';
+import {CompilerInfo} from '../compiler.interfaces.js';
import {localStorage} from '../local.js';
+import {options} from '../options.js';
const FAV_OVERRIDES_STORE_KEY = 'favoverrides';
@@ -114,9 +114,8 @@ export class CompilerOverridesWidget {
name: env.substring(0, firstEqPos),
value: env.substring(firstEqPos + 1),
};
- } else {
- return false;
}
+ return false;
})
.filter(Boolean) as EnvVarOverrides;
}
@@ -249,7 +248,7 @@ export class CompilerOverridesWidget {
const container = this.popupDomRoot.find('.possible-overrides');
container.html('');
- if (this.compiler && this.compiler.possibleOverrides) {
+ if (this.compiler?.possibleOverrides) {
for (const possibleOverride of this.compiler.possibleOverrides) {
const card = $('#possible-override').children().clone();
card.find('.override-name').html(possibleOverride.display_title);
@@ -355,7 +354,7 @@ export class CompilerOverridesWidget {
setDefaults() {
this.configured = [];
- if (this.compiler && this.compiler.possibleOverrides) {
+ if (this.compiler?.possibleOverrides) {
for (const ov of this.compiler.possibleOverrides) {
if (ov.name !== CompilerOverrideType.env && ov.default) {
this.configured.push({
@@ -376,9 +375,8 @@ export class CompilerOverridesWidget {
get(): ConfiguredOverrides | undefined {
if (this.compiler) {
return this.configured;
- } else {
- return undefined;
}
+ return undefined;
}
private getFavorites(): FavOverrides {
diff --git a/static/widgets/compiler-picker-popup.ts b/static/widgets/compiler-picker-popup.ts
index 692f58d98..25d1ed847 100644
--- a/static/widgets/compiler-picker-popup.ts
+++ b/static/widgets/compiler-picker-popup.ts
@@ -26,12 +26,12 @@ import $ from 'jquery';
import * as sifter from '@orchidjs/sifter';
-import {CompilerInfo} from '../../types/compiler.interfaces';
import {escapeHTML, intersection, remove, unique} from '../../shared/common-utils';
+import {CompilerInfo} from '../../types/compiler.interfaces';
import {unwrap, unwrapString} from '../assert';
-import {CompilerPicker} from './compiler-picker';
import {CompilerService} from '../compiler-service';
import {highlight} from '../highlight';
+import {CompilerPicker} from './compiler-picker';
export class CompilerPickerPopup {
modal: JQuery;
@@ -91,7 +91,7 @@ export class CompilerPickerPopup {
.map(isa => `${escapeHTML(isa)}`),
);
// get available compiler types
- const compilerTypes = compilers.map(compiler => compiler.compilerCategories ?? ['other']).flat();
+ const compilerTypes = compilers.flatMap(compiler => compiler.compilerCategories ?? ['other']);
this.compilerTypes.empty();
this.compilerTypes.append(
...unique(compilerTypes)
diff --git a/static/widgets/compiler-picker.ts b/static/widgets/compiler-picker.ts
index 7d77017cd..d7c347bc8 100644
--- a/static/widgets/compiler-picker.ts
+++ b/static/widgets/compiler-picker.ts
@@ -25,13 +25,13 @@
import $ from 'jquery';
import TomSelect from 'tom-select';
-import {EventHub} from '../event-hub.js';
-import {Hub} from '../hub.js';
-import {CompilerService} from '../compiler-service.js';
import {CompilerInfo} from '../../types/compiler.interfaces.js';
import {unwrap} from '../assert.js';
-import {CompilerPickerPopup} from './compiler-picker-popup.js';
+import {CompilerService} from '../compiler-service.js';
+import {EventHub} from '../event-hub.js';
+import {Hub} from '../hub.js';
import {localStorage} from '../local.js';
+import {CompilerPickerPopup} from './compiler-picker-popup.js';
type Favourites = {
[compilerId: string]: boolean;
@@ -119,7 +119,7 @@ export class CompilerPicker {
onChange: (val: string) => {
// TODO(jeremy-rifkin) I don't think this can be undefined.
// Typing here needs improvement later anyway.
- /* eslint-disable-next-line @typescript-eslint/no-unnecessary-condition */
+
if (val) {
const compilerId = val;
this.onCompilerChange(compilerId);
diff --git a/static/widgets/fontscale.ts b/static/widgets/fontscale.ts
index 79046f734..1baddfb7a 100644
--- a/static/widgets/fontscale.ts
+++ b/static/widgets/fontscale.ts
@@ -22,11 +22,11 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
import EventEmitter from 'events';
+import $ from 'jquery';
+import {editor} from 'monaco-editor';
import {options} from '../options.js';
import {Settings} from '../settings.js';
-import {editor} from 'monaco-editor';
import IEditor = editor.IEditor;
import {FontScaleState} from './fontscale.interfaces.js';
diff --git a/static/widgets/history-widget.ts b/static/widgets/history-widget.ts
index 1eadd3e5e..36f55036d 100644
--- a/static/widgets/history-widget.ts
+++ b/static/widgets/history-widget.ts
@@ -23,9 +23,9 @@
// POSSIBILITY OF SUCH DAMAGE.
import $ from 'jquery';
-import {pluck} from 'underscore';
-import {sortedList, HistoryEntry, EditorSource} from '../history.js';
import {editor} from 'monaco-editor';
+import {pluck} from 'underscore';
+import {EditorSource, HistoryEntry, sortedList} from '../history.js';
import ITextModel = editor.ITextModel;
import {unwrap} from '../assert.js';
diff --git a/static/widgets/libs-widget.ts b/static/widgets/libs-widget.ts
index 456db01c0..b27471c31 100644
--- a/static/widgets/libs-widget.ts
+++ b/static/widgets/libs-widget.ts
@@ -23,13 +23,13 @@
// POSSIBILITY OF SUCH DAMAGE.
import $ from 'jquery';
-import {options} from '../options.js';
-import {Library, LibraryVersion} from '../options.interfaces.js';
-import {Lib, WidgetState} from './libs-widget.interfaces.js';
import {unwrapString} from '../assert.js';
import {localStorage} from '../local.js';
-import {Alert} from './alert';
+import {Library, LibraryVersion} from '../options.interfaces.js';
+import {options} from '../options.js';
import {SentryCapture} from '../sentry.js';
+import {Alert} from './alert';
+import {Lib, WidgetState} from './libs-widget.interfaces.js';
const FAV_LIBS_STORE_KEY = 'favlibs';
const c_default_compiler_non_id = '_default_';
@@ -68,7 +68,6 @@ type LibraryAnnotationDetail = {
class LibraryAnnotations {
private all: Record = {};
- constructor() {}
private async get(library: string, version: string): Promise {
const libver = `${library}/${version}`;
@@ -117,9 +116,11 @@ function getCompilerName(compilerId: string): string {
function shortenMachineName(name: string): string {
if (name === 'Advanced Micro Devices X86-64') {
return 'amd64';
- } else if (name === 'Intel 80386') {
+ }
+ if (name === 'Intel 80386') {
return '386';
- } else if (name === '') {
+ }
+ if (name === '') {
return 'default target';
}
@@ -400,18 +401,18 @@ export class LibsWidget {
if (info.annotation.commithash) {
const machineName = shortenMachineName(info.annotation.machine || '');
const stdlib = info.buildinfo.libcxx;
- if (url && url.startsWith('https://github.com/')) {
+ if (url?.startsWith('https://github.com/')) {
// this is a bit of a hack because we don't store the git repo in our properties files
libInfoText +=
`Binary for ${machineName} (${stdlib}) based on commit: ` +
`` +
info.annotation.commithash +
- ``;
+ '';
} else {
libInfoText +=
`Binary for ${machineName} (${stdlib}) based on commit: ` +
info.annotation.commithash +
- ``;
+ '';
}
}
}
@@ -510,9 +511,8 @@ export class LibsWidget {
if (semver !== '-') {
this.loadBuildInfoIntoPopup(popupId, lookupname, lookupversion, lib.url);
return ``;
- } else {
- return ``;
}
+ return ``;
},
template: popoverTemplate,
customClass: 'library-info-popover',
@@ -695,16 +695,15 @@ export class LibsWidget {
// If it's already a key, return it directly
if (versionId in lib.versions) {
return versionId;
- } else {
- // Else, look in each version and see if it has the id as an alias
- for (const verId in lib.versions) {
- const version = lib.versions[verId];
- if (version.alias.includes(versionId)) {
- return verId;
- }
- }
- return null;
}
+ // Else, look in each version and see if it has the id as an alias
+ for (const verId in lib.versions) {
+ const version = lib.versions[verId];
+ if (version.alias.includes(versionId)) {
+ return verId;
+ }
+ }
+ return null;
}
getLibInfoById(libId: string): Library | undefined {
@@ -714,9 +713,8 @@ export class LibsWidget {
libId in this.availableLibs[this.currentLangId][this.currentCompilerId]
) {
return this.availableLibs[this.currentLangId][this.currentCompilerId][libId];
- } else {
- return undefined;
}
+ return undefined;
}
markLibrary(name: string, versionId: string, used: boolean) {
diff --git a/static/widgets/load-save.ts b/static/widgets/load-save.ts
index 4ef87e336..3ce617252 100644
--- a/static/widgets/load-save.ts
+++ b/static/widgets/load-save.ts
@@ -22,15 +22,15 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
+import {saveAs} from 'file-saver';
import $ from 'jquery';
import _ from 'underscore';
-import {saveAs} from 'file-saver';
-import {Alert} from './alert.js';
-import {Language} from '../../types/languages.interfaces.js';
-import {unwrap, unwrapString} from '../assert.js';
import {escapeHTML} from '../../shared/common-utils.js';
-import {localStorage} from '../local.js';
+import {Language} from '../../types/languages.interfaces.js';
import {SourceApiEntry} from '../../types/source.interfaces';
+import {unwrap, unwrapString} from '../assert.js';
+import {localStorage} from '../local.js';
+import {Alert} from './alert.js';
const history = require('../history');
diff --git a/static/widgets/pane-renaming.ts b/static/widgets/pane-renaming.ts
index f7ea37310..adae64eee 100644
--- a/static/widgets/pane-renaming.ts
+++ b/static/widgets/pane-renaming.ts
@@ -22,10 +22,10 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import $ from 'jquery';
import {Tab} from 'golden-layout';
-import {Alert} from './alert.js';
+import $ from 'jquery';
import {Hub} from '../hub.js';
+import {Alert} from './alert.js';
export class PaneRenaming {
private pane: any;
diff --git a/static/widgets/runtime-tools.ts b/static/widgets/runtime-tools.ts
index d0886876a..24c9cc3e7 100644
--- a/static/widgets/runtime-tools.ts
+++ b/static/widgets/runtime-tools.ts
@@ -23,10 +23,6 @@
// POSSIBILITY OF SUCH DAMAGE.
import $ from 'jquery';
-import {options} from '../options.js';
-import {CompilerInfo} from '../compiler.interfaces.js';
-import {assert} from '../assert.js';
-import {localStorage} from '../local.js';
import {
ConfiguredRuntimeTool,
ConfiguredRuntimeTools,
@@ -35,6 +31,10 @@ import {
RuntimeToolOptions,
RuntimeToolType,
} from '../../types/execution/execution.interfaces.js';
+import {assert} from '../assert.js';
+import {CompilerInfo} from '../compiler.interfaces.js';
+import {localStorage} from '../local.js';
+import {options} from '../options.js';
const FAV_RUNTIMETOOLS_STORE_KEY = 'favruntimetools';
@@ -121,9 +121,8 @@ export class RuntimeToolsWidget {
name: env.substring(0, firstEqPos),
value: env.substring(firstEqPos + 1),
};
- } else {
- return false;
}
+ return false;
})
.filter(Boolean) as RuntimeToolOptions;
}
@@ -356,9 +355,8 @@ export class RuntimeToolsWidget {
get(): ConfiguredRuntimeTools | undefined {
if (this.compiler) {
return this.configured;
- } else {
- return undefined;
}
+ return undefined;
}
private getFavorites(): FavRuntimeTools {
diff --git a/static/widgets/site-templates-widget.ts b/static/widgets/site-templates-widget.ts
index 17dcc8ec2..6073edbd0 100644
--- a/static/widgets/site-templates-widget.ts
+++ b/static/widgets/site-templates-widget.ts
@@ -24,14 +24,14 @@
import $ from 'jquery';
+import GoldenLayout from 'golden-layout';
+import {escapeHTML} from '../../shared/common-utils.js';
import {SiteTemplateResponse, UserSiteTemplate} from '../../types/features/site-templates.interfaces.js';
import {assert, unwrap, unwrapString} from '../assert.js';
+import {localStorage} from '../local.js';
import {Settings} from '../settings.js';
import * as url from '../url.js';
-import GoldenLayout from 'golden-layout';
import {Alert} from './alert.js';
-import {escapeHTML} from '../../shared/common-utils.js';
-import {localStorage} from '../local.js';
class SiteTemplatesWidget {
private readonly modal: JQuery;
@@ -88,15 +88,14 @@ class SiteTemplatesWidget {
if (!theme) {
// apparently this can happen
return 'default';
- } else if (theme === 'system') {
+ }
+ if (theme === 'system') {
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
return 'dark';
- } else {
- return 'default';
}
- } else {
- return theme;
+ return 'default';
}
+ return theme;
}
getAsset(name: string) {
return this.siteTemplateScreenshots(`./${name}.${this.getCurrentTheme()}.png`);
@@ -111,10 +110,10 @@ class SiteTemplatesWidget {
const userTemplatesList = $('#site-user-templates-list');
userTemplatesList.empty();
if (Object.entries(userTemplates).length === 0) {
- userTemplatesList.append(`Nothing here yet`);
+ userTemplatesList.append('Nothing here yet');
} else {
for (const [id, {title, data}] of Object.entries(userTemplates)) {
- const li = $(``);
+ const li = $('');
$(`${escapeHTML(title)}
`)
.attr('data-data', data)
.appendTo(li);
@@ -138,9 +137,9 @@ class SiteTemplatesWidget {
for (const [name, data] of Object.entries(templatesConfig.templates)) {
// Note: Trusting the server-provided data attribute
siteTemplatesList.append(
- `` +
+ '' +
`${escapeHTML(name)}
` +
- ``,
+ '',
);
}
for (const titleDiv of $('#site-user-templates-list li .title, #site-templates-list li .title')) {
@@ -154,7 +153,6 @@ class SiteTemplatesWidget {
this.img.src = this.getAsset(name);
} else {
this.img.src =
- // eslint-disable-next-line max-len
'https://placehold.jp/30/4b4b4b/ffffff/1000x800.png?text=we%27ll+support+screenshot+generation+for+user+templates+some+day';
}
},
diff --git a/static/widgets/timing-info-widget.ts b/static/widgets/timing-info-widget.ts
index e739b8d6d..dbfcaf0b1 100644
--- a/static/widgets/timing-info-widget.ts
+++ b/static/widgets/timing-info-widget.ts
@@ -22,19 +22,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
+import {Chart, ChartData, defaults} from 'chart.js';
import $ from 'jquery';
import {Settings} from '../settings.js';
-import {Chart, ChartData, defaults} from 'chart.js';
import 'chart.js/auto';
+import {isString} from '../../shared/common-utils.js';
import {CompilationResult} from '../../types/compilation/compilation.interfaces.js';
import {unwrap} from '../assert.js';
-import {isString} from '../../shared/common-utils.js';
type Data = ChartData<'bar', number[], string> & {steps: number};
function pushTimingInfo(data: Data, step: string, time: number | string) {
if (typeof time === 'string') {
- time = parseInt(time, 10);
+ time = Number.parseInt(time, 10);
}
data.labels?.push(`${step} (${Math.round(time * 100) / 100}ms)`);
data.datasets[0].data.push(time);
@@ -89,7 +89,7 @@ function initializeChartDataFromResult(compileResult: CompilationResult, totalTi
pushTimingInfo(data, 'Download binary from cache', unwrap(compileResult.execTime));
}
- if (compileResult.execResult && compileResult.execResult.execTime) {
+ if (compileResult.execResult?.execTime) {
pushTimingInfo(data, 'Execution', compileResult.execResult.execTime);
}
} else {
@@ -107,7 +107,7 @@ function initializeChartDataFromResult(compileResult: CompilationResult, totalTi
}
if (compileResult.didExecute) {
- if (compileResult.execResult && compileResult.execResult.execTime) {
+ if (compileResult.execResult?.execTime) {
pushTimingInfo(data, 'Execution', compileResult.execResult.execTime);
} else {
pushTimingInfo(data, 'Execution', unwrap(compileResult.execTime));
@@ -146,7 +146,7 @@ function displayData(data: Data) {
// eslint thinks "This assertion is unnecessary since it does not change the type of the expression"
// Typescript disagrees.
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
+
const canvas = $('') as JQuery;
chartDiv.append(canvas);
diff --git a/test/.eslintrc.yml b/test/.eslintrc.yml
deleted file mode 100644
index df9a7c22c..000000000
--- a/test/.eslintrc.yml
+++ /dev/null
@@ -1,16 +0,0 @@
----
-root: false
-rules:
- comma-dangle:
- - error
- - arrays: always-multiline
- objects: always-multiline
- imports: always-multiline
- exports: always-multiline
- functions: always-multiline
- max-len: off
- max-statements: off
- n/no-unpublished-import: off
- unicorn/no-empty-file: off
- unicorn/no-await-expression-member: off
- '@typescript-eslint/no-non-null-assertion': off
diff --git a/test/base-compiler-tests.ts b/test/base-compiler-tests.ts
index 91690adcf..893ccc7b0 100644
--- a/test/base-compiler-tests.ts
+++ b/test/base-compiler-tests.ts
@@ -38,10 +38,10 @@ import {CompilerInfo} from '../types/compiler.interfaces.js';
import {
fs,
+ path,
makeCompilationEnvironment,
makeFakeCompilerInfo,
makeFakeParseFiltersAndOutputOptions,
- path,
shouldExist,
} from './utils.js';
@@ -105,7 +105,7 @@ describe('Basic compiler invariants', () => {
const newConfig: Partial = {...info, explicitVersion: '123'};
const forcedVersionCompiler = new BaseCompiler(newConfig as CompilerInfo, ce);
const result = await forcedVersionCompiler.getVersion();
- expect(result && result.stdout).toEqual('123');
+ expect(result?.stdout).toEqual('123');
});
});
diff --git a/test/cache-tests.ts b/test/cache-tests.ts
index 8ff79951f..90b0c057f 100644
--- a/test/cache-tests.ts
+++ b/test/cache-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import {Readable} from 'stream';
+import {Readable} from 'node:stream';
import {GetObjectCommand, NoSuchKey, PutObjectCommand, S3} from '@aws-sdk/client-s3';
import {sdkStreamMixin} from '@smithy/util-stream';
@@ -37,7 +37,7 @@ import {NullCache} from '../lib/cache/null.js';
import {OnDiskCache} from '../lib/cache/on-disk.js';
import {S3Cache} from '../lib/cache/s3.js';
-import {fs, newTempDir, path} from './utils.js';
+import {fs, path, newTempDir} from './utils.js';
function basicTests(factory: () => BaseCache) {
it('should start empty', async () => {
@@ -242,7 +242,7 @@ describe('Config tests', () => {
expect(() => createCacheFromConfig('test', 'OnDisk(/tmp/moo,456,blah)')).toThrow();
});
it('should create S3 caches', () => {
- const cache = createCacheFromConfig('test', `S3(test.bucket,cache,uk-north-1)`);
+ const cache = createCacheFromConfig('test', 'S3(test.bucket,cache,uk-north-1)');
expect(cache.constructor).toEqual(S3Cache);
expect(cache.path).toEqual('cache');
expect(cache.region).toEqual('uk-north-1');
diff --git a/test/cfg-tests.ts b/test/cfg-tests.ts
index f6bf40f03..355808e19 100644
--- a/test/cfg-tests.ts
+++ b/test/cfg-tests.ts
@@ -26,7 +26,7 @@ import {describe, expect, it} from 'vitest';
import * as cfg from '../lib/cfg/cfg.js';
-import {fs, makeFakeCompilerInfo, path, resolvePathFromTestRoot} from './utils.js';
+import {fs, path, makeFakeCompilerInfo, resolvePathFromTestRoot} from './utils.js';
async function DoCfgTest(cfgArg, filename, isLlvmIr = false) {
const contents = await fs.readJson(filename, 'utf8');
diff --git a/test/check-img.ts b/test/check-img.ts
index cc32ad046..3badad26c 100644
--- a/test/check-img.ts
+++ b/test/check-img.ts
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import fs from 'fs';
-import path from 'path';
+import fs from 'node:fs';
+import path from 'node:path';
import {describe, expect, it} from 'vitest';
diff --git a/test/common-utils-tests.ts b/test/common-utils-tests.ts
index 1c21da901..807f8854f 100644
--- a/test/common-utils-tests.ts
+++ b/test/common-utils-tests.ts
@@ -29,11 +29,11 @@ import {addDigitSeparator, escapeHTML, splitArguments} from '../shared/common-ut
describe('HTML Escape Test Cases', () => {
it('should prevent basic injection', () => {
expect(escapeHTML("")).toEqual(
- `<script>alert('hi');</script>`,
+ '<script>alert('hi');</script>',
);
});
it('should prevent tag injection', () => {
- expect(escapeHTML('\'"`>')).toEqual(`'"`>`);
+ expect(escapeHTML('\'"`>')).toEqual(''"`>');
});
});
diff --git a/test/compilers/hook-tests.ts b/test/compilers/hook-tests.ts
index 6f79b51a5..f1024f5cc 100644
--- a/test/compilers/hook-tests.ts
+++ b/test/compilers/hook-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import path from 'path';
+import path from 'node:path';
import {describe, expect, it} from 'vitest';
diff --git a/test/demangler-tests.ts b/test/demangler-tests.ts
index 42b342b0d..e93f640e7 100644
--- a/test/demangler-tests.ts
+++ b/test/demangler-tests.ts
@@ -35,7 +35,7 @@ import * as properties from '../lib/properties.js';
import {SymbolStore} from '../lib/symbol-store.js';
import * as utils from '../lib/utils.js';
-import {fs, makeFakeCompilerInfo, path, resolvePathFromTestRoot} from './utils.js';
+import {fs, path, makeFakeCompilerInfo, resolvePathFromTestRoot} from './utils.js';
const cppfiltpath = 'c++filt';
diff --git a/test/exec-tests.ts b/test/exec-tests.ts
index c97ff157b..80c2618eb 100644
--- a/test/exec-tests.ts
+++ b/test/exec-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import path from 'path';
+import path from 'node:path';
import {afterAll, beforeAll, describe, expect, it} from 'vitest';
diff --git a/test/filter-tests.ts b/test/filter-tests.ts
index 403d5b406..46bc0f1d9 100644
--- a/test/filter-tests.ts
+++ b/test/filter-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import path from 'path';
+import path from 'node:path';
import {describe, expect, it} from 'vitest';
diff --git a/test/handlers/asm-docs-tests.ts b/test/handlers/asm-docs-tests.ts
index 168557b7c..274ae73c9 100644
--- a/test/handlers/asm-docs-tests.ts
+++ b/test/handlers/asm-docs-tests.ts
@@ -29,7 +29,7 @@ import {beforeAll, describe, expect, it} from 'vitest';
import {AssemblyDocumentationController} from '../../lib/handlers/api/assembly-documentation-controller.js';
/** Test matrix of architecture to [opcode, tooptip, html, url] */
-export const TEST_MATRIX: Record = {
+const TEST_MATRIX: Record = {
6502: [
[
'lda',
@@ -117,7 +117,7 @@ describe('Assembly Documentation API', () => {
it('should return 404 for unknown architecture', async () => {
await request(app)
- .get(`/api/asm/not_an_arch/mov`)
+ .get('/api/asm/not_an_arch/mov')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
.expect(404, {error: `No documentation for 'not_an_arch'`});
diff --git a/test/handlers/compile-tests.ts b/test/handlers/compile-tests.ts
index fb016d112..e5d1b9464 100644
--- a/test/handlers/compile-tests.ts
+++ b/test/handlers/compile-tests.ts
@@ -40,7 +40,8 @@ const languages = {
};
describe('Compiler tests', () => {
- let app: Express, compileHandler;
+ let app: Express;
+ let compileHandler;
beforeAll(() => {
const compilationEnvironment = makeCompilationEnvironment({languages});
diff --git a/test/handlers/route-api-test.ts b/test/handlers/route-api-test.ts
index cbb71fd6d..b258c4aec 100644
--- a/test/handlers/route-api-test.ts
+++ b/test/handlers/route-api-test.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import zlib from 'zlib';
+import zlib from 'node:zlib';
import {describe, expect, it} from 'vitest';
diff --git a/test/java-tests.ts b/test/java-tests.ts
index 490de5371..51dfff5ec 100644
--- a/test/java-tests.ts
+++ b/test/java-tests.ts
@@ -133,7 +133,7 @@ describe('javap parsing', () => {
return {
text: match[2],
source: {
- line: parseInt(match[1]),
+ line: Number.parseInt(match[1]),
file: null,
},
};
diff --git a/test/library-tests.ts b/test/library-tests.ts
index 62239b024..d01d6ab69 100644
--- a/test/library-tests.ts
+++ b/test/library-tests.ts
@@ -17,7 +17,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
-import path from 'path';
+import path from 'node:path';
import fs from 'fs-extra';
import {beforeAll, describe, expect, it} from 'vitest';
diff --git a/test/llvm-pass-dump-parser-tests.ts b/test/llvm-pass-dump-parser-tests.ts
index 4dd41b529..0100e66d0 100644
--- a/test/llvm-pass-dump-parser-tests.ts
+++ b/test/llvm-pass-dump-parser-tests.ts
@@ -43,88 +43,81 @@ describe('llvm-pass-dump-parser filter', () => {
const compilerProps = (fakeProps.get as any).bind(fakeProps, 'c++');
llvmPassDumpParser = new LlvmPassDumpParser(compilerProps);
});
- // prettier-ignore
+ // biome-ignore format: keep as-is for readability
const rawFuncIR = [
- { text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten' },
- { text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) #0 !dbg !7 {' },
- { text: 'entry:' },
- { text: ' %s1.addr = alloca %struct.S1*, align 8' },
- { text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32' },
- { text: ' call void @llvm.dbg.declare(metadata %struct.S1** %s1.addr, metadata !30, metadata !DIExpression()), !dbg !36' },
- { text: ' call void @llvm.dbg.value(metadata %struct.S1* %s1, metadata !30, metadata !DIExpression()), !dbg !32' },
- { text: ' tail call void @llvm.dbg.declare(metadata i16* %p.addr, metadata !24, metadata !DIExpression()), !dbg !12' },
- { text: ' tail call void @llvm.dbg.value(metadata i32 0, metadata !20, metadata !DIExpression()), !dbg !21' },
- { text: ' #dbg_declare(i16* %x.addr, !44, !DIExpression(), !42)' },
- { text: ' #dbg_value(i32 10, !40, !DIExpression(), !41)' },
- { text: ' DBG_VALUE $rdi, $noreg, !"s1", !DIExpression(), debug-location !32; example.cpp:0 line no:7' },
- { text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32' },
- { text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !dbg !38, !tbaa !32' },
- { text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0, !dbg !39' },
- { text: ' %1 = load i64, i64* %t, align 8, !dbg !40, !tbaa !41' },
- { text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !dbg !46, !tbaa !32' },
- { text: ' store i64 %1, i64* %t2, align 8, !dbg !49, !tbaa !50' },
- { text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0, !dbg !54' },
- { text: ' ret void, !dbg !61' },
+ {text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten'},
+ {text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) #0 !dbg !7 {',},
+ {text: 'entry:'},
+ {text: ' %s1.addr = alloca %struct.S1*, align 8'},
+ {text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32'},
+ {text: ' call void @llvm.dbg.declare(metadata %struct.S1** %s1.addr, metadata !30, metadata !DIExpression()), !dbg !36',},
+ {text: ' call void @llvm.dbg.value(metadata %struct.S1* %s1, metadata !30, metadata !DIExpression()), !dbg !32',},
+ {text: ' tail call void @llvm.dbg.declare(metadata i16* %p.addr, metadata !24, metadata !DIExpression()), !dbg !12',},
+ {text: ' tail call void @llvm.dbg.value(metadata i32 0, metadata !20, metadata !DIExpression()), !dbg !21'},
+ {text: ' #dbg_declare(i16* %x.addr, !44, !DIExpression(), !42)'},
+ {text: ' #dbg_value(i32 10, !40, !DIExpression(), !41)'},
+ {text: ' DBG_VALUE $rdi, $noreg, !"s1", !DIExpression(), debug-location !32; example.cpp:0 line no:7'},
+ {text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32'},
+ {text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !dbg !38, !tbaa !32'},
+ {text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0, !dbg !39'},
+ {text: ' %1 = load i64, i64* %t, align 8, !dbg !40, !tbaa !41'},
+ {text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !dbg !46, !tbaa !32'},
+ {text: ' store i64 %1, i64* %t2, align 8, !dbg !49, !tbaa !50'},
+ {text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0, !dbg !54'},
+ {text: ' ret void, !dbg !61'},
];
it('should not filter out dbg metadata', () => {
const options = {filterDebugInfo: false};
- // prettier-ignore
- expect(llvmPassDumpParser
- .applyIrFilters(deepCopy(rawFuncIR), options),
- ).toEqual(rawFuncIR);
+ expect(llvmPassDumpParser.applyIrFilters(deepCopy(rawFuncIR), options)).toEqual(rawFuncIR);
});
it('should filter out dbg metadata too', () => {
const options = {filterDebugInfo: true};
- // prettier-ignore
- expect(llvmPassDumpParser
- .applyIrFilters(deepCopy(rawFuncIR), options),
- ).toEqual([
- { text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten' },
- { text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) {' },
- { text: 'entry:' },
- { text: ' %s1.addr = alloca %struct.S1*, align 8' },
- { text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32' },
- { text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32' },
- { text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !tbaa !32' },
- { text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0' },
- { text: ' %1 = load i64, i64* %t, align 8, !tbaa !41' },
- { text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !tbaa !32' },
- { text: ' store i64 %1, i64* %t2, align 8, !tbaa !50' },
- { text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0' },
- { text: ' ret void' },
- ]);
+ // biome-ignore format: keep as-is for readability
+ expect(llvmPassDumpParser.applyIrFilters(deepCopy(rawFuncIR), options)).toEqual([
+ {text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten'},
+ {text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) {',},
+ {text: 'entry:'},
+ {text: ' %s1.addr = alloca %struct.S1*, align 8'},
+ {text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8, !tbaa !32'},
+ {text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8, !tbaa !32'},
+ {text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8, !tbaa !32'},
+ {text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0'},
+ {text: ' %1 = load i64, i64* %t, align 8, !tbaa !41'},
+ {text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8, !tbaa !32'},
+ {text: ' store i64 %1, i64* %t2, align 8, !tbaa !50'},
+ {text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0'},
+ {text: ' ret void'},
+ ]);
});
it('should filter out instruction metadata and object attribute group, leave debug instructions in place', () => {
// 'hide IR metadata' aims to decrease more visual noise than `hide debug info`
const options = {filterDebugInfo: false, filterIRMetadata: true};
- // prettier-ignore
- expect(llvmPassDumpParser
- .applyIrFilters(deepCopy(rawFuncIR), options),
- ).toEqual([
- { text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten' },
- { text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) {' },
- { text: 'entry:' },
- { text: ' %s1.addr = alloca %struct.S1*, align 8' },
- { text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8' },
- { text: ' call void @llvm.dbg.declare(metadata %struct.S1** %s1.addr, metadata !30, metadata !DIExpression())' },
- { text: ' call void @llvm.dbg.value(metadata %struct.S1* %s1, metadata !30, metadata !DIExpression())' },
- { text: ' tail call void @llvm.dbg.declare(metadata i16* %p.addr, metadata !24, metadata !DIExpression())' },
- { text: ' tail call void @llvm.dbg.value(metadata i32 0, metadata !20, metadata !DIExpression())' },
- { text: ' #dbg_declare(i16* %x.addr, !44, !DIExpression(), !42)' },
- { text: ' #dbg_value(i32 10, !40, !DIExpression(), !41)' },
- { text: ' DBG_VALUE $rdi, $noreg, !"s1", !DIExpression(), debug-location !32; example.cpp:0 line no:7' },
- { text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8' },
- { text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8' },
- { text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0' },
- { text: ' %1 = load i64, i64* %t, align 8' },
- { text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8' },
- { text: ' store i64 %1, i64* %t2, align 8' },
- { text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0' },
- { text: ' ret void' },
- ]);
+ // biome-ignore format: keep as-is for readability
+ expect(llvmPassDumpParser.applyIrFilters(deepCopy(rawFuncIR), options)).toEqual([
+ {text: ' # Machine code for function f(S1&, S2 const&): NoPHIs, TracksLiveness, TiedOpsRewritten'},
+ {text: 'define dso_local void @f(S1&, S2 const&)(%struct.S1* noundef nonnull align 8 dereferenceable(16) %s1, %struct.S2* noundef nonnull align 8 dereferenceable(16) %s2) {',},
+ {text: 'entry:'},
+ {text: ' %s1.addr = alloca %struct.S1*, align 8'},
+ {text: ' store %struct.S1* %s1, %struct.S1** %s1.addr, align 8'},
+ {text: ' call void @llvm.dbg.declare(metadata %struct.S1** %s1.addr, metadata !30, metadata !DIExpression())',},
+ {text: ' call void @llvm.dbg.value(metadata %struct.S1* %s1, metadata !30, metadata !DIExpression())'},
+ {text: ' tail call void @llvm.dbg.declare(metadata i16* %p.addr, metadata !24, metadata !DIExpression())'},
+ {text: ' tail call void @llvm.dbg.value(metadata i32 0, metadata !20, metadata !DIExpression())'},
+ {text: ' #dbg_declare(i16* %x.addr, !44, !DIExpression(), !42)'},
+ {text: ' #dbg_value(i32 10, !40, !DIExpression(), !41)'},
+ {text: ' DBG_VALUE $rdi, $noreg, !"s1", !DIExpression(), debug-location !32; example.cpp:0 line no:7'},
+ {text: ' store %struct.S2* %s2, %struct.S2** %s2.addr, align 8'},
+ {text: ' %0 = load %struct.S2*, %struct.S2** %s2.addr, align 8'},
+ {text: ' %a = getelementptr inbounds %struct.S2, %struct.S2* %0, i32 0, i32 0'},
+ {text: ' %1 = load i64, i64* %t, align 8'},
+ {text: ' %2 = load %struct.S1*, %struct.S1** %s1.addr, align 8'},
+ {text: ' store i64 %1, i64* %t2, align 8'},
+ {text: ' %t3 = getelementptr inbounds %struct.Wrapper2, %struct.Wrapper2* %b, i32 0, i32 0'},
+ {text: ' ret void'},
+ ]);
});
});
@@ -137,18 +130,17 @@ describe('llvm-pass-dump-parser Old style IR Dump header', () => {
llvmPassDumpParser = new LlvmPassDumpParser(compilerProps);
});
- // prettier-ignore
const rawFuncIR = [
- { text: '*** IR Dump After NoOpModulePass on [module] ***' },
- { text: 'define void @foo() {' },
- { text: ' ret void' },
- { text: '}' },
- { text: 'define void @bar() {' },
- { text: 'entry:' },
- { text: ' br label %my-loop' },
- { text: 'my-loop: ; preds = %my-loop, %entry' },
- { text: ' br label %my-loop' },
- { text: '}' },
+ {text: '*** IR Dump After NoOpModulePass on [module] ***'},
+ {text: 'define void @foo() {'},
+ {text: ' ret void'},
+ {text: '}'},
+ {text: 'define void @bar() {'},
+ {text: 'entry:'},
+ {text: ' br label %my-loop'},
+ {text: 'my-loop: ; preds = %my-loop, %entry'},
+ {text: ' br label %my-loop'},
+ {text: '}'},
];
it('should recognize dump', () => {
@@ -186,18 +178,17 @@ describe('llvm-pass-dump-parser New style IR Dump header', () => {
llvmPassDumpParser = new LlvmPassDumpParser(compilerProps);
});
- // prettier-ignore
const rawFuncIR = [
- { text: '; *** IR Dump After NoOpModulePass on [module] ***' },
- { text: 'define void @foo() {' },
- { text: ' ret void' },
- { text: '}' },
- { text: 'define void @bar() {' },
- { text: 'entry:' },
- { text: ' br label %my-loop' },
- { text: 'my-loop: ; preds = %my-loop, %entry' },
- { text: ' br label %my-loop' },
- { text: '}' },
+ {text: '; *** IR Dump After NoOpModulePass on [module] ***'},
+ {text: 'define void @foo() {'},
+ {text: ' ret void'},
+ {text: '}'},
+ {text: 'define void @bar() {'},
+ {text: 'entry:'},
+ {text: ' br label %my-loop'},
+ {text: 'my-loop: ; preds = %my-loop, %entry'},
+ {text: ' br label %my-loop'},
+ {text: '}'},
];
it('should recognize dump', () => {
diff --git a/test/nim-tests.ts b/test/nim-tests.ts
index 98ccffa0d..3c9bd767a 100644
--- a/test/nim-tests.ts
+++ b/test/nim-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import path from 'path';
+import path from 'node:path';
import {beforeAll, describe, expect, it} from 'vitest';
@@ -67,14 +67,14 @@ describe('Nim', () => {
});
it('test getCacheFile from possible user-options', () => {
- const compiler = new NimCompiler(makeFakeCompilerInfo(info), ce),
- input = 'test.min',
- folder = path.join('/', 'tmp/'),
- expected = {
- cpp: folder + '@m' + input + '.cpp.o',
- c: folder + '@m' + input + '.c.o',
- objc: folder + '@m' + input + '.m.o',
- };
+ const compiler = new NimCompiler(makeFakeCompilerInfo(info), ce);
+ const input = 'test.min';
+ const folder = path.join('/', 'tmp/');
+ const expected = {
+ cpp: folder + '@m' + input + '.cpp.o',
+ c: folder + '@m' + input + '.c.o',
+ objc: folder + '@m' + input + '.m.o',
+ };
for (const lang of ['cpp', 'c', 'objc']) {
expect(unwrap(compiler.getCacheFile([lang], input, folder))).toEqual(expected[lang]);
diff --git a/test/options-handler.ts b/test/options-handler.ts
index a7dee7ce0..abebfb71b 100644
--- a/test/options-handler.ts
+++ b/test/options-handler.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import {fileURLToPath} from 'url';
+import {fileURLToPath} from 'node:url';
import _ from 'underscore';
import {beforeAll, describe, expect, it} from 'vitest';
diff --git a/test/packager-tests.ts b/test/packager-tests.ts
index 528688269..538d42927 100644
--- a/test/packager-tests.ts
+++ b/test/packager-tests.ts
@@ -26,7 +26,7 @@ import {describe, expect, it} from 'vitest';
import {Packager} from '../lib/packager.js';
-import {fs, newTempDir, path} from './utils.js';
+import {fs, path, newTempDir} from './utils.js';
function writeTestFile(filepath) {
return fs.writeFile(filepath, '#!/bin/sh\n\necho Hello, world!\n\n');
diff --git a/test/pascal-tests.ts b/test/pascal-tests.ts
index 2caf1c798..1c414ee80 100644
--- a/test/pascal-tests.ts
+++ b/test/pascal-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import path from 'path';
+import path from 'node:path';
import {beforeAll, describe, expect, it} from 'vitest';
diff --git a/test/properties-test.ts b/test/properties-test.ts
index 56c1f56c8..7ebc23bc9 100644
--- a/test/properties-test.ts
+++ b/test/properties-test.ts
@@ -31,7 +31,9 @@ const languages = {
};
describe('Properties', () => {
- let casesProps, overridingProps, compilerProps;
+ let casesProps;
+ let overridingProps;
+ let compilerProps;
beforeAll(() => {
properties.initialize('test/example-config/', ['test', 'overridden-base', 'overridden-tip']);
@@ -165,8 +167,8 @@ describe('Properties', () => {
describe('Properties blob parsing', () => {
it('Normal properties', () => {
+ // biome-ignore format: keep as-is for readability
const props = properties.parseProperties(
- // prettier-ignore
'hello = test \n' +
'etc=123\n' +
'mybool=false\n',
diff --git a/test/racket-pass-dump-parser-tests.ts b/test/racket-pass-dump-parser-tests.ts
index 3b2a445a4..6eec98267 100644
--- a/test/racket-pass-dump-parser-tests.ts
+++ b/test/racket-pass-dump-parser-tests.ts
@@ -45,18 +45,17 @@ describe('racket-pass-dump-parser', () => {
});
it('should recognize step', () => {
- // prettier-ignore
const output = [
- { text: ';; compile-linklet: phase: 0' },
- { text: ';; compile-linklet: module: example' },
- { text: ';; compile-linklet: name: module' },
- { text: ';; compile-linklet: step: linklet' },
- { text: ';; ---------------------' },
- { text: '(linklet ((.get-syntax-literal!) (.set-transformer!)) (square)' },
- { text: ' (void)' },
- { text: ' (define-values (square)' },
- { text: ' (#%name square (lambda (num_1) (* num_1 num_1))))' },
- { text: ' (void))' },
+ {text: ';; compile-linklet: phase: 0'},
+ {text: ';; compile-linklet: module: example'},
+ {text: ';; compile-linklet: name: module'},
+ {text: ';; compile-linklet: step: linklet'},
+ {text: ';; ---------------------'},
+ {text: '(linklet ((.get-syntax-literal!) (.set-transformer!)) (square)'},
+ {text: ' (void)'},
+ {text: ' (define-values (square)'},
+ {text: ' (#%name square (lambda (num_1) (* num_1 num_1))))'},
+ {text: ' (void))'},
];
const brokenDown = racketPassDumpParser.breakdownOutputIntoPassDumps(deepCopy(output), {});
@@ -72,29 +71,28 @@ describe('racket-pass-dump-parser', () => {
});
it('should recognize pass', () => {
- // prettier-ignore
const output = [
- { text: ';; compile-linklet: module: (phases configure-runtime)' },
- { text: ';; compile-linklet: name: decl' },
- { text: ';; compile-linklet: passes: all' },
- { text: ';; ---------------------' },
- { text: 'output of cpnanopass:' },
- { text: '(case-lambda ' },
- { text: ' [clause' },
- { text: ' ()' },
- { text: ' 0' },
- { text: ' (case-lambda' },
- { text: ' [clause' },
- { text: ' (instance-variable-reference.22' },
- { text: ' .get-syntax-literal!1.23' },
- { text: ' .set-transformer!2.24' },
- { text: ' configure3.25)' },
- { text: ' 4' },
- { text: ' (begin' },
- { text: ' ((#[primref.a0xltlrcpeygsahopkplcn-2 $top-level-value 263393 #f]' },
- { text: ' \'1/print-as-expression.rkt-io.sls-1/print-as-expression-0)' },
- { text: ' \'#t)' },
- { text: ' \'#)])])' },
+ {text: ';; compile-linklet: module: (phases configure-runtime)'},
+ {text: ';; compile-linklet: name: decl'},
+ {text: ';; compile-linklet: passes: all'},
+ {text: ';; ---------------------'},
+ {text: 'output of cpnanopass:'},
+ {text: '(case-lambda '},
+ {text: ' [clause'},
+ {text: ' ()'},
+ {text: ' 0'},
+ {text: ' (case-lambda'},
+ {text: ' [clause'},
+ {text: ' (instance-variable-reference.22'},
+ {text: ' .get-syntax-literal!1.23'},
+ {text: ' .set-transformer!2.24'},
+ {text: ' configure3.25)'},
+ {text: ' 4'},
+ {text: ' (begin'},
+ {text: ' ((#[primref.a0xltlrcpeygsahopkplcn-2 $top-level-value 263393 #f]'},
+ {text: " '1/print-as-expression.rkt-io.sls-1/print-as-expression-0)"},
+ {text: " '#t)"},
+ {text: " '#)])])"},
];
const brokenDown = racketPassDumpParser.breakdownOutputIntoPassDumps(deepCopy(output), {});
diff --git a/test/rison.ts b/test/rison.ts
index 432703126..1c5f687e5 100644
--- a/test/rison.ts
+++ b/test/rison.ts
@@ -14,7 +14,7 @@ const py_testcases = {
1.5: 1.5,
'-3': -3,
'1e30': 1e30,
- '1e-30': 1.0000000000000001e-30, // eslint-disable-line quote-props
+ '1e-30': 1.0000000000000001e-30,
'G.': 'G.',
a: 'a',
"'0a'": '0a',
diff --git a/test/sponsors-test.ts b/test/sponsors-test.ts
index f878b241e..4aeb7d5b6 100644
--- a/test/sponsors-test.ts
+++ b/test/sponsors-test.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import fs from 'fs';
+import fs from 'node:fs';
import {describe, expect, it} from 'vitest';
diff --git a/test/stats-test.ts b/test/stats-test.ts
index 234ccfbd3..12c6120ce 100644
--- a/test/stats-test.ts
+++ b/test/stats-test.ts
@@ -24,7 +24,7 @@
import {describe, expect, it} from 'vitest';
-import {filterCompilerOptions, KnownBuildMethod, makeSafe} from '../lib/stats.js';
+import {KnownBuildMethod, filterCompilerOptions, makeSafe} from '../lib/stats.js';
import {getHash} from '../lib/utils.js';
import {ParseFiltersAndOutputOptions} from '../types/features/filters.interfaces.js';
diff --git a/test/storage/storage-s3-tests.ts b/test/storage/storage-s3-tests.ts
index 95e19ac39..6bb13c57e 100644
--- a/test/storage/storage-s3-tests.ts
+++ b/test/storage/storage-s3-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import {Readable} from 'stream';
+import {Readable} from 'node:stream';
import {DynamoDB, GetItemCommand, PutItemCommand, QueryCommand, UpdateItemCommand} from '@aws-sdk/client-dynamodb';
import {GetObjectCommand, PutObjectCommand, S3} from '@aws-sdk/client-s3';
diff --git a/test/utils-tests.ts b/test/utils-tests.ts
index 93156fd2d..db7b6c4c1 100644
--- a/test/utils-tests.ts
+++ b/test/utils-tests.ts
@@ -22,8 +22,8 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import path from 'path';
-import {fileURLToPath} from 'url';
+import path from 'node:path';
+import {fileURLToPath} from 'node:url';
import {describe, expect, it} from 'vitest';
import winston from 'winston';
diff --git a/test/utils.ts b/test/utils.ts
index a0690024d..24c2fd949 100644
--- a/test/utils.ts
+++ b/test/utils.ts
@@ -22,9 +22,9 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import os from 'os';
-import path from 'path';
-import {fileURLToPath} from 'url';
+import os from 'node:os';
+import path from 'node:path';
+import {fileURLToPath} from 'node:url';
import fs from 'fs-extra';
import temp from 'temp';
@@ -89,5 +89,4 @@ export function newTempDir() {
return temp.mkdirSync({prefix: 'compiler-explorer-tests', dir: os.tmpdir()});
}
-// eslint-disable-next-line -- do not rewrite exports
export {path, fs};
diff --git a/test/win-path-tests.ts b/test/win-path-tests.ts
index 7d243bd73..ee52005f4 100644
--- a/test/win-path-tests.ts
+++ b/test/win-path-tests.ts
@@ -22,7 +22,7 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import child_process from 'child_process';
+import child_process from 'node:child_process';
import {beforeAll, describe, expect, it} from 'vitest';
diff --git a/types/cache.interfaces.ts b/types/cache.interfaces.ts
index 15e1f3e7b..c0cb650b8 100644
--- a/types/cache.interfaces.ts
+++ b/types/cache.interfaces.ts
@@ -36,6 +36,6 @@ export type CacheableValue =
| boolean
| undefined
| null
- | Function // eslint-disable-line @typescript-eslint/ban-types
+ | Function
| {[x: string]: CacheableValue}
| Array;
diff --git a/vitest.config.ts b/vitest.config.ts
index 5f9997f2a..c18df9597 100644
--- a/vitest.config.ts
+++ b/vitest.config.ts
@@ -1,7 +1,5 @@
-// eslint-disable-next-line n/no-unpublished-import
import {defineConfig} from 'vitest/config';
-// eslint-disable-next-line import/no-default-export
export default defineConfig({
test: {
coverage: {
diff --git a/webpack.config.esm.ts b/webpack.config.esm.ts
index a4757b98d..bd7b600e8 100644
--- a/webpack.config.esm.ts
+++ b/webpack.config.esm.ts
@@ -22,12 +22,11 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
-import fs from 'fs';
-import os from 'os';
-import path from 'path';
-import {fileURLToPath} from 'url';
+import fs from 'node:fs';
+import os from 'node:os';
+import path from 'node:path';
+import {fileURLToPath} from 'node:url';
-/* eslint-disable n/no-unpublished-import */
import CopyWebpackPlugin from 'copy-webpack-plugin';
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
@@ -39,10 +38,7 @@ import {WebpackManifestPlugin} from 'webpack-manifest-plugin';
const __dirname = path.resolve(path.dirname(fileURLToPath(import.meta.url)));
const isDev = process.env.NODE_ENV !== 'production';
-function log(message: string) {
- // eslint-disable-next-line no-console
- console.log('webpack: ' + message);
-}
+function log(message: string) {}
log(`compiling for ${isDev ? 'development' : 'production'}.`);
// Memory limits us in most cases, so restrict parallelism to keep us in a sane amount of RAM
@@ -102,7 +98,6 @@ if (isDev) {
plugins.push(new Webpack.HotModuleReplacementPlugin());
}
-// eslint-disable-next-line import/no-default-export
export default {
mode: isDev ? 'development' : 'production',
entry: {