Skip to content

Commit

Permalink
Added eslint rules. Fixed incorrect ES6 use.
Browse files Browse the repository at this point in the history
  • Loading branch information
photonstorm committed Jun 11, 2018
1 parent 5889737 commit 0b89155
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
28 changes: 26 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,41 @@
"es6": true,
"commonjs": true
},
"extends": "eslint:recommended",
"plugins": [
"es5"
],
"extends": [
"eslint:recommended"
],
"globals": {
"WEBGL_RENDERER": true,
"CANVAS_RENDERER": true,
"Phaser": true,
"p2": true,
"process": true,
"ActiveXObject": true
},
"rules": {

"es5/no-arrow-functions": 2,
"es5/no-binary-and-octal-literals": 2,
"es5/no-block-scoping": 2,
"es5/no-classes": 2,
"es5/no-computed-properties": 2,
"es5/no-default-parameters": 2,
"es5/no-destructuring": 2,
"es5/no-es6-static-methods": 2,
"es5/no-for-of": 2,
"es5/no-generators": 2,
"es5/no-modules": 2,
"es5/no-object-super": 2,
"es5/no-rest-parameters": 2,
"es5/no-shorthand-properties": 2,
"es5/no-spread": 2,
"es5/no-template-literals": 2,
"es5/no-typeof-symbol": 2,
"es5/no-unicode-code-point-escape": 2,
"es5/no-unicode-regex": 2,

"no-cond-assign": [ "error", "except-parens" ],
"no-duplicate-case": [ "error" ],

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,13 @@ TODO - Out of Canvas events
* If you set Phaser to use a pre-existing Canvas element it is no longer re-added to the DOM (thanks @NQNStudios)
* The `TweenManager.getTweensOf` method has been fixed to remove a potential endless loop should multiple targets be passed in to it (thanks @cyantree)
* 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)
* Fixed Device.os incorrectly reporting Linux as OS on Android devices (thanks @AleBles)

### Examples, Documentation and TypeScript

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

I personally have also documented the entire Input system, which was 328 classes, properties and methods to describe.
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.

## Version 3.9.0 - Yui - 24th May 2018

Expand Down
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"devDependencies": {
"clean-webpack-plugin": "^0.1.19",
"eslint": "^4.19.1",
"eslint-plugin-es5": "^1.3.1",
"fs-extra": "^6.0.0",
"node-sloc": "^0.1.10",
"uglifyjs-webpack-plugin": "^1.2.5",
Expand Down
2 changes: 1 addition & 1 deletion src/tilemaps/parsers/Parse2DArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var Parse2DArray = function (name, data, tileWidth, tileHeight, insertNull)
{
var tileIndex = parseInt(row[x], 10);

if (Number.isNaN(tileIndex) || tileIndex === -1)
if (isNaN(tileIndex) || tileIndex === -1)
{
tiles[y][x] = insertNull
? null
Expand Down

0 comments on commit 0b89155

Please sign in to comment.