Closed coolassassin closed 2 years ago
This plugin just looks for an eslint-local-rules.js file that exports a rules
property, so your file should be able to register ts-node, require a .ts file, then re-export its result. Let me know how that goes and if it works I can add a note to the README!
@coolassassin && @cletusw ⬇️
// eslint-local-rules/index.js
require("ts-node").register({ transpileOnly: true });
module.exports = require("./rules").default;
// eslint-local-rules/rules.ts
import { Rule } from "eslint";
export default {
"my-rule": {
meta: {
// ...
},
create: (context) => ({
// ...
}),
},
} satisfies Record<string, Rule.RuleModule>;
How can i do same thing but with typescript?