https://github.com/Microsoft/TypeScript
Revision 8ac465239f52de1da3ada8cdc4c3f107f4d62e45 authored by Oleksandr T on 19 October 2022, 19:38:37 UTC, committed by GitHub on 19 October 2022, 19:38:37 UTC
1 parent 245a02c
Raw File
Tip revision: 8ac465239f52de1da3ada8cdc4c3f107f4d62e45 authored by Oleksandr T on 19 October 2022, 19:38:37 UTC
change type (#51231)
Tip revision: 8ac4652
.eslintplugin.js
const fs = require("fs");
const path = require("path");

const rulesDir = path.join(__dirname, "scripts", "eslint", "rules");
const ext = ".cjs";
const ruleFiles = fs.readdirSync(rulesDir).filter((p) => p.endsWith(ext));

module.exports = {
    rules: Object.fromEntries(ruleFiles.map((p) => {
        return [p.slice(0, -ext.length), require(path.join(rulesDir, p))];
    })),
}
back to top