Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added eslint and fixed all errors #36

Merged
merged 7 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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