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

minor warnings under firefox / jslint? #775

Closed
gregglind opened this issue Aug 25, 2016 · 4 comments
Closed

minor warnings under firefox / jslint? #775

gregglind opened this issue Aug 25, 2016 · 4 comments

Comments

@gregglind
Copy link
Contributor

when using chai, firefox has several minor complaints

console.log: shield-studies-addon-utils: [JavaScript Warning: "TypeError: variable obj redeclares argument" {file: "resource://gre/modules/commonjs/toolkit/loader.js -> resource://shield-studies-addon-utils/node_modules/chai/lib/chai/utils/expectTypes.js" line: 26 column: 6 source: "  var obj = flag(obj, 'object');
"}]
console.log: shield-studies-addon-utils: [JavaScript Warning: "TypeError: variable msg redeclares argument" {file: "resource://gre/modules/commonjs/toolkit/loader.js -> resource://shield-studies-addon-utils/node_modules/chai/lib/chai/assertion.js" line: 105 column: 10 source: "      var msg = util.getMessage(this, arguments)
"}]

These would have been cause by using eslint with no-redeclare: http://eslint.org/docs/rules/no-redeclare

Solution

  • I will happily submit a patch in about 2 minutes to fix it :)
  • perhaps consider incorporating an eslint step in the build / deploy process.

Thanks!

GL

@gregglind
Copy link
Contributor Author

50278 glind ~/gits/chai [git:775-no-redeclare?]$ eslint "lib/**"

/Users/glind/gits/chai/lib/chai/assertion.js
  107:11  error  'msg' is already defined  no-redeclare

/Users/glind/gits/chai/lib/chai/core/assertions.js
  1763:11  error  'subject' is already defined  no-redeclare

/Users/glind/gits/chai/lib/chai/utils/expectTypes.js
  26:7  error  'obj' is already defined  no-redeclare

/Users/glind/gits/chai/lib/chai/utils/inspect.js
  135:9  error  'name' is already defined        no-redeclare
  136:9  error  'nameSuffix' is already defined  no-redeclare

✖ 5 problems (5 errors, 0 warnings)

gregglind added a commit to gregglind/chai that referenced this issue Aug 25, 2016
@lucasfcosta
Copy link
Member

lucasfcosta commented Aug 25, 2016

Hi @gregglind, thanks for the issue and the PR! I've seen where you work at your GitHub Profile and I'd like to inform you that you currently achieved one of my life goals, which is to work for Mozilla 😄

Well, regarding the issue, we already thought about that and we also talked about it here. But, summarizing, we do plan to add it to our code, but we are planning to move everything we can to separate repositories and to that there (as @keithamus said on the comment I linked). However I feel like we could already start using it, maybe even before 4.x.x.

@meeber @keithamus What do you think about it? Maybe we could reuse the .eslintrc files we've got for other ChaiJS repos.

Thanks again for getting in touch, keep up with the good work you guys have been doing at Mozilla, you are my heroes.

@gregglind
Copy link
Contributor Author

@lucasfcosta, we are always hiring and Brasileiros are welcome! gregglind@m.....com if you want to get in touch!

@keithamus
Copy link
Member

I'd very much like to get eslint working, but IMO I feel like we're better off focussing on splitting out the modules, as each one can be written with a standard code style in mind - than by trying to refactor this codebase to only eventually split it out later.

@meeber meeber closed this as completed in 02725b3 Aug 30, 2016
lucasfcosta pushed a commit to lucasfcosta/chai that referenced this issue Sep 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants