Skip to content
This repository has been archived by the owner on May 29, 2020. It is now read-only.

Resolve npm audit issues #393

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"rules": {
"curly": [
2,
"multi-line"
],
"keyword-spacing": [
2,
{}
],
"wrap-iife": 2,
"space-before-function-paren": [
2,
"never"
],
"one-var": [
2,
"never"
],
"array-bracket-spacing": [
2,
"never",
{
"singleValue": false
}
],
"space-in-parens": [
2,
"never"
],
"key-spacing": [
2,
{
"beforeColon": false,
"afterColon": true
}
],
"comma-style": [
2,
"last"
],
"operator-linebreak": [
2,
"after"
],
"space-unary-ops": [
2,
{
"words": false,
"nonwords": false
}
],
"camelcase": [
2,
{
"properties": "never"
}
],
"no-with": 2,
"no-multi-str": 2,
"linebreak-style": [
2,
"unix"
],
"indent": [
2,
"tab",
{
"SwitchCase": 1
}
],
"no-mixed-spaces-and-tabs": 2,
"no-trailing-spaces": 2,
"brace-style": [
2,
"stroustrup",
{
"allowSingleLine": true
}
],
"eol-last": 2,
"max-len": [
2,
140
],
"consistent-this": [
2,
"that"
],
"dot-notation": 2,
"valid-jsdoc": [
2,
{ "requireReturn": false, "requireReturnDescription": false, "requireParamDescription": false }
]
}
}
38 changes: 0 additions & 38 deletions .jscs.json

This file was deleted.

5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
language: node_js
sudo: false
node_js:
- "0.12"
- "4"
- "5"
- "6"
- "8"
addons:
apt:
packages:
Expand Down
8 changes: 4 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,16 +371,16 @@ module.exports = function(grunt) {
watch: {
scripts: {
files: '<%= jshint.all %>',
tasks: ['jshint', 'jscs'],
tasks: ['jshint', 'eslint'],
options: {
debounceDelay: 100,
nospawn: true
}
},
},
jscs: {
eslint: {
options: {
config: ".jscs.json",
configFile: '.eslintrc.json'
},
all: ['tasks/*.js']
},
Expand All @@ -390,6 +390,6 @@ module.exports = function(grunt) {
grunt.loadTasks('tasks');

grunt.registerTask('test', ['nodeunit']);
grunt.registerTask('default', ['jshint', 'jscs', 'clean', 'webfont', 'test', 'clean']);
grunt.registerTask('default', ['jshint', 'eslint', 'clean', 'webfont', 'test', 'clean']);

};
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-webfont",
"description": "Ultimate SVG to webfont converter for Grunt.",
"version": "1.7.2",
"version": "1.8.0",
"homepage": "https://github.com/sapegin/grunt-webfont",
"author": {
"name": "Artem Sapegin",
Expand Down Expand Up @@ -30,30 +30,30 @@
"dependencies": {
"async": "~1.5.2",
"chalk": "~1.1.1",
"glob": "~7.0.0",
"glob": "~7.1.4",
"lodash": "~4.17.10",
"memorystream": "~0.3.1",
"mkdirp": "~0.5.1",
"svg2ttf": "~2.1.1",
"svg2ttf": "~4.3.0",
"svgicons2svgfont": "~1.1.0",
"svgo": "~0.6.1",
"svgo": "~1.3.0",
"temp": "~0.8.3",
"ttf2eot": "~1.3.0",
"ttf2woff": "~1.3.0",
"ttf2eot": "~2.0.0",
"ttf2woff": "~2.0.1",
"ttf2woff2": "~2.0.3",
"underscore.string": "~3.2.3",
"underscore.string": "~3.3.5",
"winston": "~2.1.1"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-cli": "~0.1.13",
"grunt": "~1.0.4",
"grunt-cli": "~1.3.2",
"grunt-contrib-clean": "~1.0.0",
"grunt-contrib-jshint": "~0.11.3",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-jscs": "~1.0.0",
"grunt-contrib-jshint": "~2.1.0",
"grunt-contrib-nodeunit": "~2.0.0",
"grunt-contrib-watch": "~1.1.0",
"grunt-eslint": "~22.0.0",
"load-grunt-tasks": "~3.4.0",
"stylus": "~0.53.0",
"stylus": "~0.54.5",
"xml2js": "~0.4.16"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tasks/engines/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ module.exports = function(o, allDone) {
var svg = fs.readFileSync(file, 'utf8');
var svgo = new SVGO();
try {
svgo.optimize(svg, function(res) {
svgo.optimize(svg).then(res => {
var stream = new MemoryStream(res.data, {
writable: false
});
Expand Down
16 changes: 10 additions & 6 deletions tasks/webfont.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ module.exports = function(grunt) {
* Check for `dest` param on either target config or global options object
*/
if (_.isUndefined(params.dest) && _.isUndefined(options.dest)) {
logger.warn('Required property ' + [this.name, this.target, 'dest'].join('.')
+ ' or ' + [this.name, this.target, 'options.dest'].join('.') + ' missing.');
logger.warn('Required property ' + [this.name, this.target, 'dest'].join('.') +
' or ' + [this.name, this.target, 'options.dest'].join('.') + ' missing.');
}

if (options.skip) {
Expand Down Expand Up @@ -399,6 +399,7 @@ module.exports = function(grunt) {

/**
* Gets the codepoints from the set filepath in o.codepointsFile
* @returns {Object} the codepoints, or an empty object if not found
*/
function readCodepointsFromFile(){
if (!o.codepointsFile) return {};
Expand All @@ -420,7 +421,8 @@ module.exports = function(grunt) {
try {
fs.writeFileSync(o.codepointsFile, codepointsToString);
logger.verbose('Codepoints saved to file "' + o.codepointsFile + '".');
} catch (err) {
}
catch (err) {
logger.error(err.message);
}
}
Expand Down Expand Up @@ -741,12 +743,13 @@ module.exports = function(grunt) {
* @param {String} template Template file path
* @param {String} syntax Syntax (bem, bootstrap, etc.)
* @param {String} ext Extention of the template
* @param {Boolean} optional If true, return `undefined` if the template file does not exist, otherwise fail
* @return {Object} {filename: 'Template filename', template: 'Template code'}
*/
function readTemplate(template, syntax, ext, optional) {
var filename = template
? path.resolve(template.replace(path.extname(template), ext))
: path.join(__dirname, 'templates/' + syntax + ext)
var filename = template ?
path.resolve(template.replace(path.extname(template), ext)) :
path.join(__dirname, 'templates/' + syntax + ext)
;
if (fs.existsSync(filename)) {
return {
Expand Down Expand Up @@ -823,6 +826,7 @@ module.exports = function(grunt) {

/**
* Return path of HTML demo file or `null` if feature was disabled
* @returns {String} path of the HTML demo file
*/
function getDemoPath() {
if (!o.htmlDemo) return null;
Expand Down