mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-14 16:52:26 +08:00
24 lines
811 B
JavaScript
24 lines
811 B
JavaScript
module.exports = {
|
|
meta: {
|
|
messages: {
|
|
noComponentOnReadyMethod: 'Using the componentOnReady method is not allowed. Use the componentOnReady helper utility in src/utils/helpers.ts instead.',
|
|
},
|
|
},
|
|
create(context) {
|
|
return {
|
|
CallExpression(node) {
|
|
/**
|
|
* We only want to exclude usages of componentOnReady().
|
|
* Checking for the existence of the componentOnReady method
|
|
* is a way of determining if we are in a lazy loaded build
|
|
* or custom elements build, so we want to allow that.
|
|
*/
|
|
const callee = node.callee;
|
|
if (callee.type === 'MemberExpression' && callee.property.name === 'componentOnReady') {
|
|
context.report({ node: node, messageId: 'noComponentOnReadyMethod' });
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|