Skip to content

Commit c6fafca

Browse files
authored
Merge pull request #5 from buildo/deprecate-pipeable
Report deprecation message for pipeable
2 parents 2db3d77 + f9821ee commit c6fafca

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/rules/no-pipeable.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
const messages = {
88
importPipeFromFunction:
99
"The 'pipeable' module is deprecated. Import 'pipe' from the 'function' module instead",
10-
pipeableIsDeprecated: "The 'pipeable' module is deprecated",
10+
pipeableIsDeprecated:
11+
"The 'pipeable' module is deprecated and will be removed in future versions of fp-ts",
1112
} as const;
1213
type MessageIds = keyof typeof messages;
1314

@@ -42,6 +43,11 @@ export function create(
4243
return fixer.replaceText(node.source, `"fp-ts/function"`);
4344
},
4445
});
46+
} else {
47+
context.report({
48+
node: node.source,
49+
messageId: "pipeableIsDeprecated",
50+
});
4551
}
4652
}
4753
}

tests/rules/no-pipeable.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,13 @@ ruleTester.run("no-lib-imports", rule, {
3232
],
3333
output: 'import { pipe } from "fp-ts/function"',
3434
},
35+
{
36+
code: 'import { pipeable } from "fp-ts/pipeable"',
37+
errors: [
38+
{
39+
messageId: "pipeableIsDeprecated",
40+
},
41+
],
42+
},
3543
],
3644
});

0 commit comments

Comments
 (0)