webcompat / webcompat-reporter-extensions

Browser extensions to help report site compatibilty issues.
26 stars 21 forks source link

Fixes #45 - Added an eslint file for logging all the errs in each add-on directory #64

Closed akhilpandey95 closed 6 years ago

akhilpandey95 commented 7 years ago

The output looks like this : screenshot_2017-01-12_02-47-39

akhilpandey95 commented 7 years ago

r? @miketaylr

akhilpandey95 commented 7 years ago

@miketaylr 2 iquestions : Q1.) Should the eslintrc be removed or not ? Q2.) Should the npm eslint commands in individual add-on directory be updated ?

akhilpandey95 commented 7 years ago

@miketaylr just another thing forgot to say so basically :

logToConsole (someargument, true) // writes the changes to the disk
logToConsole (someargument, false) // doesn't write the changes to the disk

PS : I forgot to delete L13 in .eslint.js

akhilpandey95 commented 7 years ago

@miketaylr noted all the changes will notify you once i am done.

akhilpandey95 commented 7 years ago

@miketaylr I have made all the requested changes, here are some of things which you might be interested to know :

If you type

npm run eslint

w1

If you type

npm run eslint --info

w2

If you type

npm run eslint --writetodisk

w3

If you type

npm run eslint --writetodisk somerandomstring

w4

if you type

npm run eslint --info --writetodisk 

w5

miketaylr commented 7 years ago

Thanks! A few thoughts:

npm run eslint --writetodisk

Why not just make that a boolean flag? Meaning, if you see the flag it means yes, and if you don't see it it means no? Also, --save would be less to write.

Also, it seems like we're doing something similar to https://github.com/ratherblue/eslint-html-reporter#usage here. Perhaps we could either use that, or use it's usage patterns? Note that it uses -o filename, which is a common unix idiom.

By convention, eslint takes a -f custom formatter argument: http://eslint.org/docs/developer-guide/working-with-custom-formatters.

That said, I probably won't use the save functionality, so I won't block merging on that, but if you'd like to go that route we can clean up the CLI API at least.

akhilpandey95 commented 7 years ago

@miketaylr i have implemented the changes, sorry for taking this much time.

akhilpandey95 commented 7 years ago

r? @miketaylr

miketaylr commented 7 years ago

@AkhilHector when I run npm run eslint, I get the following errors:

> webcompat-reporter-extensions@ eslint /Users/miket/dev/compat/addons/webcompat-reporter
> node .eslint.js

[
 Filepath:  /Users/miket/dev/compat/addons/webcompat-reporter/chrome/background.js,
 Errors:  1,
 Warnings:  0,
 Error Message: 0 Parsing error: Unexpected character '`',
 Line, Column:  [21,9]
]
[
 Filepath:  /Users/miket/dev/compat/addons/webcompat-reporter/firefox/background.js,
 Errors:  1,
 Warnings:  0,
 Error Message: 0 Parsing error: Unexpected character '`',
 Line, Column:  [20,9]
]
[
 Filepath:  /Users/miket/dev/compat/addons/webcompat-reporter/opera/background.js,
 Errors:  1,
 Warnings:  0,
 Error Message: 0 Parsing error: Unexpected character '`',
 Line, Column:  [21,9]
]
[
 Filepath:  /Users/miket/dev/compat/addons/webcompat-reporter/.eslint.js,
 Errors:  0,
 Warnings:  1,
]
 Changes saved to the disk: false

Any idea why it's giving an error for a backtick? That's valid in ES6...

akhilpandey95 commented 7 years ago

@miketaylr looks strange i tried pinging you on IRC to get this problem resolved, honestly i dont understand as to why this error is popping up

miketaylr commented 7 years ago

honestly i dont understand as to why this error is popping up

Hm, we should probably do a little research to understand, and have a follow-up commit to fix the issues.

I'm hesitant to merge in the code if eslint is saying there are errors.

akhilpandey95 commented 7 years ago

@miketaylr agreed, let me dig in and look for the reason behind this, give me a day's time

miketaylr commented 6 years ago

Let's close this, I don't think @akhilpandey95 is working on this right now. :)

akhilpandey95 commented 6 years ago

Im sorry @miketaylr. I honestly wanted to help, but i am just occupied with other stuff. Hope i could be helpful to the community some other time. ✌️

miketaylr commented 6 years ago

No worries. Life gets busy. :)