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

Fix the linter errors #77

Merged
merged 3 commits into from
Jun 9, 2017
Merged

Fix the linter errors #77

merged 3 commits into from
Jun 9, 2017

Conversation

pdehaan
Copy link
Collaborator

@pdehaan pdehaan commented Jun 9, 2017

Fixes #76

@pdehaan
Copy link
Collaborator Author

pdehaan commented Jun 9, 2017

This should get us most of the way there...

Currently, running $ npm run lint:html will give you one error:

$ npm run lint:html

> [email protected] lint:html /Users/pdehaan/dev/github/mozilla/something-awesome
> htmllint 'views/*.handlebars'

views/index.handlebars: line 54, col 13, the id "upload-img" is already in use

[htmllint] found 1 errors out of 2 files

And running $ npm run lint:js gives a bunch of warnings. We know we're doing a variable file name and it shouldn't be a security risk, so we can possibly globally disable that rule or do it on a per-instance basis or whatever.

 npm run lint:js

> [email protected] lint:js /Users/pdehaan/dev/github/mozilla/something-awesome
> eslint .


/Users/pdehaan/dev/github/mozilla/something-awesome/frontend/src/download.js
  32:9  warning  Unexpected console statement  no-console

/Users/pdehaan/dev/github/mozilla/something-awesome/frontend/src/fileSender.js
  26:11  warning  Unexpected console statement  no-console
  28:11  warning  Unexpected console statement  no-console

/Users/pdehaan/dev/github/mozilla/something-awesome/server/portal_server.js
  32:3  warning  Found fs.exists with non literal argument at index 0
	32:    storage.exists(id).then(doesExist => {  security/detect-non-literal-fs-filename

/Users/pdehaan/dev/github/mozilla/something-awesome/server/storage.js
   61:5   warning  Found fs.exists with non literal argument at index 0
	61:      redis_client.exists(id, (rediserr, reply) => {                                           security/detect-non-literal-fs-filename
   70:15  warning  Found fs.statSync with non literal argument at index 0
	70:        resolve(fs.statSync(path.join(__dirname, '../static', id)).size);                    security/detect-non-literal-fs-filename
   78:10  warning  Found fs.createReadStream with non literal argument at index 0
	78:    return fs.createReadStream(path.join(__dirname, '../static', id));               security/detect-non-literal-fs-filename
   83:21  warning  Found fs.createWriteStream with non literal argument at index 0
	83:      const fstream = fs.createWriteStream(path.join(__dirname, '../static', id));  security/detect-non-literal-fs-filename
  108:17  warning  Found fs.unlinkSync with non literal argument at index 0
	108:          resolve(fs.unlinkSync(path.join(__dirname, '../static', id)));                  security/detect-non-literal-fs-filename
  117:13  warning  Found fs.unlinkSync with non literal argument at index 0
	117:      resolve(fs.unlinkSync(path.join(__dirname, '../static', id)));                      security/detect-non-literal-fs-filename

✖ 10 problems (0 errors, 10 warnings)

r? @dannycoates

@dannycoates dannycoates merged commit 8baa6d0 into mozilla:master Jun 9, 2017
@pdehaan pdehaan mentioned this pull request Jun 9, 2017
Closed
@pdehaan
Copy link
Collaborator Author

pdehaan commented Jun 9, 2017

Filed one outstanding HTMLLint bug as #82 since it may require a bit of refactorizationment.

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