1 | import fs from 'fs';
|
2 | import path from 'path';
|
3 | import test from 'tape';
|
4 |
|
5 | const files = {
|
6 | base: require('../base')
|
7 | };
|
8 |
|
9 | fs.readdirSync(path.join(__dirname, '../rules')).forEach(name => {
|
10 | if (name === 'react.js') {
|
11 | return;
|
12 | }
|
13 |
|
14 | files[name] = require(`../rules/${name}`);
|
15 | });
|
16 |
|
17 | Object.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 |
|
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 | });
|