Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Fix a bunch of ESLint and HTMLLint errors #104

Merged
merged 5 commits into from
Jun 22, 2017

Conversation

pdehaan
Copy link
Collaborator

@pdehaan pdehaan commented Jun 20, 2017

Also, try linting code on Circle-CI.

Fixes #82


it('Should pass when the file is successfully uploaded and no bitly key', function() {
conf.bitly_key = null;
const buf = new Buffer(10);
const buf = Buffer.alloc(10);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that new Buffer(<size>) seems to be deprecated: https://nodejs.org/api/buffer.html#buffer_new_buffer_size

security/detect-non-literal-require: warn
security/detect-possible-timing-attacks: warn
security/detect-pseudoRandomBytes: warn
security/detect-unsafe-regex: warn
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are now all in the extended "plugin:security/recommended" ruleset.

@@ -44,7 +45,7 @@
"repository": "mozilla/something-awesome",
"scripts": {
"dev": "watchify frontend/src/main.js -o public/bundle.js -d | node server/portal_server.js",
"format": "prettier 'frontend/src/*.js' 'server/*.js' 'public/*.css' --single-quote --write",
"format": "prettier 'frontend/src/*.js' 'public/*.css' 'server/*.js' 'test/*.js' --single-quote --write",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm run format will now format all the mocha test files in test/*.js.

})
return storage
.delete('file_id', 'delete_token')
.then(_reply => assert(1), err => assert.fail());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't sure how we felt about the .then(yay, boo) syntax versus converting it to .then(yay).catch(boo) style, so I left these as-is.

<div id="upload-img"><img src="/resources/upload.svg" alt="Upload" /></div>
<!-- htmllint tag-bans="$previous" -->
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should "fix" #82 by having htmllint ignore that rule for that block. Although refactoring to use classes or redoing the UI will also fix it for reals.

@dannycoates
Copy link
Contributor

@pdehaan I gave you 'write' to the repo so you can push branches here so we can help fix conflicts easier.

@pdehaan pdehaan force-pushed the clean-eslint branch 2 times, most recently from 6dcb8f8 to db80244 Compare June 21, 2017 21:32
@pdehaan
Copy link
Collaborator Author

pdehaan commented Jun 21, 2017

@dannycoates Any ideas on why my PRs don't seem to be running on Circle-CI?

@dannycoates
Copy link
Contributor

dannycoates commented Jun 21, 2017

Any ideas on why my PRs don't seem to be running on Circle-CI?

Builds from forks were disabled. I've enabled it

@pdehaan
Copy link
Collaborator Author

pdehaan commented Jun 22, 2017

Yay! I failed!
Looks like htmllint really doesn't like Handlebars partials (Ref: htmllint/htmllint#198).
Not sure how to proceed apart from removing htmllint support for the time being.

@dannycoates dannycoates merged commit da8b4ab into mozilla:master Jun 22, 2017
@pdehaan pdehaan mentioned this pull request Jun 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants