Skip to content

Commit 0b89155

Browse files
committed
Added eslint rules. Fixed incorrect ES6 use.
1 parent 5889737 commit 0b89155

5 files changed

Lines changed: 37 additions & 5 deletions

File tree

.eslintrc.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,41 @@
55
"es6": true,
66
"commonjs": true
77
},
8-
"extends": "eslint:recommended",
8+
"plugins": [
9+
"es5"
10+
],
11+
"extends": [
12+
"eslint:recommended"
13+
],
914
"globals": {
1015
"WEBGL_RENDERER": true,
1116
"CANVAS_RENDERER": true,
1217
"Phaser": true,
13-
"p2": true,
1418
"process": true,
1519
"ActiveXObject": true
1620
},
1721
"rules": {
1822

23+
"es5/no-arrow-functions": 2,
24+
"es5/no-binary-and-octal-literals": 2,
25+
"es5/no-block-scoping": 2,
26+
"es5/no-classes": 2,
27+
"es5/no-computed-properties": 2,
28+
"es5/no-default-parameters": 2,
29+
"es5/no-destructuring": 2,
30+
"es5/no-es6-static-methods": 2,
31+
"es5/no-for-of": 2,
32+
"es5/no-generators": 2,
33+
"es5/no-modules": 2,
34+
"es5/no-object-super": 2,
35+
"es5/no-rest-parameters": 2,
36+
"es5/no-shorthand-properties": 2,
37+
"es5/no-spread": 2,
38+
"es5/no-template-literals": 2,
39+
"es5/no-typeof-symbol": 2,
40+
"es5/no-unicode-code-point-escape": 2,
41+
"es5/no-unicode-regex": 2,
42+
1943
"no-cond-assign": [ "error", "except-parens" ],
2044
"no-duplicate-case": [ "error" ],
2145

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,13 @@ TODO - Out of Canvas events
121121
* If you set Phaser to use a pre-existing Canvas element it is no longer re-added to the DOM (thanks @NQNStudios)
122122
* The `TweenManager.getTweensOf` method has been fixed to remove a potential endless loop should multiple targets be passed in to it (thanks @cyantree)
123123
* Interactive Objects inside of Containers would still fire their input events even if the Container (or any ancestor) was set to be invisible. Objects now check their ancestor tree during the input cull and now properly skip input events if not visible. Fix #3620 (thanks @NemoStein)
124+
* Fixed Device.os incorrectly reporting Linux as OS on Android devices (thanks @AleBles)
124125

125126
### Examples, Documentation and TypeScript
126127

127128
Thanks to the work of @hexus we have now documented all of the Math namespace and made good progress on the Game Objects.
128129

129-
I personally have also documented the entire Input system, which was 328 classes, properties and methods to describe.
130+
I personally have also documented the entire Input system, which was 328 classes, properties and methods to describe, as well as lots of other areas.
130131

131132
## Version 3.9.0 - Yui - 24th May 2018
132133

package-lock.json

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"devDependencies": {
4141
"clean-webpack-plugin": "^0.1.19",
4242
"eslint": "^4.19.1",
43+
"eslint-plugin-es5": "^1.3.1",
4344
"fs-extra": "^6.0.0",
4445
"node-sloc": "^0.1.10",
4546
"uglifyjs-webpack-plugin": "^1.2.5",

src/tilemaps/parsers/Parse2DArray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull)
5656
{
5757
var tileIndex = parseInt(row[x], 10);
5858

59-
if (Number.isNaN(tileIndex) || tileIndex === -1)
59+
if (isNaN(tileIndex) || tileIndex === -1)
6060
{
6161
tiles[y][x] = insertNull
6262
? null

0 commit comments

Comments
 (0)