2022-08-22 23:46:03 +03:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
const rulesDir = path.join(__dirname, "scripts", "eslint", "rules");
|
2022-10-07 19:50:46 +03:00
|
|
|
const ext = ".cjs";
|
2022-08-22 23:46:03 +03:00
|
|
|
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))];
|
|
|
|
})),
|
|
|
|
};
|