Skip to content

Commit d103a9c

Browse files
author
Eduardo García Sanz
committed
babel and eslint FTW!
1 parent 4eafd3e commit d103a9c

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

index.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,15 @@ var through = require('through'),
33
path = require('path'),
44
extend = require('extend'),
55
SVGO = require('svgo'),
6-
react = require('react-tools'),
6+
babel = require('babel'),
77
_s = require('underscore.string'),
88
svgo = new SVGO();
99

1010
var templates = ['all', 'svg', 'icon'],
1111
types = ['svg', 'icon'];
1212

1313
var settings = {
14-
react: {
15-
es5 : true,
16-
sourceMap : false,
17-
stripTypes: false,
18-
harmony : false
19-
},
14+
babel: {},
2015
svgo : {}
2116
};
2217

@@ -59,9 +54,9 @@ var transform = function (filename) {
5954
var out = function (svg) {
6055

6156
var source = render(filename, svg.data),
62-
output = react.transform(source, settings.react);
57+
output = babel.transform(source, settings.babel);
6358

64-
stream.queue(output);
59+
stream.queue(output.code);
6560
stream.queue(null);
6661
};
6762

@@ -78,7 +73,7 @@ module.exports = function (a) {
7873
return transform(a);
7974
}
8075

81-
extend(settings.react, a.react);
76+
extend(settings.babel, a.babel);
8277
extend(settings.svgo, a.svgo);
8378

8479
svgo = new SVGO(settings.svgo);

package.json

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"homepage" : "https://github.com/coma/svg-reactify",
55
"repository" : "https://github.com/coma/svg-reactify",
66
"main" : "./index.js",
7-
"version" : "1.0.1",
7+
"version" : "1.0.2",
88
"license" : "MIT",
99
"private" : false,
1010
"authors" : [
@@ -19,38 +19,46 @@
1919
"dependencies" : {
2020
"through" : "2.3",
2121
"react" : "0.13",
22-
"react-tools" : "0.13",
22+
"babel" : "5.6",
2323
"svgo" : "0.5",
24-
"extend" : "2",
24+
"extend" : "3.0",
2525
"underscore.string": "3.1"
2626
},
2727
"devDependencies": {
28-
"jsdom" : "5.4",
29-
"mocha" : "2.2",
30-
"should" : "7.0",
31-
"jshint" : "2",
32-
"jshint-stylish": "1"
28+
"jsdom" : "5.4",
29+
"mocha" : "2.2",
30+
"should": "7.0",
31+
"eslint": "0.24"
3332
},
3433
"scripts" : {
35-
"lint": "jshint --verbose --reporter node_modules/jshint-stylish/stylish.js index.js",
34+
"lint": "eslint index.js",
3635
"test": "npm run lint && mocha"
3736
},
3837
"engines" : {
3938
"iojs": ">= 1.0.0",
4039
"node": ">= 0.11.0"
4140
},
42-
"jest" : {
43-
"testDirectoryName" : "test",
44-
"scriptPreprocessor" : "<rootDir>/preprocessor.js",
45-
"testPathDirs" : [
46-
"<rootDir>"
47-
],
48-
"unmockedModulePathPatterns": [
49-
"<rootDir>"
50-
],
51-
"moduleFileExtensions" : [
52-
"jsx",
53-
"js"
54-
]
41+
"eslintConfig" : {
42+
"env" : {
43+
"node": true
44+
},
45+
"rules" : {
46+
"strict" : 0,
47+
"new-cap" : 0,
48+
"eqeqeq" : 2,
49+
"curly" : 2,
50+
"quotes" : [
51+
1,
52+
"single"
53+
],
54+
"no-unreachable" : 2,
55+
"space-before-blocks" : 2,
56+
"space-before-function-paren": 2,
57+
"no-multi-spaces" : 0,
58+
"key-spacing" : 0,
59+
"no-mixed-requires" : 0,
60+
"no-use-before-define" : 0,
61+
"no-underscore-dangle" : 0
62+
}
5563
}
5664
}

0 commit comments

Comments
 (0)