Skip to content

Commit 4b849b6

Browse files
committed
+ Lint.
1 parent 2e56e98 commit 4b849b6

File tree

9 files changed

+14
-12
lines changed

9 files changed

+14
-12
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
dist
2+
node_modules

.github/workflows/node.js.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ jobs:
2727
- run: npm ci
2828
- run: npm run build --if-present
2929
- run: npm test
30+
- run: npm lint

example/controller.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
const Context = require('../src');
22

33
const delay = (callback) => setTimeout(() => {
4-
callback()
5-
}, 2000)
4+
callback();
5+
}, 2000);
66

77
class UserController {
88
get(req, res) {
99

1010
delay(() => {
1111
console.log('Callback : ', Context.get());
12-
})
12+
});
1313

1414
res.send(Context.get());
1515
}

example/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ app.use('/', ContextMiddleware);
1515
app.get('/user', UserController.get);
1616

1717
app.listen(port, function(){
18-
console.log("Server is running");
18+
console.log('Server is running');
1919
});

src/hooks/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ describe('Context / Hooks', () => {
156156
expect(executionMap.size).toEqual(0);
157157

158158
done();
159-
}, 200)
159+
}, 200);
160160
});
161161
});
162162
});

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const asyncHooks = require('async_hooks');
2-
const ExecutionContextResource = require('./lib/ExecutionContextResource')
2+
const ExecutionContextResource = require('./lib/ExecutionContextResource');
33
const { isProduction, monitorMap } = require('./lib');
44
const { create: createHooks } = require('./hooks');
55
const { ExecutionContextErrors } = require('./constants');
@@ -119,7 +119,7 @@ const createExecutionContext = () => {
119119
};
120120

121121
return Context;
122-
}
122+
};
123123

124124
global.ExecutionContext = global.ExecutionContext || createExecutionContext();
125125

src/lib/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const env = process.env.NODE_ENV || PRODUCTION;
1212
* @param {Number} created - The created time to calculate it's duration
1313
* @return {Number}
1414
*/
15-
const getDuration = (now, created) => now - created
15+
const getDuration = (now, created) => now - created;
1616

1717
module.exports = {
1818
env,
@@ -38,13 +38,13 @@ module.exports = {
3838
children: children.map((childId) => {
3939
const { type, created } = executionContextMap.get(childId);
4040

41-
return { asyncId: childId, type, created, duration: getDuration(now, created) }
41+
return { asyncId: childId, type, created, duration: getDuration(now, created) };
4242
})
4343
}));
4444

4545
return {
4646
size: executionContextMap.size,
4747
entries
48-
}
48+
};
4949
}
5050
};

src/lib/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('Lib', () => {
7878

7979
expect(report.size > 0).toBeTruthy();
8080
expect(report.entries.length > 0).toBeTruthy();
81-
done()
81+
done();
8282
});
8383
});
8484
});

src/spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ describe('Context', () => {
134134
expect(exposedContext).toEqual(expect.objectContaining(
135135
initialContext
136136
));
137-
})
137+
});
138138
});
139139
});
140140

0 commit comments

Comments
 (0)