securityos/node_modules/eslint-plugin-unused-imports/lib/rules/no-unused-vars.js

24 lines
698 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
/**
* @fileoverview Filter imports from no-unused-vars.
* @author Mikkel Holmer Pedersen <mikkel@holmerp.dk>
*/
"use strict";
const { unusedVarsPredicate } = require("./predicates");
const ruleComposer = require("eslint-rule-composer");
let rule;
try {
const tslint = require("@typescript-eslint/eslint-plugin");
rule = tslint.rules["no-unused-vars"];
} catch (_) {
const eslint = require("eslint");
rule = new eslint.Linter().getRules().get("no-unused-vars");
}
rule.meta.fixable = "code";
rule.meta.docs.url = "https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-vars.md";
module.exports = ruleComposer.filterReports(rule, unusedVarsPredicate);