Skip to content

Commit

Permalink
first attempt to re write in typescript
Browse files Browse the repository at this point in the history
add readme

add lint fix flash
  • Loading branch information
brianignacio5 committed Nov 25, 2022
1 parent 076af26 commit 24e0475
Show file tree
Hide file tree
Showing 22 changed files with 8,873 additions and 288 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
@@ -0,0 +1,2 @@
node_modules
lib
18 changes: 18 additions & 0 deletions .eslintrc
@@ -0,0 +1,18 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"rules": {
"no-console": 1, // Means warning
"prettier/prettier": 2 // Means error
}
}
2 changes: 2 additions & 0 deletions .gitignore
@@ -1 +1,3 @@
node_modules
lib
bundle.js
4 changes: 4 additions & 0 deletions .prettierrc
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"trailingComma": "all"
}
4 changes: 2 additions & 2 deletions ESPLoader.js
Expand Up @@ -250,7 +250,7 @@ class ESPLoader {
//var str = new TextDecoder().decode(res);
//this.log(str);
} catch (e) {
if (e instanceof TimeoutError) {
if (e instanceof Error) {
break;
}
}
Expand All @@ -263,7 +263,7 @@ class ESPLoader {
var resp = await this.sync();
return "success";
} catch(error) {
if (error instanceof TimeoutError) {
if (error instanceof Error) {
if (esp32r0_delay) {
this.write_char('_');
} else {
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -12,10 +12,11 @@ Visit https://espressif.github.io/esptool-js/ to see this tool in action.

```
npm install
npm run rollup
python3 -m http.server 8008
```

Then open http://localhost:8008 in Chrome or Edge.
Then open http://localhost:8008 in Chrome or Edge. `npm run rollup` to build the `bundle.js` used in the example `index.html`.

## License

Expand Down
5 changes: 2 additions & 3 deletions index.html
Expand Up @@ -11,8 +11,8 @@
/>
<link rel="icon" href="favicon.ico" />
<script src="node_modules/xterm/lib/xterm.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.0.3/pako.js"></script>
<script src="node_modules/crypto-js/crypto-js.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pako/2.0.3/pako.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
Expand Down Expand Up @@ -73,8 +73,7 @@ <h3>Console </h3>
</div>
<div id="terminal"></div>
</div>

<script src="index.js" type="module"></script>
<script src="./index.js" type="module"></script>
<script>
// Safari 3.0+ "[object HTMLElementConstructor]"
var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && window['safari'].pushNotification));
Expand Down

0 comments on commit 24e0475

Please sign in to comment.