Skip to content

Commit 95707f1

Browse files
committed
Use standard via eslint config.
Update chai, mocha and uglifyjs.
1 parent 903810b commit 95707f1

File tree

7 files changed

+26
-10
lines changed

7 files changed

+26
-10
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
!.eslintrc.js
2+
js/*.min.js
3+
js/vendor
4+
test/vendor

.eslintrc.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
extends: 'standard',
3+
plugins: [
4+
'standard',
5+
'promise'
6+
]
7+
}

js/compile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
// Retrieve the content of the minimal runtime:
1919
var runtime = fs.readFileSync(path.join(__dirname, 'runtime.js'), 'utf8')
2020
// A regular expression to parse templates from script tags in a HTML page:
21-
var regexp = /<script( id="([\w\-]+)")? type="text\/x-tmpl"( id="([\w\-]+)")?>([\s\S]+?)<\/script>/gi
21+
var regexp = /<script( id="([\w-]+)")? type="text\/x-tmpl"( id="([\w-]+)")?>([\s\S]+?)<\/script>/gi
2222
// A regular expression to match the helper function names:
2323
var helperRegexp = new RegExp(
2424
tmpl.helper.match(/\w+(?=\s*=\s*function\s*\()/g).join('\\s*\\(|') + '\\s*\\('

js/tmpl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
;(function ($) {
1818
'use strict'
1919
var tmpl = function (str, data) {
20-
var f = !/[^\w\-\.:]/.test(str)
20+
var f = !/[^\w\-.:]/.test(str)
2121
? tmpl.cache[str] = tmpl.cache[str] || tmpl(tmpl.load(str))
2222
: new Function(// eslint-disable-line no-new-func
2323
tmpl.arg + ',tmpl',

js/tmpl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/tmpl.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,21 @@
1919
},
2020
"license": "MIT",
2121
"devDependencies": {
22-
"chai": "3.5.0",
23-
"mocha": "3.1.0",
24-
"standard": "8.3.0",
25-
"uglify-js": "2.7.3"
22+
"chai": "^4.1.1",
23+
"eslint": "^4.5.0",
24+
"eslint-config-standard": "^10.2.1",
25+
"eslint-plugin-import": "^2.7.0",
26+
"eslint-plugin-node": "^5.1.1",
27+
"eslint-plugin-promise": "^3.5.0",
28+
"eslint-plugin-standard": "^3.0.1",
29+
"mocha": "^3.5.0",
30+
"uglify-js": "^3.0.28"
2631
},
2732
"scripts": {
28-
"lint": "standard js/*.js test/*.js",
33+
"lint": "eslint .",
2934
"unit": "mocha",
3035
"test": "npm run lint && npm run unit",
31-
"build": "cd js && uglifyjs tmpl.js -c -m -o tmpl.min.js --source-map tmpl.min.js.map",
36+
"build": "cd js && uglifyjs tmpl.js -c -m -o tmpl.min.js --source-map url=tmpl.min.js.map",
3237
"preversion": "npm test",
3338
"version": "npm run build && git add -A js",
3439
"postversion": "git push --tags origin master master:gh-pages && npm publish"

0 commit comments

Comments
 (0)