not-an-aardvark / eslint-rule-composer

A utility for composing ESLint rules from other ESLint rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Get filename when using filterReports

ewanharris opened this issue · comments

Hey there!

I'm trying to override the no-unused-vars rule to lookup declared functions used in an XML file (example given below), to get the XML file contents I need to know the name of the file that the report is for.

Is there a way to do this using filterReports?

Example:

view/index.xml

<Window title="Console" onOpen="showLogs">
</Window>

controllers/index.js

function showLogs(e) { // should not report unused
 // do things
}
const x = 'unused'; // should report unused

Hi, thanks for creating an issue. This isn't currently possible to do with filterReports, but I would accept a pull request that adds a filename property to the metadata object from filterReports.