Skip to content

Commit 07ddaa7

Browse files
committed
refactor: tslint → eslint
1 parent cdcd3e9 commit 07ddaa7

File tree

13 files changed

+758
-70
lines changed

13 files changed

+758
-70
lines changed

.eslintrc.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"parserOptions": {
4+
"ecmaVersion": 2018,
5+
"sourceType": "module"
6+
},
7+
"plugins": ["jest", "@typescript-eslint", "prettier", "json"],
8+
"env": {
9+
"browser": true,
10+
"es6": true,
11+
"node": true,
12+
"jest/globals": true
13+
},
14+
"extends": [
15+
"plugin:jest/recommended",
16+
"eslint:recommended",
17+
"plugin:@typescript-eslint/recommended",
18+
"prettier/@typescript-eslint",
19+
"plugin:prettier/recommended"
20+
],
21+
"rules": {
22+
"prettier/prettier": "error",
23+
"@typescript-eslint/explicit-function-return-type": 0
24+
}
25+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"eslint.validate": [
4+
"javascript",
5+
"javascriptreact",
6+
{ "language": "typescript", "autoFix": true },
7+
{ "language": "typescriptreact", "autoFix": true }
8+
],
9+
"tslint.enable": false
10+
}

demo/src/compile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const url = 'https://wokwi-hexi-73miufol2q-uc.a.run.app';
22

3-
export interface IHexiResult {
3+
export interface HexiResult {
44
stdout: string;
55
stderr: string;
66
hex: string;
@@ -16,5 +16,5 @@ export async function buildHex(source: string) {
1616
},
1717
body: JSON.stringify({ sketch: source })
1818
});
19-
return (await resp.json()) as IHexiResult;
19+
return (await resp.json()) as HexiResult;
2020
}

demo/src/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import './index.css';
66
import { CPUPerformance } from './cpu-performance';
77
import { LEDElement } from '@wokwi/elements';
88

9-
let editor: any;
9+
let editor: any; // eslint-disable-line @typescript-eslint/no-explicit-any
1010
const BLINK_CODE = `
1111
// Green LED connected to LED_BUILTIN,
1212
// Red LED connected to pin 12. Enjoy!
@@ -25,8 +25,8 @@ void loop() {
2525
}`.trim();
2626

2727
// Load Editor
28-
declare var window: any;
29-
declare var monaco: any;
28+
declare const window: any; // eslint-disable-line @typescript-eslint/no-explicit-any
29+
declare const monaco: any; // eslint-disable-line @typescript-eslint/no-explicit-any
3030
window.require.config({
3131
paths: { vs: 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.18.0/min/vs' }
3232
});
@@ -45,6 +45,7 @@ const led12 = document.querySelector<LEDElement>('wokwi-led[color=red]');
4545
// Set up toolbar
4646
let runner: AVRRunner;
4747

48+
/* eslint-disable @typescript-eslint/no-use-before-define */
4849
const runButton = document.querySelector('#run-button');
4950
runButton.addEventListener('click', compileAndRun);
5051
const stopButton = document.querySelector('#stop-button');

0 commit comments

Comments
 (0)