UNPKG

eslint-plugin-ie11

Version:

ESLint plugin for detecting unsupported ES6 features in IE11

47 lines (36 loc) 1.34 kB
/** * @fileoverview Cannot use WeakMap or WeakSet (IE11 compatibility) * @author Volox */ "use strict"; //------------------------------------------------------------------------------ // Rule Definition //------------------------------------------------------------------------------ module.exports = { meta: { docs: { description: "Cannot use WeakMap or WeakSet (IE11 compatibility)", category: "Fill me in", recommended: false }, fixable: null, // or "code" or "whitespace" schema: [ // fill in your schema ] }, create: function(context) { // variables should be defined here //---------------------------------------------------------------------- // Helpers //---------------------------------------------------------------------- // any helper functions should go here or else delete this section //---------------------------------------------------------------------- // Public //---------------------------------------------------------------------- return { 'NewExpression[callee.name=/^Weak(Map|Set)$/]': function( node ) { context.report(node.callee, 'Cannot use WeakMap or WeakSet (IE11 compatibility)'); } }; } };