Permalink
Browse files

add .editorconfig to enforce indent formatting and code style fixes

  • Loading branch information...
initjh committed May 10, 2015
1 parent 6c7c8ca commit 6e63dfc884b313368622eb049a94ce9ce1326159
Showing with 16 additions and 6 deletions.
  1. +10 −0 .editorconfig
  2. +6 −6 test/htmltojsx-test.js
@@ -0,0 +1,10 @@
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@@ -136,32 +136,32 @@ describe('htmltojsx', function() {
expect(converter.convert('<div style="font-size: 12pt">Test</div>').trim())
.toBe('<div style={{fontSize: \'12pt\'}}>Test</div>');
});
it('should convert vendor-prefix "style" attributes', function() {
it('should convert vendor-prefix "style" attributes', function() {
var converter = new HTMLtoJSX({ createClass: false });
expect(converter.convert('<div style="-moz-hyphens: auto; -webkit-hyphens: auto">Test</div>').trim())
.toBe('<div style={{MozHyphens: \'auto\', WebkitHyphens: \'auto\'}}>Test</div>');
});
it('should convert uppercase vendor-prefix "style" attributes', function() {
it('should convert uppercase vendor-prefix "style" attributes', function() {
var converter = new HTMLtoJSX({ createClass: false });
expect(converter.convert('<div style="-MOZ-HYPHENS: auto; -WEBKIT-HYPHENS: auto">Test</div>').trim())
.toBe('<div style={{MozHyphens: \'auto\', WebkitHyphens: \'auto\'}}>Test</div>');
});
it('should convert "style" attributes with vendor prefix-like strings in the middle and mixed case', function() {
it('should convert "style" attributes with vendor prefix-like strings in the middle and mixed case', function() {
var converter = new HTMLtoJSX({ createClass: false });
expect(converter.convert('<div style="myclass-MOZ-HYPHENS: auto; myclass-WEBKIT-HYPHENS: auto">Test</div>').trim())
.toBe('<div style={{myclassMozHyphens: \'auto\', myclassWebkitHyphens: \'auto\'}}>Test</div>');
});
it('should convert -ms- prefix "style" attributes', function() {
it('should convert -ms- prefix "style" attributes', function() {
var converter = new HTMLtoJSX({ createClass: false });
expect(converter.convert('<div style="-ms-hyphens: auto">Test</div>').trim())
.toBe('<div style={{msHyphens: \'auto\'}}>Test</div>');
});
it('should convert "style" attributes with -ms- in the middle', function() {
it('should convert "style" attributes with -ms- in the middle', function() {
var converter = new HTMLtoJSX({ createClass: false });
expect(converter.convert('<div style="myclass-ms-hyphens: auto">Test</div>').trim())
.toBe('<div style={{myclassMsHyphens: \'auto\'}}>Test</div>');

0 comments on commit 6e63dfc

Please sign in to comment.