Skip to content

Commit

Permalink
add .editorconfig to enforce indent formatting and code style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
initjh committed May 10, 2015
1 parent 6c7c8ca commit 6e63dfc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
@@ -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
12 changes: 6 additions & 6 deletions test/htmltojsx-test.js
Expand Up @@ -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>');
Expand Down

0 comments on commit 6e63dfc

Please sign in to comment.