Skip to content

Commit

Permalink
Use eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
bfirsh committed May 22, 2018
1 parent 8f5c708 commit 8d6c72e
Show file tree
Hide file tree
Showing 8 changed files with 665 additions and 149 deletions.
13 changes: 13 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"browser": true,
"node": true,
"es6": true,
"commonjs": true
},
"extends": ["eslint:recommended", "prettier"],
"rules": {
"eqeqeq": ["error", "always"],
"no-alert": "error"
}
}
12 changes: 0 additions & 12 deletions .jshintrc

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
},
"devDependencies": {
"chai": "^4.1.2",
"jshint": "^2.9.5",
"jshint-loader": "^0.8.4",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-loader": "^2.0.0",
"mocha": "^5.0.0",
"prettier": "^1.12.1",
"prettier-check": "^2.0.0",
Expand Down
3 changes: 2 additions & 1 deletion src/mappers.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ Mappers[0].prototype = {
// Does nothing. This is used by the MMC3 mapper.
},

// eslint-disable-next-line no-unused-vars
latchAccess: function(address) {
// Does nothing. This is used by MMC2.
},
Expand Down Expand Up @@ -741,6 +742,7 @@ Mappers[1].prototype.loadROM = function() {
this.nes.cpu.requestIrq(this.nes.cpu.IRQ_RESET);
};

// eslint-disable-next-line no-unused-vars
Mappers[1].prototype.switchLowHighPrgRom = function(oldSetting) {
// not yet.
};
Expand Down Expand Up @@ -1362,7 +1364,6 @@ Mappers[34].prototype.write = function(address, value) {
*/
Mappers[66] = function(nes) {
this.nes = nes;
console.log("Mapper 66");
};

Mappers[66].prototype = new Mappers[0]();
Expand Down
2 changes: 2 additions & 0 deletions src/papu.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ PAPU.prototype = {
this.minSample = 500000;
},

// eslint-disable-next-line no-unused-vars
readReg: function(address) {
// Read 0x4015:
var tmp = 0;
Expand Down Expand Up @@ -1300,6 +1301,7 @@ ChannelTriangle.prototype = {
return this.lengthCounter === 0 || !this.isEnabled ? 0 : 1;
},

// eslint-disable-next-line no-unused-vars
readReg: function(address) {
return 0;
},
Expand Down
8 changes: 1 addition & 7 deletions src/ppu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,6 @@ PPU.prototype = {
var tIndexAdd = this.f_spPatternTable === 0 ? 0 : 256;
var x, y, t, i;
var bufferIndex;
var col;
var bgPri;

x = this.sprX[0];
y = this.sprY[0] + 1;
Expand All @@ -1164,8 +1162,6 @@ PPU.prototype = {
// Sprite is in range.
// Draw scanline:
t = this.ptTile[this.sprTile[0] + tIndexAdd];
col = this.sprCol[0];
bgPri = this.bgPriority[0];

if (this.vertFlip[0]) {
toffset = 7 - (scan - y);
Expand Down Expand Up @@ -1248,8 +1244,6 @@ PPU.prototype = {
}
}
toffset *= 8;
col = this.sprCol[0];
bgPri = this.bgPriority[0];

bufferIndex = scan * 256 + x;
if (this.horiFlip[0]) {
Expand Down Expand Up @@ -1575,7 +1569,7 @@ NameTable.prototype = {
tx = basex + sqx * 2 + x;
ty = basey + sqy * 2 + y;
attindex = ty * this.width + tx;
this.attrib[ty * this.width + tx] = (add << 2) & 12;
this.attrib[attindex] = (add << 2) & 12;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
exclude: /node_modules/,
use: [
{
loader: "jshint-loader"
loader: "eslint-loader"
}
]
}
Expand Down
Loading

0 comments on commit 8d6c72e

Please sign in to comment.