Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

Commit c114395

Browse files
committed
Adding linting for [pretest] and [npm run lint]. bumping to v0.1.0. history entries
1 parent 8cb0e55 commit c114395

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

HISTORY.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
Javascript Module Formats Change History
22
========================================
33

4-
@NEXT@
4+
0.1.0 (2014-03-17)
55
------------------
66

7+
* Adding linting for `pretest` and `npm run lint`.
8+
* [PR #6] improving ES modules detection by using RegExp.
79
* [PR #5] Switch `detect` to `detect(src)`.
810
* [PR #4] improving cjs detection, including export instance detection.
911

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ function extract(src) {
9898
}
9999
} finally {
100100
// very dummy detection process for CommonJS modules
101-
if (typeof context.module.exports === 'function'
102-
|| typeof context.exports === 'function'
103-
|| Object.keys(context.module.exports).length > 0
104-
|| Object.keys(context.exports).length > 0
105-
|| Object.getPrototypeOf(context.module.exports)
106-
|| Object.getPrototypeOf(context.exports)) {
101+
if (typeof context.module.exports === 'function' ||
102+
typeof context.exports === 'function' ||
103+
Object.keys(context.module.exports).length > 0 ||
104+
Object.keys(context.exports).length > 0 ||
105+
Object.getPrototypeOf(context.module.exports) ||
106+
Object.getPrototypeOf(context.exports)) {
107107
mods.push({type: 'cjs'});
108108
}
109109
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-module-formats",
3-
"version": "0.0.2",
3+
"version": "0.1.0",
44
"description": "Detect different types of JavaScript modules formats",
55
"homepage": "https://github.com/yahoo/js-module-formats",
66
"main": "index",
@@ -25,9 +25,12 @@
2525
"mocha": "*",
2626
"mockery": "*",
2727
"xunit-file": "*",
28-
"glob": "^3.2.9"
28+
"glob": "^3.2.9",
29+
"jshint": "^2.4.4"
2930
},
3031
"scripts": {
32+
"lint": "./node_modules/.bin/jshint index.js",
33+
"pretest": "./node_modules/.bin/jshint index.js",
3134
"test": "./node_modules/istanbul/lib/cli.js cover -- ./node_modules/.bin/_mocha test/*.js --reporter spec"
3235
},
3336
"author": {

0 commit comments

Comments
 (0)