Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 3850712

Browse files
author
Hans Kristian Flaatten
committed
feat(jshint): add Airbnb JavaScript Style JSHinting
1 parent 4785ccb commit 3850712

File tree

2 files changed

+65
-0
lines changed

2 files changed

+65
-0
lines changed

.jshintrc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
/*
3+
* ENVIRONMENTS
4+
* =================
5+
*/
6+
7+
// Define globals exposed by modern browsers.
8+
"browser": true,
9+
10+
// Define globals exposed by jQuery.
11+
"jquery": true,
12+
13+
// Define globals exposed by Node.js.
14+
"node": true,
15+
"mocha": true,
16+
17+
// Allow ES6.
18+
"esnext": false,
19+
20+
/*
21+
* ENFORCING OPTIONS
22+
* =================
23+
*/
24+
25+
// Force all variable names to use either camelCase style or UPPER_CASE
26+
// with underscores.
27+
"camelcase": true,
28+
29+
// Prohibit use of == and != in favor of === and !==.
30+
"eqeqeq": true,
31+
32+
// Enforce tab width of 2 spaces.
33+
"indent": 2,
34+
35+
// Prohibit use of a variable before it is defined.
36+
"latedef": true,
37+
38+
// Enforce line length to 80 characters
39+
"maxlen": 80,
40+
41+
// Require capitalized names for constructor functions.
42+
"newcap": true,
43+
44+
// Enforce use of single quotation marks for strings.
45+
"quotmark": "single",
46+
47+
// Enforce placing 'use strict' at the top function scope
48+
"strict": true,
49+
50+
// Prohibit use of explicitly undeclared variables.
51+
"undef": true,
52+
53+
// Warn when variables are defined but never used.
54+
"unused": true,
55+
56+
/*
57+
* RELAXING OPTIONS
58+
* =================
59+
*/
60+
61+
// Suppress warnings about == null comparisons.
62+
"eqnull": true
63+
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"test": "test"
1414
},
1515
"scripts": {
16+
"lint": "jshint index.js test.js",
1617
"watch": "mocha -w -b -c --check-leaks -R progress test.js",
1718
"test": "mocha -b -c --check-leaks -R spec test.js"
1819
},
@@ -36,6 +37,7 @@
3637
},
3738
"homepage": "https://github.com/Turistforeningen/node-mongo-querystring",
3839
"devDependencies": {
40+
"jshint": "^2.8.0",
3941
"mocha": "^2.3.4"
4042
}
4143
}

0 commit comments

Comments
 (0)