bestiejs / platform.js

A platform detection library.
https://mths.be/platform
MIT License
3.22k stars 408 forks source link

'define' is not defined no-undef bug #144

Closed amorenew closed 6 years ago

amorenew commented 6 years ago

I got this error when I run any help? Line 1204: 'define' is not defined no-undef Line 1204: 'define' is not defined no-undef Line 1211: 'define' is not defined no-undef

jdalton commented 6 years ago

Hi @amorenew!

It looks like you are running your linter over 3rd-party code. You should tweak your include/exclude rules.

amorenew commented 6 years ago

@jdalton I found a simple fix from here http://requirejs.org/docs/errors.html#mismatch /*global define */ could you just add it to the following code

  // Some AMD build optimizers, like r.js, check for condition patterns like the following:
  /*global define */
  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
jdalton commented 6 years ago

I'm not into linting my project to others standards 😋 Learn to use and configure your tools correctly.