UNPKG

eslint-plugin-ember

Version:
35 lines (27 loc) 783 B
'use strict'; const ember = require('../utils/ember'); //------------------------------------------------------------------------------ // General rule - Don't create new mixins //------------------------------------------------------------------------------ const ERROR_MESSAGE = "Don't create new mixins"; module.exports = { meta: { docs: { description: 'Prevents creation of new mixins', category: 'Best Practices', recommended: true, }, fixable: null, // or "code" or "whitespace" }, ERROR_MESSAGE, create(context) { const filePath = context.getFilename(); return { CallExpression(node) { if (ember.isEmberMixin(node, filePath)) { context.report(node, ERROR_MESSAGE); } }, }; }, };