UNPKG

707 BJavaScriptView Raw
1import fs from 'fs';
2import path from 'path';
3import test from 'tape';
4
5const files = {
6 base: require('../base')
7};
8
9fs.readdirSync(path.join(__dirname, '../rules')).forEach(name => {
10 if (name === 'react.js') {
11 return;
12 }
13
14 files[name] = require(`../rules/${name}`);
15});
16
17Object.keys(files).forEach(name => {
18 const config = files[name];
19
20 test(`${name}: does not reference react`, t => {
21 t.plan(2);
22
23 t.notOk(config.plugins, 'plugins is unspecified');
24
25 // scan rules for react/ and fail if any exist
26 const reactRuleIds = Object.keys(config.rules)
27 .filter(ruleId => ruleId.indexOf('react/') === 0);
28 t.deepEquals(reactRuleIds, [], 'there are no react/ rules');
29 });
30});