Skip to content

Commit

Permalink
add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
splitice committed Oct 27, 2021
1 parent 58c25fa commit a378b4c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
env:
node: true
es2021: true
extends: 'eslint:recommended'
parserOptions:
ecmaVersion: 12
sourceType: module
rules: {}
13 changes: 13 additions & 0 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Eslint
on:
push:

jobs:
check_eslint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: |
sudo npm install -g eslint
- run: eslint index.js --ext .js,.jsx,.ts,.tsx
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,13 @@ Q.resolve = value=>QPromise.resolve(value)

const Util = process.binding('util')

let _promiseState
if(Util.getPromiseDetails){
function _promiseState(promise){
_promiseState = function(promise){
return Util.getPromiseDetails(promise)[0]
}
} else{
function _promiseState(promise){
_promiseState = function(promise){
const p = util.inspect(promise)
if(p.includes('{ <rejected>')){
return 2
Expand Down

0 comments on commit a378b4c

Please sign in to comment.