Add fake import node register and report

This commit is contained in:
2018-08-23 09:40:10 +05:30
parent 1f0218c87e
commit eb57b28a48
+22 -2
View File
@@ -8,6 +8,12 @@
// Rule Definition // Rule Definition
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
const importNodes = [];
function registerNode(importNode) {
importNodes.push(importNode);
}
module.exports = { module.exports = {
meta: { meta: {
docs: { docs: {
@@ -21,7 +27,7 @@ module.exports = {
] ]
}, },
create: function(context) { create: function (context) {
// variables should be defined here // variables should be defined here
@@ -36,8 +42,22 @@ module.exports = {
//---------------------------------------------------------------------- //----------------------------------------------------------------------
return { return {
ImportDeclaration: function handleImports(node) {
registerNode(node);
},
'Program:exit': function reportAndReset() {
// Calc problems and report stuff here
// give me methods // context.report({
// node: secondNode.node,
// message: message,
// fix: canFix && (fixer =>
// fixer.replaceTextRange(
// [firstRootStart, secondRootEnd],
// newCode + sourceCode.text.substring(firstRootStart, secondRootStart)
// )),
// })
},
}; };
} }