Skip to main content

Add a new polyfill

About 2 mindevelopment

Add a new polyfill

Style and standards

The coding style should follow our ESlint configurationopen in new window. You can test it by calling npm run lint. Different places have different syntax and standard library limitations:

  • Polyfill implementations should use only ES3 syntax and standard library, they should not use other polyfills from the global scope.
  • Unit tests should use the modern syntax with our minimalistic Babel configopen in new window. Unit tests for the pure version should not use any modern standard library features.
  • Tools, scripts and tests, performed in NodeJS, should use only the syntax and the standard library available in NodeJS 8.

File names should be in the kebab-case. Name of polyfill modules should follow the naming convention namespace.subnamespace-where-required.feature-name, for example, esnext.set.intersection. The top-level namespace should be es for stable ECMAScript features, esnext for ECMAScript proposals and web for other web standards.