Skip to content

Add whitespace-related properties to FormattingOptions #375

@rcjsuen

Description

@rcjsuen
/**
 * Value-object describing what options formatting should use.
 */
interface FormattingOptions {
	/**
	 * Size of a tab in spaces.
	 */
	tabSize: number;

	/**
	 * Prefer spaces over tabs.
	 */
	insertSpaces: boolean;

	/**
	 * Signature for further properties.
	 */
	[key: string]: boolean | number | string;
}

Currently, FormattingOptions only defines two properties. I would like to propose that we add some additional properties (names can be reworded obviously) such as the following:

interface FormattingOptions {
    /**
     * Trim trailing whitespaces on a line.
     */
    trimTrailingWhitespace: boolean;

    /**
     * Insert a newline character at the end of the file if one does not exist.
     */
    insertFinalNewline: boolean;

    /**
     * Trim all newlines after the final newline at the end of the file.
     */
    trimFinalNewlines: boolean;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions