mirror of
https://github.com/bendtherules/eslint-plugin-import-grouped.git
synced 2026-08-18 13:43:19 +00:00
Add fake import node register and report
This commit is contained in:
@@ -8,6 +8,12 @@
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
const importNodes = [];
|
||||
function registerNode(importNode) {
|
||||
importNodes.push(importNode);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
docs: {
|
||||
@@ -36,8 +42,22 @@ module.exports = {
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
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)
|
||||
// )),
|
||||
// })
|
||||
},
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user