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 "../../cli"
|
||||
import {UniversalPath} from "../../util"
|
||||
import {Template} from '../../cli'
|
||||
|
||||
/**
|
||||
* Template for creating new database model classes in app/models.
|
||||
*/
|
||||
const model_template: Template = {
|
||||
const templateModel: Template = {
|
||||
name: 'model',
|
||||
fileSuffix: '.model.ts',
|
||||
baseAppPath: ['models'],
|
||||
description: 'Create a new class that represents a record in a database',
|
||||
render: (name: string, fullCanonicalName: string, targetFilePath: UniversalPath) => {
|
||||
return `import {Model} from "@extollo/orm"
|
||||
import {Injectable} from "@extollo/di"
|
||||
render: (name: string) => {
|
||||
return `import {Injectable, Model} from "@extollo/lib"
|
||||
|
||||
/**
|
||||
* ${name} Model
|
||||
@@ -24,7 +22,7 @@ export class ${name} extends Model<${name}> {
|
||||
protected static key = '${name.toLowerCase()}_id';
|
||||
}
|
||||
`
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export { model_template }
|
||||
export { templateModel }
|
||||
|
||||
Reference in New Issue
Block a user