Skip to content
This repository was archived by the owner on Mar 29, 2022. It is now read-only.

Commit 2ebb2d2

Browse files
committed
Use ESLint instead of JSHint
Previously: d7ecb98 and 3b0f037. Now we're on trusty with a newer Node.js.
1 parent 1dbf71b commit 2ebb2d2

File tree

6 files changed

+32
-12
lines changed

6 files changed

+32
-12
lines changed

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true
4+
},
5+
"extends": "eslint:recommended",
6+
"rules": {
7+
"indent": [
8+
"error",
9+
4
10+
],
11+
"linebreak-style": [
12+
"error",
13+
"unix"
14+
],
15+
"quotes": [
16+
"error",
17+
"single"
18+
],
19+
"semi": [
20+
"error",
21+
"always"
22+
]
23+
}
24+
};

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ install:
2323
- pip install -e .
2424
- pip install -r tools/requirements.txt
2525
- tools/vnu.sh install
26-
- tools/jshint.sh install
26+
- tools/eslint.sh install
2727

2828
cache: pip
2929

@@ -43,7 +43,7 @@ script:
4343
# This includes validating an actual HTML report (``showcase.html``).
4444
- tools/vnu.sh run extra_doc/_build/*.html
4545
- tools/css_validator.sh httpolice/reports/html.css
46-
- tools/jshint.sh run httpolice/reports/html.js
46+
- tools/eslint.sh run httpolice/reports/html.js
4747

4848
# Although the main docs (``doc/``) are processed by Read the Docs,
4949
# we still want to check that they are building OK.

HACKING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Maintenance
237237
and changing the version to see if the URL still resolves to 200 (OK).
238238

239239
- Nu Html Checker (in ``tools/vnu.sh``);
240-
- JSHint (in ``tools/jshint.sh``).
240+
- ESLint (in ``tools/eslint.sh``).
241241

242242
#. Check that everything is OK with the new versions.
243243
Maybe some Pylint overrides are no longer necessary, etc.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ include .coveragerc
99
include .isort.cfg
1010
include pylintrc
1111
include pytest.ini
12+
include .eslintrc.js
1213

1314
# Even though Travis only works on a Git repo,
1415
# this file is important as a reference on the build procedure.

httpolice/reports/html.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/* jshint browser: true */
2-
/* jshint -W097 */
3-
41
'use strict';
52

63
function setupNotices() {
@@ -26,12 +23,10 @@ function setupNotices() {
2623
}
2724

2825
function onButtonClick() {
29-
/* jshint -W040 */
3026
this.parentElement.classList.toggle('collapsed');
3127
}
3228

3329
function highlightReferences() {
34-
/* jshint -W040 */
3530
var i, referrers, refs, exchange, target;
3631

3732
// Collect references from all contributing elements within this notice.

tools/jshint.sh renamed to tools/eslint.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -e
44

5-
VERSION=2.9.5
6-
BASE=$HOME/install-jshint
5+
VERSION=4.2.0
6+
BASE=$HOME/install-eslint
77

88
action=$1
99
shift
@@ -13,10 +13,10 @@ case $action in
1313
rm -rf "$BASE"
1414
mkdir "$BASE"
1515
cd "$BASE"
16-
npm install jshint@$VERSION
16+
npm install eslint@$VERSION
1717
;;
1818

1919
run)
20-
"$BASE/node_modules/.bin/jshint" "$@"
20+
"$BASE/node_modules/.bin/eslint" "$@"
2121
;;
2222
esac

0 commit comments

Comments
 (0)