Skip to content

Commit

Permalink
babel and eslint FTW!
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo García Sanz committed Jul 2, 2015
1 parent 4eafd3e commit d103a9c
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
15 changes: 5 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ var through = require('through'),
path = require('path'),
extend = require('extend'),
SVGO = require('svgo'),
react = require('react-tools'),
babel = require('babel'),
_s = require('underscore.string'),
svgo = new SVGO();

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

var settings = {
react: {
es5 : true,
sourceMap : false,
stripTypes: false,
harmony : false
},
babel: {},
svgo : {}
};

Expand Down Expand Up @@ -59,9 +54,9 @@ var transform = function (filename) {
var out = function (svg) {

var source = render(filename, svg.data),
output = react.transform(source, settings.react);
output = babel.transform(source, settings.babel);

stream.queue(output);
stream.queue(output.code);
stream.queue(null);
};

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

extend(settings.react, a.react);
extend(settings.babel, a.babel);
extend(settings.svgo, a.svgo);

svgo = new SVGO(settings.svgo);
Expand Down
52 changes: 30 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"homepage" : "https://github.com/coma/svg-reactify",
"repository" : "https://github.com/coma/svg-reactify",
"main" : "./index.js",
"version" : "1.0.1",
"version" : "1.0.2",
"license" : "MIT",
"private" : false,
"authors" : [
Expand All @@ -19,38 +19,46 @@
"dependencies" : {
"through" : "2.3",
"react" : "0.13",
"react-tools" : "0.13",
"babel" : "5.6",
"svgo" : "0.5",
"extend" : "2",
"extend" : "3.0",
"underscore.string": "3.1"
},
"devDependencies": {
"jsdom" : "5.4",
"mocha" : "2.2",
"should" : "7.0",
"jshint" : "2",
"jshint-stylish": "1"
"jsdom" : "5.4",
"mocha" : "2.2",
"should": "7.0",
"eslint": "0.24"
},
"scripts" : {
"lint": "jshint --verbose --reporter node_modules/jshint-stylish/stylish.js index.js",
"lint": "eslint index.js",
"test": "npm run lint && mocha"
},
"engines" : {
"iojs": ">= 1.0.0",
"node": ">= 0.11.0"
},
"jest" : {
"testDirectoryName" : "test",
"scriptPreprocessor" : "<rootDir>/preprocessor.js",
"testPathDirs" : [
"<rootDir>"
],
"unmockedModulePathPatterns": [
"<rootDir>"
],
"moduleFileExtensions" : [
"jsx",
"js"
]
"eslintConfig" : {
"env" : {
"node": true
},
"rules" : {
"strict" : 0,
"new-cap" : 0,
"eqeqeq" : 2,
"curly" : 2,
"quotes" : [
1,
"single"
],
"no-unreachable" : 2,
"space-before-blocks" : 2,
"space-before-function-paren": 2,
"no-multi-spaces" : 0,
"key-spacing" : 0,
"no-mixed-requires" : 0,
"no-use-before-define" : 0,
"no-underscore-dangle" : 0
}
}
}

0 comments on commit d103a9c

Please sign in to comment.