Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
Support indent_size = 0
Browse files Browse the repository at this point in the history
The tests were derived by running `editorconfig index.js` with an
`.editorconfig` file containing:

    [*]
    indent_size = 0

and converting the output to JSON.

Closes #1
  • Loading branch information
josephfrazier committed Nov 12, 2017
1 parent bd4621c commit c38b84c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -18,7 +18,7 @@ function editorConfigToPrettier(editorConfig) {
editorConfig.indent_size !== "tab"
) {
result.tabWidth = editorConfig.indent_size;
} else if (tabWidth) {
} else if (tabWidth !== undefined) {
result.tabWidth = tabWidth;
}

Expand Down
10 changes: 10 additions & 0 deletions test.js
Expand Up @@ -43,3 +43,13 @@ assert.deepStrictEqual(
printWidth: 100
}
);

assert.deepStrictEqual(
editorconfigToPrettier({
tab_width: 0,
indent_size: 0
}),
{
tabWidth: 0
}
);

0 comments on commit c38b84c

Please sign in to comment.