Skip to content

Commit

Permalink
Merge branch 'main' of github.com:zengxiaoluan/eslint-plugin-jlc
Browse files Browse the repository at this point in the history
  • Loading branch information
zengxiaoluan committed Aug 6, 2024
2 parents 5a50def + fed7f73 commit 0c18ef6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/rules/no-then.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
# No then with promise (`jlc/no-then`)

<!-- end auto-generated rule header -->

That is bad:

```js
let promise = new Promise(function(resolve, reject) {
setTimeout(() => resolve(1), 1000);
});

promise.then(function(result) {

});
```

That is good:

```js
let promise = new Promise(function(resolve, reject) {
setTimeout(() => resolve(1), 1000);
});

async function timeout(ms) {
await promise()
}
```

0 comments on commit 0c18ef6

Please sign in to comment.