Setup eslint and enforce rules
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,17 +1,15 @@
|
||||
import {Template} from "../Template"
|
||||
import {UniversalPath} from "../../util"
|
||||
import {Template} from '../Template'
|
||||
|
||||
/**
|
||||
* Template that generates a new middleware class in app/http/middlewares.
|
||||
*/
|
||||
const middleware_template: Template = {
|
||||
const templateMiddleware: Template = {
|
||||
name: 'middleware',
|
||||
fileSuffix: '.middleware.ts',
|
||||
description: 'Create a middleware class that can be applied to routes.',
|
||||
baseAppPath: ['http', 'middlewares'],
|
||||
render(name: string, fullCanonicalName: string, targetFilePath: UniversalPath) {
|
||||
return `import {Middleware} from "@extollo/lib"
|
||||
import {Injectable} from "@extollo/di"
|
||||
render(name: string) {
|
||||
return `import {Middleware, Injectable} from '@extollo/lib'
|
||||
|
||||
/**
|
||||
* ${name} Middleware
|
||||
@@ -25,7 +23,7 @@ export class ${name} extends Middleware {
|
||||
}
|
||||
}
|
||||
`
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export { middleware_template }
|
||||
export { templateMiddleware }
|
||||
|
||||
Reference in New Issue
Block a user