diff --git a/lib/formatter.ts b/lib/formatter.ts index 58524a6..89623f4 100644 --- a/lib/formatter.ts +++ b/lib/formatter.ts @@ -1,11 +1,11 @@ import * as ts from "typescript"; -import { createDefaultFormatCodeOptions } from "./utils"; +import { createDefaultFormatCodeSettings } from "./utils"; // from https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#pretty-printer-using-the-ls-formatter // Note: this uses ts.formatting which is part of the typescript 1.4 package but is not currently // exposed in the public typescript.d.ts. The typings should be exposed in the next release. -export default function format(fileName: string, text: string, options = createDefaultFormatCodeOptions()) { +export default function format(fileName: string, text: string, options = createDefaultFormatCodeSettings()) { // Parse the source text let sourceFile = ts.createSourceFile(fileName, text, ts.ScriptTarget.Latest, true); @@ -16,11 +16,11 @@ export default function format(fileName: string, text: string, options = createD // Apply the edits on the input code return applyEdits(text, edits); - function getRuleProvider(options: ts.FormatCodeOptions) { + function getRuleProvider(settings: ts.FormatCodeSettings) { // Share this between multiple formatters using the same options. // This represents the bulk of the space the formatter uses. let ruleProvider = new (ts as any).formatting.RulesProvider(); - ruleProvider.ensureUpToDate(options); + ruleProvider.ensureUpToDate(settings); return ruleProvider; } diff --git a/lib/index.ts b/lib/index.ts index 9b55378..027d7d1 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -1,6 +1,6 @@ import * as ts from "typescript"; import formatter from "./formatter"; -import { createDefaultFormatCodeOptions, parseJSON } from "./utils"; +import { createDefaultFormatCodeSettings, parseJSON } from "./utils"; export { parseJSON }; @@ -24,11 +24,11 @@ export interface Options { } export interface OptionModifier { - (fileName: string, opts: Options, formatOptions: ts.FormatCodeOptions): ts.FormatCodeOptions | Promise; + (fileName: string, opts: Options, formatSettings: ts.FormatCodeSettings): ts.FormatCodeSettings | Promise; } export interface PostProcessor { - (fileName: string, formattedCode: string, opts: Options, formatOptions: ts.FormatCodeOptions): string | Promise; + (fileName: string, formattedCode: string, opts: Options, formatSettings: ts.FormatCodeSettings): string | Promise; } class Processor { @@ -39,34 +39,34 @@ class Processor { this.optionModifiers.push(modifier); } - processFormatCodeOptions(fileName: string, opts: Options, formatOptions: ts.FormatCodeOptions): Promise { + processFormatCodeOptions(fileName: string, opts: Options, formatSettings: ts.FormatCodeSettings): Promise { let optionModifiers = [...this.optionModifiers]; - let next = (formatOptions: ts.FormatCodeOptions): Promise => { + let next = (formatSettings: ts.FormatCodeSettings): Promise => { if (optionModifiers.length === 0) { - return Promise.resolve(formatOptions); + return Promise.resolve(formatSettings); } - let modifier = optionModifiers.shift()!; - let ret = modifier(fileName, opts, formatOptions); - return Promise.resolve(ret).then(formatOptions => next(formatOptions)); + let modifier = optionModifiers.shift() !; + let ret = modifier(fileName, opts, formatSettings); + return Promise.resolve(ret).then(formatSettings => next(formatSettings)); }; - return next(formatOptions); + return next(formatSettings); } addPostProcess(postProcessor: PostProcessor) { this.postProcessors.push(postProcessor); } - postProcess(fileName: string, formattedCode: string, opts: Options, formatOptions: ts.FormatCodeOptions): Promise { + postProcess(fileName: string, formattedCode: string, opts: Options, formatSettings: ts.FormatCodeSettings): Promise { let postProcessors = [...this.postProcessors]; let next = (formattedCode: string): Promise => { if (postProcessors.length === 0) { return Promise.resolve(formattedCode); } - let processor = postProcessors.shift()!; - let ret = processor(fileName, formattedCode, opts, formatOptions); + let processor = postProcessors.shift() !; + let ret = processor(fileName, formattedCode, opts, formatSettings); return Promise.resolve(ret).then(formattedCode => next(formattedCode)); }; @@ -80,7 +80,7 @@ export interface ResultMap { export interface Result { fileName: string; - options: ts.FormatCodeOptions | null; + settings: ts.FormatCodeSettings | null; message: string; error: boolean; src: string; @@ -94,7 +94,7 @@ export function processFiles(files: string[], opts: Options): Promise if (!fs.existsSync(fileName)) { let result: Result = { fileName: fileName, - options: null, + settings: null, message: `${fileName} does not exist. process abort.\n`, error: true, src: "", @@ -148,19 +148,19 @@ export function processString(fileName: string, content: string, opts: Options): processor.addOptionModify(tslintjson); processor.addPostProcess(tslintPostProcess); } - processor.addPostProcess((_fileName: string, formattedCode: string, _opts: Options, formatOptions: ts.FormatCodeOptions) => { + processor.addPostProcess((_fileName: string, formattedCode: string, _opts: Options, formatSettings: ts.FormatCodeSettings) => { // replace newline code. maybe NewLineCharacter params affect to only "new" newline by language service. - formattedCode = formattedCode.replace(/\r?\n/g, formatOptions.NewLineCharacter); + formattedCode = formattedCode.replace(/\r?\n/g, formatSettings.newLineCharacter || "\n"); return Promise.resolve(formattedCode); }); - let formatOptions = createDefaultFormatCodeOptions(); - return processor.processFormatCodeOptions(fileName, opts, formatOptions) - .then(formatOptions => { - let formattedCode = formatter(fileName, content, formatOptions); + let formatSettings = createDefaultFormatCodeSettings(); + return processor.processFormatCodeOptions(fileName, opts, formatSettings) + .then(formatSettings => { + let formattedCode = formatter(fileName, content, formatSettings); // apply post process logic - return processor.postProcess(fileName, formattedCode, opts, formatOptions); + return processor.postProcess(fileName, formattedCode, opts, formatSettings); }).then(formattedCode => { let message = ""; @@ -181,7 +181,7 @@ export function processString(fileName: string, content: string, opts: Options): let result: Result = { fileName: fileName, - options: formatOptions, + settings: formatSettings, message: message, error: error, src: content, diff --git a/lib/provider/base.ts b/lib/provider/base.ts index b2b3ff8..d693732 100644 --- a/lib/provider/base.ts +++ b/lib/provider/base.ts @@ -36,11 +36,11 @@ interface TsfmtSettings { convertTabsToSpaces?: boolean; } -export default function makeFormatCodeOptions(fileName: string, opts: Options, formatOptions: ts.FormatCodeOptions): ts.FormatCodeOptions { +export default function makeFormatCodeOptions(fileName: string, opts: Options, formatSettings: ts.FormatCodeSettings): ts.FormatCodeSettings { let baseDir = opts.baseDir ? path.resolve(opts.baseDir) : path.dirname(path.resolve(fileName)); let configFileName = getConfigFileName(baseDir, "tsfmt.json"); if (!configFileName) { - return formatOptions; + return formatSettings; } if (opts.verbose) { @@ -49,52 +49,52 @@ export default function makeFormatCodeOptions(fileName: string, opts: Options, f let config: TsfmtSettings = parseJSON(fs.readFileSync(configFileName, "utf-8")); if (typeof config.insertSpaceAfterCommaDelimiter === "boolean") { - formatOptions.InsertSpaceAfterCommaDelimiter = config.insertSpaceAfterCommaDelimiter; + formatSettings.insertSpaceAfterCommaDelimiter = config.insertSpaceAfterCommaDelimiter; } if (typeof config.insertSpaceAfterSemicolonInForStatements === "boolean") { - formatOptions.InsertSpaceAfterSemicolonInForStatements = config.insertSpaceAfterSemicolonInForStatements; + formatSettings.insertSpaceAfterSemicolonInForStatements = config.insertSpaceAfterSemicolonInForStatements; } if (typeof config.insertSpaceBeforeAndAfterBinaryOperators === "boolean") { - formatOptions.InsertSpaceBeforeAndAfterBinaryOperators = config.insertSpaceBeforeAndAfterBinaryOperators; + formatSettings.insertSpaceBeforeAndAfterBinaryOperators = config.insertSpaceBeforeAndAfterBinaryOperators; } if (typeof config.insertSpaceAfterKeywordsInControlFlowStatements === "boolean") { - formatOptions.InsertSpaceAfterKeywordsInControlFlowStatements = config.insertSpaceAfterKeywordsInControlFlowStatements; + formatSettings.insertSpaceAfterKeywordsInControlFlowStatements = config.insertSpaceAfterKeywordsInControlFlowStatements; } if (typeof config.insertSpaceAfterFunctionKeywordForAnonymousFunctions === "boolean") { - formatOptions.InsertSpaceAfterFunctionKeywordForAnonymousFunctions = config.insertSpaceAfterFunctionKeywordForAnonymousFunctions; + formatSettings.insertSpaceAfterFunctionKeywordForAnonymousFunctions = config.insertSpaceAfterFunctionKeywordForAnonymousFunctions; } if (typeof config.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis === "boolean") { - formatOptions.InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis = config.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis; + formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis = config.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis; } if (typeof config.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets === "boolean") { - formatOptions.InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets = config.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets; + formatSettings.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets = config.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets; } if (typeof config.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces === "boolean") { - formatOptions.InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces = config.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces; + formatSettings.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces = config.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces; } if (typeof config.placeOpenBraceOnNewLineForFunctions === "boolean") { - formatOptions.PlaceOpenBraceOnNewLineForFunctions = config.placeOpenBraceOnNewLineForFunctions; + formatSettings.placeOpenBraceOnNewLineForFunctions = config.placeOpenBraceOnNewLineForFunctions; } if (typeof config.placeOpenBraceOnNewLineForControlBlocks === "boolean") { - formatOptions.PlaceOpenBraceOnNewLineForControlBlocks = config.placeOpenBraceOnNewLineForControlBlocks; + formatSettings.placeOpenBraceOnNewLineForControlBlocks = config.placeOpenBraceOnNewLineForControlBlocks; } if (typeof config.indentSize === "number") { - formatOptions.IndentSize = config.indentSize; + formatSettings.indentSize = config.indentSize; } if (typeof config.indentStyle === "number") { - formatOptions.IndentStyle = config.indentStyle as number; + formatSettings.indentStyle = config.indentStyle as number; } else if (typeof config.indentStyle === "string") { - formatOptions.IndentStyle = (ts.IndentStyle as any)[config.indentStyle] as number; + formatSettings.indentStyle = (ts.IndentStyle as any)[config.indentStyle] as number; } if (typeof config.tabSize === "number") { - formatOptions.TabSize = config.tabSize; + formatSettings.tabSize = config.tabSize; } if (typeof config.newLineCharacter === "string") { - formatOptions.NewLineCharacter = config.newLineCharacter; + formatSettings.newLineCharacter = config.newLineCharacter; } if (typeof config.convertTabsToSpaces === "boolean") { - formatOptions.ConvertTabsToSpaces = config.convertTabsToSpaces; + formatSettings.convertTabsToSpaces = config.convertTabsToSpaces; } - return formatOptions; + return formatSettings; } diff --git a/lib/provider/editorconfig.ts b/lib/provider/editorconfig.ts index a5999a8..dc9e322 100644 --- a/lib/provider/editorconfig.ts +++ b/lib/provider/editorconfig.ts @@ -6,7 +6,7 @@ import { Options } from "../"; let emitBaseDirWarning = false; -export default function makeFormatCodeOptions(fileName: string, opts: Options, formatOptions: ts.FormatCodeOptions): Promise { +export default function makeFormatCodeOptions(fileName: string, opts: Options, formatSettings: ts.FormatCodeSettings): Promise { if (opts.verbose && opts.baseDir && !emitBaseDirWarning) { console.log("editorconfig is not supported baseDir options"); @@ -17,35 +17,35 @@ export default function makeFormatCodeOptions(fileName: string, opts: Options, f .parse(fileName) .then(config => { if (Object.keys(config).length === 0) { - return formatOptions; + return formatSettings; } if (opts.verbose) { console.log("editorconfig: \n" + "file: " + fileName + "\n" + JSON.stringify(config, null, 2)); } if (config.indent_style === "tab") { - formatOptions.ConvertTabsToSpaces = false; + formatSettings.convertTabsToSpaces = false; // if (typeof config.tab_width === "number") { // options.TabSize = config.tab_width; // } } else if (typeof config.indent_size === "number") { - formatOptions.ConvertTabsToSpaces = true; - formatOptions.IndentSize = config.indent_size; + formatSettings.convertTabsToSpaces = true; + formatSettings.indentSize = config.indent_size; } if (config.end_of_line === "lf") { - formatOptions.NewLineCharacter = "\n"; + formatSettings.newLineCharacter = "\n"; } else if (config.end_of_line === "cr") { - formatOptions.NewLineCharacter = "\r"; + formatSettings.newLineCharacter = "\r"; } else if (config.end_of_line === "crlf") { - formatOptions.NewLineCharacter = "\r\n"; + formatSettings.newLineCharacter = "\r\n"; } - return formatOptions; + return formatSettings; }); } -export function postProcess(fileName: string, formattedCode: string, opts: Options, _formatOptions: ts.FormatCodeOptions): Promise { +export function postProcess(fileName: string, formattedCode: string, opts: Options, _formatSettings: ts.FormatCodeSettings): Promise { if (opts.verbose && opts.baseDir && !emitBaseDirWarning) { console.log("editorconfig is not supported baseDir options"); diff --git a/lib/provider/tsconfigjson.ts b/lib/provider/tsconfigjson.ts index 94e92f4..70a62c3 100644 --- a/lib/provider/tsconfigjson.ts +++ b/lib/provider/tsconfigjson.ts @@ -12,12 +12,12 @@ interface TsconfigSettings { }; } -export default function makeFormatCodeOptions(fileName: string, opts: Options, formatOptions: ts.FormatCodeOptions): ts.FormatCodeOptions { +export default function makeFormatCodeOptions(fileName: string, opts: Options, formatSettings: ts.FormatCodeSettings): ts.FormatCodeSettings { let baseDir = opts.baseDir ? path.resolve(opts.baseDir) : path.dirname(path.resolve(fileName)); let configFileName = getConfigFileName(baseDir, "tsconfig.json"); if (!configFileName) { - return formatOptions; + return formatSettings; } if (opts.verbose) { console.log(`read ${configFileName} for ${fileName}`); @@ -25,14 +25,14 @@ export default function makeFormatCodeOptions(fileName: string, opts: Options, f let config: TsconfigSettings = parseJSON(fs.readFileSync(configFileName, "utf-8")); if (!config.compilerOptions || !config.compilerOptions.newLine) { - return formatOptions; + return formatSettings; } if (config.compilerOptions.newLine.toLowerCase() === "crlf") { - formatOptions.NewLineCharacter = "\r\n"; + formatSettings.newLineCharacter = "\r\n"; } else if (config.compilerOptions.newLine.toLowerCase() === "lf") { - formatOptions.NewLineCharacter = "\n"; + formatSettings.newLineCharacter = "\n"; } - return formatOptions; + return formatSettings; } diff --git a/lib/provider/tslintjson.ts b/lib/provider/tslintjson.ts index 27c8692..997d3e2 100644 --- a/lib/provider/tslintjson.ts +++ b/lib/provider/tslintjson.ts @@ -25,16 +25,16 @@ interface TslintSettings { }; } -export interface AdditionalFormatOptions { - noConsecutiveBlankLines: boolean; +export interface AdditionalFormatSettings { + $noConsecutiveBlankLines: boolean; } -export default function makeFormatCodeOptions(fileName: string, opts: Options, formatOptions: ts.FormatCodeOptions): ts.FormatCodeOptions { +export default function makeFormatCodeOptions(fileName: string, opts: Options, formatSettings: ts.FormatCodeSettings): ts.FormatCodeSettings { let baseDir = opts.baseDir ? path.resolve(opts.baseDir) : path.dirname(path.resolve(fileName)); let configFileName = getConfigFileName(baseDir, "tslint.json"); if (!configFileName) { - return formatOptions; + return formatSettings; } if (opts.verbose) { console.log(`read ${configFileName} for ${fileName}`); @@ -42,37 +42,37 @@ export default function makeFormatCodeOptions(fileName: string, opts: Options, f let config: TslintSettings = parseJSON(fs.readFileSync(configFileName, "utf-8")); if (!config.rules) { - return formatOptions; + return formatSettings; } if (config.rules.indent && config.rules.indent[0]) { if (config.rules.indent[1] === "spaces") { - formatOptions.ConvertTabsToSpaces = true; + formatSettings.convertTabsToSpaces = true; } else if (config.rules.indent[1] === "tabs") { - formatOptions.ConvertTabsToSpaces = false; + formatSettings.convertTabsToSpaces = false; } } if (config.rules.whitespace && config.rules.whitespace[0]) { for (let p in config.rules.whitespace) { let value = config.rules.whitespace[p]; if (value === "check-branch") { - formatOptions.InsertSpaceAfterKeywordsInControlFlowStatements = true; + formatSettings.insertSpaceAfterKeywordsInControlFlowStatements = true; } else if (value === "check-decl") { // none? } else if (value === "check-operator") { - formatOptions.InsertSpaceBeforeAndAfterBinaryOperators = true; + formatSettings.insertSpaceBeforeAndAfterBinaryOperators = true; } else if (value === "check-separator") { - formatOptions.InsertSpaceAfterCommaDelimiter = true; - formatOptions.InsertSpaceAfterSemicolonInForStatements = true; + formatSettings.insertSpaceAfterCommaDelimiter = true; + formatSettings.insertSpaceAfterSemicolonInForStatements = true; } else if (value === "check-type") { // none? } } } - return formatOptions; + return formatSettings; } -export function postProcess(fileName: string, formattedCode: string, opts: Options, _formatOptions: ts.FormatCodeOptions): string { +export function postProcess(fileName: string, formattedCode: string, opts: Options, _formatSettings: ts.FormatCodeSettings): string { let baseDir = opts.baseDir ? path.resolve(opts.baseDir) : path.dirname(path.resolve(fileName)); let configFileName = getConfigFileName(baseDir, "tslint.json"); @@ -85,21 +85,21 @@ export function postProcess(fileName: string, formattedCode: string, opts: Optio return formattedCode; } - let additionalOptions = createDefaultAdditionalFormatCodeOptions(); + let additionalOptions = createDefaultAdditionalFormatCodeSettings(); if (config.rules["no-consecutive-blank-lines"] === true) { - additionalOptions.noConsecutiveBlankLines = true; + additionalOptions.$noConsecutiveBlankLines = true; } - if (additionalOptions.noConsecutiveBlankLines) { + if (additionalOptions.$noConsecutiveBlankLines) { formattedCode = formattedCode.replace(/\n+^$/mg, "\n"); } return formattedCode; } -function createDefaultAdditionalFormatCodeOptions(): AdditionalFormatOptions { +function createDefaultAdditionalFormatCodeSettings(): AdditionalFormatSettings { return { - noConsecutiveBlankLines: false, + $noConsecutiveBlankLines: false, }; } diff --git a/lib/utils.ts b/lib/utils.ts index c844c0d..522b2e4 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -5,24 +5,24 @@ import * as expand from "glob-expand"; import * as fs from "fs"; import * as path from "path"; -export function createDefaultFormatCodeOptions(): ts.FormatCodeOptions { +export function createDefaultFormatCodeSettings(): ts.FormatCodeSettings { return { - IndentSize: 4, - TabSize: 4, - IndentStyle: ts.IndentStyle.Smart, - NewLineCharacter: "\r\n", - ConvertTabsToSpaces: true, - InsertSpaceAfterCommaDelimiter: true, - InsertSpaceAfterSemicolonInForStatements: true, - InsertSpaceBeforeAndAfterBinaryOperators: true, - InsertSpaceAfterKeywordsInControlFlowStatements: true, - InsertSpaceAfterFunctionKeywordForAnonymousFunctions: false, - InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, - InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, - InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, - PlaceOpenBraceOnNewLineForFunctions: false, - PlaceOpenBraceOnNewLineForControlBlocks: false, + indentSize: 4, + tabSize: 4, + indentStyle: ts.IndentStyle.Smart, + newLineCharacter: "\r\n", + convertTabsToSpaces: true, + insertSpaceAfterCommaDelimiter: true, + insertSpaceAfterSemicolonInForStatements: true, + insertSpaceBeforeAndAfterBinaryOperators: true, + insertSpaceAfterKeywordsInControlFlowStatements: true, + insertSpaceAfterFunctionKeywordForAnonymousFunctions: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false, + insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: false, + insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: false, + placeOpenBraceOnNewLineForFunctions: false, + placeOpenBraceOnNewLineForControlBlocks: false, }; } diff --git a/package.json b/package.json index e65162f..6fbeeb3 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "glob-expand": "^0.2.1" }, "peerDependencies": { - "typescript": "^2.0.0 || >=2.1.0-dev" + "typescript": "^2.0.6 || >=2.1.0-dev" }, "devDependencies": { "@types/glob-expand": "^0.0.30", @@ -55,6 +55,6 @@ "mocha": "^3.0.2", "power-assert": "^1.2.0", "tslint": "^3.15.1", - "typescript": "^2.0.3" + "typescript": "^2.0.6" } } diff --git a/test/expected/default/main.json b/test/expected/default/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/default/main.json +++ b/test/expected/default/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/editorconfig/a/main.json b/test/expected/editorconfig/a/main.json index 7d90dbb..29c9f5e 100644 --- a/test/expected/editorconfig/a/main.json +++ b/test/expected/editorconfig/a/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\n", - "ConvertTabsToSpaces": false, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\n", + "convertTabsToSpaces": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/editorconfig/insert_final_newline/main.json b/test/expected/editorconfig/insert_final_newline/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/editorconfig/insert_final_newline/main.json +++ b/test/expected/editorconfig/insert_final_newline/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/editorconfig/newline-cr/main.json b/test/expected/editorconfig/newline-cr/main.json index 0afe42a..87d938f 100644 --- a/test/expected/editorconfig/newline-cr/main.json +++ b/test/expected/editorconfig/newline-cr/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/editorconfig/newline-crlf/main.json b/test/expected/editorconfig/newline-crlf/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/editorconfig/newline-crlf/main.json +++ b/test/expected/editorconfig/newline-crlf/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/editorconfig/newline-lf/main.json b/test/expected/editorconfig/newline-lf/main.json index aa33605..9734eee 100644 --- a/test/expected/editorconfig/newline-lf/main.json +++ b/test/expected/editorconfig/newline-lf/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/editorconfig/space/main.json b/test/expected/editorconfig/space/main.json deleted file mode 100644 index 79ff162..0000000 --- a/test/expected/editorconfig/space/main.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false, - "IndentSize": 8, - "TabSize": 4, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true -} \ No newline at end of file diff --git a/test/expected/editorconfig/tab/main.json b/test/expected/editorconfig/tab/main.json index ca124ed..4eafe49 100644 --- a/test/expected/editorconfig/tab/main.json +++ b/test/expected/editorconfig/tab/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": false, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tsc-version/decorators/main.json b/test/expected/tsc-version/decorators/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tsc-version/decorators/main.json +++ b/test/expected/tsc-version/decorators/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tsconfig/a/main.json b/test/expected/tsconfig/a/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tsconfig/a/main.json +++ b/test/expected/tsconfig/a/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tsconfig/crlf/main.json b/test/expected/tsconfig/crlf/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tsconfig/crlf/main.json +++ b/test/expected/tsconfig/crlf/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tsconfig/lf/main.json b/test/expected/tsconfig/lf/main.json index aa33605..9734eee 100644 --- a/test/expected/tsconfig/lf/main.json +++ b/test/expected/tsconfig/lf/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tsfmt/a/main.json b/test/expected/tsfmt/a/main.json deleted file mode 100644 index bfee9c6..0000000 --- a/test/expected/tsfmt/a/main.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false, - "IndentSize": 1, - "TabSize": 4, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true -} \ No newline at end of file diff --git a/test/expected/tsfmt/b/main.json b/test/expected/tsfmt/b/main.json index 792aa7d..63871a9 100644 --- a/test/expected/tsfmt/b/main.json +++ b/test/expected/tsfmt/b/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 8, - "TabSize": 8, - "IndentStyle": 2, - "NewLineCharacter": "/* \n */", - "ConvertTabsToSpaces": false, - "InsertSpaceAfterCommaDelimiter": false, - "InsertSpaceAfterSemicolonInForStatements": false, - "InsertSpaceBeforeAndAfterBinaryOperators": false, - "InsertSpaceAfterKeywordsInControlFlowStatements": false, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": true, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": true, - "PlaceOpenBraceOnNewLineForControlBlocks": true + "indentSize": 8, + "tabSize": 8, + "indentStyle": 2, + "newLineCharacter": "/* \n */", + "convertTabsToSpaces": false, + "insertSpaceAfterCommaDelimiter": false, + "insertSpaceAfterSemicolonInForStatements": false, + "insertSpaceBeforeAndAfterBinaryOperators": false, + "insertSpaceAfterKeywordsInControlFlowStatements": false, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": true, + "placeOpenBraceOnNewLineForControlBlocks": true } \ No newline at end of file diff --git a/test/expected/tsfmt/c/main.json b/test/expected/tsfmt/c/main.json index fa80827..106020e 100644 --- a/test/expected/tsfmt/c/main.json +++ b/test/expected/tsfmt/c/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 0, - "NewLineCharacter": "\n", - "ConvertTabsToSpaces": false, - "InsertSpaceAfterCommaDelimiter": false, - "InsertSpaceAfterSemicolonInForStatements": false, - "InsertSpaceBeforeAndAfterBinaryOperators": false, - "InsertSpaceAfterKeywordsInControlFlowStatements": false, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": true, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": true, - "PlaceOpenBraceOnNewLineForControlBlocks": true + "indentSize": 4, + "tabSize": 4, + "indentStyle": 0, + "newLineCharacter": "\n", + "convertTabsToSpaces": false, + "insertSpaceAfterCommaDelimiter": false, + "insertSpaceAfterSemicolonInForStatements": false, + "insertSpaceBeforeAndAfterBinaryOperators": false, + "insertSpaceAfterKeywordsInControlFlowStatements": false, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": true, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": true, + "placeOpenBraceOnNewLineForControlBlocks": true } \ No newline at end of file diff --git a/test/expected/tsfmt/d/main.json b/test/expected/tsfmt/d/main.json index 44bc2d6..908a5e4 100644 --- a/test/expected/tsfmt/d/main.json +++ b/test/expected/tsfmt/d/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": true, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tsfmt/e/main.json b/test/expected/tsfmt/e/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tsfmt/e/main.json +++ b/test/expected/tsfmt/e/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/a/main.json b/test/expected/tslint/a/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tslint/a/main.json +++ b/test/expected/tslint/a/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/b/main.json b/test/expected/tslint/b/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tslint/b/main.json +++ b/test/expected/tslint/b/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/indent-tabs/main.json b/test/expected/tslint/indent-tabs/main.json index ca124ed..4eafe49 100644 --- a/test/expected/tslint/indent-tabs/main.json +++ b/test/expected/tslint/indent-tabs/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": false, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": false, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/indent/main.json b/test/expected/tslint/indent/main.json deleted file mode 100644 index 805e775..0000000 --- a/test/expected/tslint/indent/main.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "InsertSpaceAfterCommaDelimiter": false, - "InsertSpaceAfterSemicolonInForStatements": false, - "InsertSpaceBeforeAndAfterBinaryOperators": false, - "InsertSpaceAfterKeywordsInControlFlowStatements": false, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false, - "IndentSize": 6, - "TabSize": 4, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true -} \ No newline at end of file diff --git a/test/expected/tslint/no-consecutive-blank-lines/main.json b/test/expected/tslint/no-consecutive-blank-lines/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tslint/no-consecutive-blank-lines/main.json +++ b/test/expected/tslint/no-consecutive-blank-lines/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/no-trailing-whitespace/main.json b/test/expected/tslint/no-trailing-whitespace/main.json index e042f7b..e3f0dcd 100644 --- a/test/expected/tslint/no-trailing-whitespace/main.json +++ b/test/expected/tslint/no-trailing-whitespace/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/whitespace-check-branch/main.json b/test/expected/tslint/whitespace-check-branch/main.json index 712fd6f..5833220 100644 --- a/test/expected/tslint/whitespace-check-branch/main.json +++ b/test/expected/tslint/whitespace-check-branch/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": false, - "InsertSpaceAfterSemicolonInForStatements": false, - "InsertSpaceBeforeAndAfterBinaryOperators": false, - "InsertSpaceAfterKeywordsInControlFlowStatements": true, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": false, + "insertSpaceAfterSemicolonInForStatements": false, + "insertSpaceBeforeAndAfterBinaryOperators": false, + "insertSpaceAfterKeywordsInControlFlowStatements": true, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/whitespace-check-operator/main.json b/test/expected/tslint/whitespace-check-operator/main.json index 90344c6..a19e0cb 100644 --- a/test/expected/tslint/whitespace-check-operator/main.json +++ b/test/expected/tslint/whitespace-check-operator/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": false, - "InsertSpaceAfterSemicolonInForStatements": false, - "InsertSpaceBeforeAndAfterBinaryOperators": true, - "InsertSpaceAfterKeywordsInControlFlowStatements": false, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": false, + "insertSpaceAfterSemicolonInForStatements": false, + "insertSpaceBeforeAndAfterBinaryOperators": true, + "insertSpaceAfterKeywordsInControlFlowStatements": false, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/expected/tslint/whitespace-check-separator/main.json b/test/expected/tslint/whitespace-check-separator/main.json index 89ff18e..2e65b83 100644 --- a/test/expected/tslint/whitespace-check-separator/main.json +++ b/test/expected/tslint/whitespace-check-separator/main.json @@ -1,17 +1,17 @@ { - "IndentSize": 4, - "TabSize": 4, - "IndentStyle": 2, - "NewLineCharacter": "\r\n", - "ConvertTabsToSpaces": true, - "InsertSpaceAfterCommaDelimiter": true, - "InsertSpaceAfterSemicolonInForStatements": true, - "InsertSpaceBeforeAndAfterBinaryOperators": false, - "InsertSpaceAfterKeywordsInControlFlowStatements": false, - "InsertSpaceAfterFunctionKeywordForAnonymousFunctions": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, - "InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, - "InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, - "PlaceOpenBraceOnNewLineForFunctions": false, - "PlaceOpenBraceOnNewLineForControlBlocks": false + "indentSize": 4, + "tabSize": 4, + "indentStyle": 2, + "newLineCharacter": "\r\n", + "convertTabsToSpaces": true, + "insertSpaceAfterCommaDelimiter": true, + "insertSpaceAfterSemicolonInForStatements": true, + "insertSpaceBeforeAndAfterBinaryOperators": false, + "insertSpaceAfterKeywordsInControlFlowStatements": false, + "insertSpaceAfterFunctionKeywordForAnonymousFunctions": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false, + "insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false, + "insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false, + "placeOpenBraceOnNewLineForFunctions": false, + "placeOpenBraceOnNewLineForControlBlocks": false } \ No newline at end of file diff --git a/test/indexSpec.ts b/test/indexSpec.ts index c1e353d..d778b4e 100644 --- a/test/indexSpec.ts +++ b/test/indexSpec.ts @@ -31,7 +31,7 @@ interface ExecResult { stderr: string; } -function exec(cmd: string, args: string[], options: Object): Promise { +function exec(cmd: string, args: string[], options: childProcess.SpawnOptions): Promise { let process = childProcess.spawn(cmd, args, options); let stdout = ""; @@ -132,14 +132,14 @@ describe("tsfmt test", () => { let expected = fs.readFileSync(expectedTsFileName, "utf-8"); assert(expected === result.dest); - let expectedOptionsFileName = expectedTsFileName.replace(/\.ts$/, ".json"); + let expectedSettingsFileName = expectedTsFileName.replace(/\.ts$/, ".json"); - if (!fs.existsSync(expectedOptionsFileName)) { - fs.writeFileSync(expectedOptionsFileName, JSON.stringify(result.options, null, 2)); + if (!fs.existsSync(expectedSettingsFileName)) { + fs.writeFileSync(expectedSettingsFileName, JSON.stringify(result.settings, null, 2)); } - let expectedOptions = lib.parseJSON(fs.readFileSync(expectedOptionsFileName, "utf-8")); - assert.deepEqual(expectedOptions, result.options); + let expectedSettings = lib.parseJSON(fs.readFileSync(expectedSettingsFileName, "utf-8")); + assert.deepEqual(expectedSettings, result.settings); let tslintConfigName = path.dirname(fileName) + "/tslint.json"; if (!fs.existsSync(tslintConfigName)) {