mirror of
https://github.com/denoland/deno.git
synced 2025-09-25 19:59:16 +00:00
22 lines
353 B
TypeScript
22 lines
353 B
TypeScript
Deno.test("SourceCode.text", () => {
|
|
const plugin: Deno.lint.Plugin = {
|
|
name: "sample",
|
|
rules: {
|
|
"test": {
|
|
create: (ctx) => {
|
|
ctx.sourceCode.text;
|
|
return {};
|
|
},
|
|
},
|
|
},
|
|
};
|
|
Deno.lint.runPlugin(
|
|
plugin,
|
|
"./test.js",
|
|
`function add(a, b) {
|
|
return a + b;
|
|
}
|
|
|
|
add(1, 2);`,
|
|
);
|
|
});
|