eslint-plugin-rxjs
Version:
ESLint rules for RxJS
40 lines (39 loc) • 1.19 kB
JavaScript
;
const utils_1 = require("../utils");
const rule = (0, utils_1.ruleCreator)({
defaultOptions: [],
meta: {
deprecated: true,
docs: {
description: "Forbids the use of the `tap` operator.",
recommended: false,
},
fixable: undefined,
hasSuggestions: false,
messages: {
forbidden: "The tap operator is forbidden.",
},
replacedBy: ["ban-operators"],
schema: [],
type: "problem",
},
name: "no-tap",
create: (context) => {
return {
[String.raw `ImportDeclaration[source.value=/^rxjs(\u002foperators)?$/] > ImportSpecifier[imported.name='tap']`]: (node) => {
const { loc } = node;
context.report({
messageId: "forbidden",
loc: {
...loc,
end: {
...loc.start,
column: loc.start.column + 3,
},
},
});
},
};
},
});
module.exports = rule;