editorconfig-to-prettier
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -21,3 +21,3 @@ module.exports = editorConfigToPrettier; | ||
result.tabWidth = editorConfig.indent_size; | ||
} else if (tabWidth) { | ||
} else if (tabWidth !== undefined) { | ||
result.tabWidth = tabWidth; | ||
@@ -24,0 +24,0 @@ } |
{ | ||
"name": "editorconfig-to-prettier", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Converts an `editorconfig`-parsed object to a `prettier` configuration", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "prettier --list-different *.js", | ||
"fix": "prettier --write *.js", | ||
"pretest": "npm run lint", | ||
"test": "node test" | ||
@@ -18,3 +21,6 @@ }, | ||
}, | ||
"homepage": "https://github.com/josephfrazier/editorconfig-to-prettier#readme" | ||
"homepage": "https://github.com/josephfrazier/editorconfig-to-prettier#readme", | ||
"devDependencies": { | ||
"prettier": "^1.7.4" | ||
} | ||
} |
83
test.js
@@ -1,36 +0,55 @@ | ||
const assert = require('assert'); | ||
const assert = require("assert"); | ||
const editorconfigToPrettier = require('./'); | ||
const editorconfigToPrettier = require("./"); | ||
assert.deepStrictEqual(editorconfigToPrettier({ | ||
indent_style: 'tab', | ||
tab_width: 8, | ||
indent_size: 2, | ||
max_line_length: 100 | ||
}), { | ||
useTabs: true, | ||
tabWidth: 8, | ||
printWidth: 100 | ||
}) | ||
assert.deepStrictEqual( | ||
editorconfigToPrettier({ | ||
indent_style: "tab", | ||
tab_width: 8, | ||
indent_size: 2, | ||
max_line_length: 100 | ||
}), | ||
{ | ||
useTabs: true, | ||
tabWidth: 8, | ||
printWidth: 100 | ||
} | ||
); | ||
assert.deepStrictEqual(editorconfigToPrettier({ | ||
indent_style: 'space', | ||
tab_width: 8, | ||
indent_size: 2, | ||
max_line_length: 100 | ||
}), { | ||
useTabs: false, | ||
tabWidth: 2, | ||
printWidth: 100 | ||
}) | ||
assert.deepStrictEqual( | ||
editorconfigToPrettier({ | ||
indent_style: "space", | ||
tab_width: 8, | ||
indent_size: 2, | ||
max_line_length: 100 | ||
}), | ||
{ | ||
useTabs: false, | ||
tabWidth: 2, | ||
printWidth: 100 | ||
} | ||
); | ||
assert.deepStrictEqual(editorconfigToPrettier({ | ||
indent_style: 'space', | ||
tab_width: 8, | ||
indent_size: 8, | ||
max_line_length: 100 | ||
}), { | ||
useTabs: false, | ||
tabWidth: 8, | ||
printWidth: 100 | ||
}) | ||
assert.deepStrictEqual( | ||
editorconfigToPrettier({ | ||
indent_style: "space", | ||
tab_width: 8, | ||
indent_size: 8, | ||
max_line_length: 100 | ||
}), | ||
{ | ||
useTabs: false, | ||
tabWidth: 8, | ||
printWidth: 100 | ||
} | ||
); | ||
assert.deepStrictEqual( | ||
editorconfigToPrettier({ | ||
tab_width: 0, | ||
indent_size: 0 | ||
}), | ||
{ | ||
tabWidth: 0 | ||
} | ||
); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2632
4
74
1