-
-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(deps-dev): replace standard with neostandard (#421)
- Loading branch information
Showing
24 changed files
with
135 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
'use strict' | ||
|
||
module.exports = require('neostandard')({ | ||
ignores: [ | ||
...require('neostandard').resolveIgnoresFromGitignore(), | ||
'test/commonjs/syntax-error/lib/a.js', | ||
'test/issues/369/invalid-autohooks', | ||
'test/issues/369/non-SyntaxError' | ||
], | ||
ts: true | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = async (fastify) => { | ||
fastify.get("/", function () { | ||
return { foo: "bar" }; | ||
fastify.get('/', function () { | ||
return { foo: 'bar' } | ||
}) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports = async (fastify) => { | ||
fastify.get("/", function () { | ||
return { hello: "world" }; | ||
fastify.get('/', function () { | ||
return { hello: 'world' } | ||
}) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports.default = async (fastify: any) => { | ||
fastify.get("/", function () { | ||
return { bar: "bar" }; | ||
fastify.get('/', function () { | ||
return { bar: 'bar' } | ||
}) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports.default = async (fastify: any) => { | ||
fastify.get("/customPath", function () { | ||
return { baz: "baz" }; | ||
fastify.get('/customPath', function () { | ||
return { baz: 'baz' } | ||
}) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports.default = async (fastify: any) => { | ||
fastify.get("/", function () { | ||
return { foo: "foo" }; | ||
fastify.get('/', function () { | ||
return { foo: 'foo' } | ||
}) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module.exports.default = async (fastify: any) => { | ||
fastify.get("/", function () { | ||
return { hello: "world" }; | ||
fastify.get('/', function () { | ||
return { hello: 'world' } | ||
}) | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
'use strict' | ||
|
||
module.exports = async function (app, opts) { | ||
app.addHook('onRequest', async (req, reply) => { | ||
req.hooked = req.hooked || [] | ||
req.hooked.push('child') | ||
}) | ||
app.addHook('onRequest', async (req, reply) => { | ||
req.hooked = req.hooked || [] | ||
req.hooked.push('child') | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
'use strict' | ||
|
||
module.exports = new Promise((res) => { | ||
res(async function (app, opts) { | ||
app.addHook('onRequest', async (req, reply) => { | ||
req.hooked = req.hooked || [] | ||
req.hooked.push('promisified') | ||
}) | ||
module.exports = new Promise((resolve) => { | ||
resolve(async function (app, opts) { | ||
app.addHook('onRequest', async (req, reply) => { | ||
req.hooked = req.hooked || [] | ||
req.hooked.push('promisified') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import fastify from "fastify"; | ||
import basicApp from "../../typescript/basic/app"; | ||
import fastify from 'fastify' | ||
import basicApp from '../../typescript/basic/app' | ||
|
||
const app = fastify(); | ||
app.register(basicApp); | ||
const app = fastify() | ||
app.register(basicApp) | ||
|
||
app.listen({ | ||
port: Math.floor(Math.random() * 3000 + 3000) | ||
}, function (err) { | ||
if (err) process.stderr.write("failed"); | ||
process.stdout.write("success"); | ||
app.close(); | ||
}); | ||
if (err) process.stderr.write('failed') | ||
process.stdout.write('success') | ||
app.close() | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
import { exec } from "child_process"; | ||
import { exec } from 'child_process' | ||
|
||
describe("integration test", function () { | ||
test.concurrent.each(["ts-node", "ts-node-dev"])( | ||
"integration with %s", | ||
describe('integration test', function () { | ||
test.concurrent.each(['ts-node', 'ts-node-dev'])( | ||
'integration with %s', | ||
async function (instance) { | ||
await new Promise(function (resolve, reject) { | ||
const child = exec(`${instance} "${process.cwd()}/test/typescript-jest/integration/instance.ts"`); | ||
let stderr = ""; | ||
child.stderr?.on("data", function (b) { | ||
stderr = stderr + b.toString(); | ||
}); | ||
let stdout = ""; | ||
child.stdout?.on("data", function (b) { | ||
stdout = stdout + b.toString(); | ||
}); | ||
child.once("close", function () { | ||
expect(stderr.includes("failed")).toStrictEqual(false); | ||
expect(stdout.includes("success")).toStrictEqual(true); | ||
resolve(""); | ||
}); | ||
}); | ||
const child = exec(`${instance} "${process.cwd()}/test/typescript-jest/integration/instance.ts"`) | ||
let stderr = '' | ||
child.stderr?.on('data', function (b) { | ||
stderr = stderr + b.toString() | ||
}) | ||
let stdout = '' | ||
child.stdout?.on('data', function (b) { | ||
stdout = stdout + b.toString() | ||
}) | ||
child.once('close', function () { | ||
expect(stderr.includes('failed')).toStrictEqual(false) | ||
expect(stdout.includes('success')).toStrictEqual(true) | ||
resolve('') | ||
}) | ||
}) | ||
}, | ||
30000 | ||
); | ||
}); | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.