Skip to content

Commit 99e2927

Browse files
committed
refactor: manual eslint fixes
1 parent 8a5d2dc commit 99e2927

File tree

9 files changed

+16
-18
lines changed

9 files changed

+16
-18
lines changed

.eslintignore

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

examples/alb/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ router.get('/', (req, res) => {
3232
})
3333

3434
router.get('/sam', (req, res) => {
35-
res.sendFile(`${__dirname}/sam-logo.png`)
35+
res.sendFile(path.join(__dirname, 'sam-logo.png'))
3636
})
3737

3838
router.get('/users', (req, res) => {

examples/basic-starter-api-gateway-v1/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ router.get('/', (req, res) => {
4545
})
4646

4747
router.get('/sam', (req, res) => {
48-
res.sendFile(`${__dirname}/sam-logo.png`)
48+
res.sendFile(path.join(__dirname, 'sam-logo.png'))
4949
})
5050

5151
router.get('/users', (req, res) => {

examples/basic-starter-api-gateway-v2/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ router.get('/', (req, res) => {
4242
})
4343

4444
router.get('/sam', (req, res) => {
45-
res.sendFile(`${__dirname}/sam-logo.png`)
45+
res.sendFile(path.join(__dirname, 'sam-logo.png'))
4646
})
4747

4848
router.get('/users', (req, res) => {

examples/basic-starter-hapi/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const Hapi = require('@hapi/hapi')
22

3-
server = Hapi.server({
3+
const server = Hapi.server({
44
port: 3000,
55
host: 'localhost'
66
})

examples/lambda-edge/src/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ router.get('/', (req, res) => {
2929
})
3030

3131
router.get('/sam', (req, res) => {
32-
res.sendFile(`${__dirname}/sam-logo.png`)
32+
res.sendFile(path.join(__dirname, 'sam-logo.png'))
3333
})
3434

3535
router.get('/users', (req, res) => {

examples/sails/app.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,14 @@
2020
* https://sailsjs.com/anatomy/app.js
2121
*/
2222

23-
2423
// Ensure we're in the project directory, so cwd-relative paths work as expected
2524
// no matter where we actually lift from.
2625
// > Note: This is not required in order to lift, but it is a convenient default.
2726
process.chdir(__dirname);
2827

29-
30-
3128
// Attempt to import `sails` dependency, as well as `rc` (for loading `.sailsrc` files).
32-
var sails;
33-
var rc;
29+
let sails;
30+
let rc;
3431
try {
3532
sails = require('sails');
3633
rc = require('sails/accessible/rc');
@@ -46,15 +43,13 @@ try {
4643
console.error('also run this app with `sails lift`. Running with `sails lift` will');
4744
console.error('not run this file (`app.js`), but it will do exactly the same thing.');
4845
console.error('(It even uses your app directory\'s local Sails install, if possible.)');
49-
return;
50-
}//-•
51-
46+
}// -•
5247

5348
// Start server
5449
const appPromise = new Promise((resolve) => {
5550
sails.lift(rc('sails'), () => {
56-
resolve(sails.hooks.http.app)
57-
})
58-
})
51+
resolve(sails.hooks.http.app);
52+
});
53+
});
5954

60-
module.exports = appPromise
55+
module.exports = appPromise;

examples/sails/config/env/production.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable no-irregular-whitespace */
2+
13
/**
24
* Production environment settings
35
* (sails.config.*)

examples/vanilla-http/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const url = require('url')
22

33
const app = function (req, res) {
4-
const parsedUrl = url.parse(req.url, true)
4+
const parsedUrl = url.URL(req.url, true)
55

66
res.writeHead(200, {
77
'Content-Type': 'text/plain charset=UTF-8'

0 commit comments

Comments
 (0)