Skip to content

Commit 7a3a215

Browse files
committed
Lint code using eslint instead of jshint (#72)
Task: https://phabricator.wikimedia.org/T165843
1 parent a464c45 commit 7a3a215

13 files changed

+55
-54
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/**
2+
vendor/**

.eslintrc.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"extends": "wikimedia",
3+
"env": {
4+
"browser": true,
5+
"jquery": true
6+
},
7+
"globals": {
8+
"dataValues": false,
9+
"module": "false",
10+
"util": false,
11+
"wikibase": false
12+
},
13+
"rules": {
14+
"computed-property-spacing": "off",
15+
"indent": "off",
16+
"keyword-spacing": "off",
17+
"no-underscore-dangle": "off",
18+
"no-unused-vars": "off",
19+
"one-var": "off",
20+
"operator-linebreak": "off",
21+
"quote-props": "off",
22+
"space-before-function-paren": "off",
23+
"space-infix-ops": "off",
24+
"valid-jsdoc": "off",
25+
"vars-on-top": "off"
26+
}
27+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
node_modules/
12
vendor/
23
.idea/

.jshintignore

Whitespace-only changes.

.jshintrc

Lines changed: 0 additions & 46 deletions
This file was deleted.

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ php:
55

66
sudo: false
77

8+
before_script:
9+
- nvm install 4
10+
811
script: npm install && npm test
912

1013
notifications:

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"jquery": "^3.2.1"
88
},
99
"devDependencies": {
10-
"jshint": "^2.9.4",
10+
"eslint": "^3.19.0",
11+
"eslint-config-wikimedia": "0.4.0",
1112
"karma": "^1.7.0",
1213
"karma-cli": "^1.0.1",
1314
"karma-phantomjs-launcher": "^1.0.4",
@@ -16,8 +17,8 @@
1617
},
1718
"scripts": {
1819
"postinstall": "composer install",
19-
"test": "npm run jshint && npm run run-tests",
20-
"jshint": "jshint --show-non-errors --verbose src/ tests/",
20+
"test": "npm run eslint && npm run run-tests",
21+
"eslint": "eslint .",
2122
"run-tests": "karma start --single-run"
2223
}
2324
}

src/Property.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ var SELF = wb.datamodel.Property = util.inherit(
103103
}
104104
} );
105105

106-
107106
/**
108107
* @inheritdoc
109108
* @property {string} [TYPE='property']

tests/.eslintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "../.eslintrc.json",
3+
"env": {
4+
"qunit": true
5+
},
6+
"globals": {
7+
"sinon": false
8+
},
9+
"rules": {
10+
"array-bracket-spacing": "off",
11+
"dot-notation": "off",
12+
"no-implicit-coercion": "off"
13+
}
14+
}

tests/ClaimList.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ QUnit.test( 'getPropertyIds()', function( assert ) {
3333

3434
for( var j = 0; j < testSets[i].length; j++ ) {
3535
var propertyId = testSets[i][j].getMainSnak().getPropertyId();
36-
if( $.inArray( propertyId , expectedPropertyIds ) === -1 ) {
36+
if( $.inArray( propertyId, expectedPropertyIds ) === -1 ) {
3737
expectedPropertyIds.push( propertyId );
3838
}
3939
}

0 commit comments

Comments
 (0)