Skip to content

Commit 5c06e52

Browse files
committed
Switch to ESLint and fix all the lint errors.
1 parent a6377a7 commit 5c06e52

File tree

5 files changed

+64
-2
lines changed

5 files changed

+64
-2
lines changed

.eslintrc

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
// To minimize dependencies on Node- or browser-specific features, leave the
3+
// env empty, and instead define globals as needed.
4+
"env": {},
5+
6+
// Project-wide globals. If other globals are necessary, prefer putting them
7+
// in a comment at the top of the file rather than adding them here.
8+
"globals": {
9+
"console": true,
10+
"module": true,
11+
"require": true,
12+
},
13+
"rules": {
14+
// Enforce "one true brace style", allowing start and end braces to be
15+
// on the same line.
16+
"brace-style": [2, "1tbs", {"allowSingleLine": true}],
17+
18+
// Enforce the name 'self' when assigning `this` to a local variable.
19+
"consistent-this": [0, "self"],
20+
21+
// Enforce two-space indentation.
22+
"indent": [2, 2, {indentSwitchCase: true}],
23+
24+
// Enforce the use of strict mode at the file level.
25+
"global-strict": [2, "always"],
26+
27+
// Allow things like `while(true)`.
28+
"no-constant-condition": 0,
29+
30+
// Allow variable shadowing.
31+
"no-shadow": 0,
32+
33+
// Restrict what kind of objects can be used with 'throw'.
34+
"no-throw-literal": 2,
35+
36+
// Allow identifiers with leading or trailing underscores.
37+
"no-underscore-dangle": 0,
38+
39+
// Allow unused parameters, but not unused variables.
40+
"no-unused-vars": [2, {"vars": "all", "args": "none"}],
41+
42+
// Allow functions to be used before they are defined.
43+
"no-use-before-define": [2, "nofunc"],
44+
45+
// Use single quotes, except when escaping would be necessary.
46+
"quotes": [2, "single", "avoid-escape"],
47+
48+
// Force IIFEs to be wrapped in parentheses.
49+
"wrap-iife": [2, "inside"],
50+
51+
"yoda": [2, "never", {"exceptRange": true}]
52+
}
53+
}

cli.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env node
2+
/* eslint-env node */
3+
4+
'use strict';
25

36
var commander = require('commander'),
47
fs = require('fs'),

index.js

+2
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
'use strict';
2+
13
module.exports = require('./lib/markscript');

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"devDependencies": {
1313
"browserify": "^5.9.1",
1414
"dirwatch": "^1.1.0",
15-
"jshint": "^2.5.2",
15+
"eslint": "^0.17.1",
1616
"tap-spec": "^1.0.1",
1717
"tape": "^2.13.4",
1818
"watchify": "^1.0.1"
@@ -21,7 +21,7 @@
2121
"test": "tape test/*.js | tap-spec",
2222
"test-continuous": "npm test; dirwatch *.js test/*.js -c 'which tput && tput clear; date; tape test/*.js' | tap-spec",
2323
"prepublish": "npm run test && npm run lint",
24-
"lint": "jshint index.js lib test"
24+
"lint": "eslint *.js lib test"
2525
},
2626
"main": "index.js",
2727
"directories": {

test/test-markscript.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/* eslint-env node */
2+
3+
'use strict';
4+
15
var assert = require('assert'),
26
fs = require('fs'),
37
fork = require('child_process').fork,

0 commit comments

Comments
 (0)