Skip to content

Commit

Permalink
Merge pull request #82 from AlexBeauchemin/ts-formatter
Browse files Browse the repository at this point in the history
Fix for new ts.formatting.RulesProvider error
  • Loading branch information
crispmark authored Feb 14, 2018
2 parents a3f4457 + d3b515a commit e3ecbc9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
"mysql": "^2.13.0",
"mz": "^2.6.0",
"pg-promise": "^6.3.6",
"typescript": "^2.4.2",
"typescript-formatter": "4.1.1",
"typescript": "^2.7.1",
"typescript-formatter": "^7.0.1",
"yargs": "^8.0.1"
},
"nyc": {
Expand Down
11 changes: 8 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { generateEnumType, generateTableTypes, generateTableInterface } from './typescript'
import { getDatabase, Database } from './schema'
import Options, { OptionValues } from './options'
import { processString } from 'typescript-formatter'
import { processString, Options as ITFOptions } from 'typescript-formatter'
const pkgVersion = require('../package.json').version

function getTime () {
Expand Down Expand Up @@ -90,13 +90,18 @@ export async function typescriptOfSchema (db: Database|string,
output += enumTypes
output += interfaces

let formatterOption = {
const formatterOption: ITFOptions = {
replace: false,
verify: false,
tsconfig: true,
tslint: true,
editorconfig: true,
tsfmt: true
tsfmt: true,
vscode: false,
tsconfigFile: null,
tslintFile: null,
vscodeFile: null,
tsfmtFile: null
}

const processedResult = await processString('schema.ts', output, formatterOption)
Expand Down
2 changes: 1 addition & 1 deletion src/schemaMysql.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as mysql from 'mysql'
import { mapValues, keys, isEqual, camelCase } from 'lodash'
import { mapValues, keys, isEqual } from 'lodash'
import { parse as urlParse } from 'url'
import { TableDefinition, Database } from './schemaInterfaces'
import Options from './options'
Expand Down

0 comments on commit e3ecbc9

Please sign in to comment.