airbnb / javascript

JavaScript Style Guide
MIT License
144.62k stars 26.45k forks source link

airbnb-base/legacy config incompatible with ES5 #2533

Open rivajunior opened 2 years ago

rivajunior commented 2 years ago

The airbnb-base/legacy configuration is inheriting no-restricted-globals from variables configuration file. But this rule is set to enforce the use of Number.isFinite and Number.isNaN witch are ES6 features and not compatible with ES5 codebase.

{
    'no-restricted-globals': [
      'error',
      {
        name: 'isFinite',
        message:
          'Use Number.isFinite instead https://github.com/airbnb/javascript#standard-library--isfinite',
      },
      {
        name: 'isNaN',
        message:
          'Use Number.isNaN instead https://github.com/airbnb/javascript#standard-library--isnan',
      },
    ].concat(confusingBrowserGlobals),
}
ljharb commented 2 years ago

Thanks! I’ll fix this shortly.

ljharb commented 2 years ago

Although - the legacy config still requires you use all available polyfills, so I’m not sure there’s something to fix.