diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..efad9af --- /dev/null +++ b/.eslintrc @@ -0,0 +1,6 @@ +{ + "extends": "openlayers", + "rules": { + "no-var": "off" + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules diff --git a/index.js b/index.js index e1fae15..f953137 100644 --- a/index.js +++ b/index.js @@ -37,7 +37,7 @@ module.exports = function(fonts, size, lineHeight) { } var weight = 'normal'; var style = 'normal'; - var fontFamilies = [] + var fontFamilies = []; var haveWeight, haveStyle; for (var i = 0, ii = fonts.length; i < ii; ++i) { var font = fonts[i]; @@ -62,7 +62,7 @@ module.exports = function(fonts, size, lineHeight) { weight = maybeWeight; } var fontFamily = parts.join(sp) - .replace('Klokantech Noto Sans', 'Noto Sans'); + .replace('Klokantech Noto Sans', 'Noto Sans'); if (fontFamily.indexOf(sp) !== -1) { fontFamily = '"' + fontFamily + '"'; } @@ -72,4 +72,4 @@ module.exports = function(fonts, size, lineHeight) { cssData = fontCache[fonts] = [style, weight, fontFamilies]; } return cssData[0] + sp + cssData[1] + sp + size + 'px' + (lineHeight ? '/' + lineHeight : '') + sp + cssData[2]; -} +}; diff --git a/package.json b/package.json index ff73e16..dc366bc 100644 --- a/package.json +++ b/package.json @@ -12,5 +12,12 @@ "font" ], "author": "Andreas Hocevar", - "license": "BSD-2-Clause" + "license": "BSD-2-Clause", + "scripts": { + "lint": "eslint *.js" + }, + "devDependencies": { + "eslint": "^5.15.0", + "eslint-config-openlayers": "^11.0.0" + } }