Skip to content

Commit

Permalink
Added eslint and fixed all errors (#36)
Browse files Browse the repository at this point in the history
* Added eslint and fixed all errors

* Moved eslint ignores

* Fixed some request changes

* Added exported clauses

* Fixed config error

* Moved eslint configurations around and added comments
  • Loading branch information
rhbvkleef authored and Versatilus committed Mar 22, 2018
1 parent c4a2302 commit b1e95b4
Show file tree
Hide file tree
Showing 7 changed files with 1,666 additions and 17 deletions.
82 changes: 82 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"env": {
"browser": true,
"es6": true
},
"globals": {
"p5": true,
"assert": true,
"expect": true,
"sinon": true,
"birdSprite": true,
"pipePeakSprite": true,
"pipeBodySprite": true,
"Bird": true,
"Pipe": true,
},
"extends": [
"eslint:recommended",
"p5js",
"p5js/dom"
],
"rules": {
"arrow-parens": [
"error"
],
"brace-style": [
"error",
"1tbs"
],
"comma-dangle": [
"error",
"only-multiline"
],
"keyword-spacing": [
"error",
{
"before": true,
"after": true
}
],
"max-len":[
"error",
{
"code": 100,
"ignoreUrls": true
},
],
"max-params": [
"error",
6
],
"no-cond-assign": [
2,
"except-parens"
],
"eqeqeq": ["error", "smart"],
"no-use-before-define": [
2,
{
"functions": false
}
],
"new-cap": 0,
"no-caller": 2,
"no-undef": 2,
"no-unused-vars": ["error", { "args": "none" }],
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-console": "off",
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"space-before-blocks": [
"error",
"always"
]
},
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
5 changes: 4 additions & 1 deletion bird.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// http://patreon.com/codingtrain
// Code for: https://youtu.be/cXgA1d_E-jY

// Class is exported (eslint flag)
/* exported Bird */

class Bird {
constructor() {
this.y = height / 2;
Expand All @@ -19,7 +22,7 @@ class Bird {

show() {
// draw the icon CENTERED around the X and Y coords of the bird object
image(this.icon, this.x - (this.width / 2), this.y - (this.height / 2), this.width, this.height);
image(this.icon, this.x - this.width / 2, this.y - this.height / 2, this.width, this.height);
}

up() {
Expand Down
Loading

0 comments on commit b1e95b4

Please sign in to comment.