* Lint eslint/* * Run "make fix-js" * Fix remaining problems * Remove linting from subpackages * Remove husky * Add back eslint dep
20 lines
526 B
JavaScript
20 lines
526 B
JavaScript
"use strict";
|
|
|
|
const ruleComposer = require("eslint-rule-composer");
|
|
const eslint = require("eslint");
|
|
const newCapRule = new eslint.Linter().getRules().get("new-cap");
|
|
|
|
/**
|
|
* Returns whether a node is under a decorator or not.
|
|
* @param {ASTNode} node CallExpression node
|
|
* @returns {Boolean} Returns true if the node is under a decorator.
|
|
*/
|
|
function isDecorator(node) {
|
|
return node.parent.type === "Decorator";
|
|
}
|
|
|
|
module.exports = ruleComposer.filterReports(
|
|
newCapRule,
|
|
problem => !isDecorator(problem.node)
|
|
);
|