Skip to content

Commit

Permalink
examples,lib,test: switch to code rewrite
Browse files Browse the repository at this point in the history
For more information see: #935
  • Loading branch information
mscdex committed Oct 7, 2020
1 parent 632073f commit f763271
Show file tree
Hide file tree
Showing 129 changed files with 24,519 additions and 5,466 deletions.
22 changes: 22 additions & 0 deletions .eslint-plugins/eslint-plugin-mscdex/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict';

const fs = require('fs');
const path = require('path');

const RULES_DIR = path.join(__dirname, 'rules');

let cache;
module.exports = {
get rules() {
if (!cache) {
cache = {};
const files = fs.readdirSync(RULES_DIR)
.filter(filename => filename.endsWith('.js'));
for (const file of files) {
const name = file.slice(0, -3);
cache[name] = require(path.resolve(RULES_DIR, file));
}
}
return cache;
},
};
Loading

0 comments on commit f763271

Please sign in to comment.