eslint-plugin-ie11
Version:
ESLint plugin for detecting unsupported ES6 features in IE11
47 lines (36 loc) • 1.34 kB
JavaScript
/**
* @fileoverview Cannot use WeakMap or WeakSet (IE11 compatibility)
* @author Volox
*/
;
//------------------------------------------------------------------------------
// 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)');
}
};
}
};