Skip to content

Commit

Permalink
fix: remove prefer-exponentiation-operator from recommended config
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Dec 30, 2019
1 parent 4d99075 commit 1d6aad2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion index.js
Expand Up @@ -46,7 +46,6 @@ module.exports = {
'unicorn/prefer-add-event-listener': 'error',
'unicorn/prefer-dataset': 'error',
'unicorn/prefer-event-key': 'error',
'unicorn/prefer-exponentiation-operator': 'error',
'unicorn/prefer-flat-map': 'error',
'unicorn/prefer-includes': 'error',
'unicorn/prefer-modern-dom-apis': 'error',
Expand Down
11 changes: 6 additions & 5 deletions test/package.js
Expand Up @@ -34,21 +34,22 @@ test('Every rule is defined in index file in alphabetical order', t => {
for (const file of ruleFiles) {
const name = path.basename(file, '.js');
t.truthy(index.rules[name], `'${name}' is not exported in 'index.js'`);
t.truthy(index.configs.recommended.rules[`unicorn/${name}`], `'${name}' is not set in the recommended config`);
if (!deprecatedRules.includes(name)) {
t.truthy(index.configs.recommended.rules[`unicorn/${name}`], `'${name}' is not set in the recommended config`);
}

t.truthy(fs.existsSync(path.join('docs/rules', `${name}.md`)), `There is no documentation for '${name}'`);
t.truthy(fs.existsSync(path.join('test', file)), `There are no tests for '${name}'`);
}

console.log(Object.keys(index.rules).length - ignoredRules.length, ruleFiles.length);

t.is(
Object.keys(index.rules).length,
ruleFiles.length,
'There are more exported rules than rule files.'
);
t.is(
Object.keys(index.configs.recommended.rules).length - ignoredRules.length,
ruleFiles.length,
ruleFiles.length - deprecatedRules.length,
'There are more exported rules in the recommended config than rule files.'
);

Expand All @@ -66,7 +67,7 @@ test('Every rule is defined in readme.md usage and list of rules in alphabetical

t.truthy(usageRules, 'List of rules should be defined in readme.md ## Usage and be valid JSON');

const rulesMatch = /## Rules(.*?)## Recommended config/ms.exec(readme);
const rulesMatch = /## Rules(.*?)## Deprecated Rules/ms.exec(readme);
t.truthy(rulesMatch, 'List of rules should be defined in readme.md in ## Rules before ## Recommended config');
const rulesText = rulesMatch[1];
const re = /- \[(.*?)]\((.*?)\) - (.*)\n/gm;
Expand Down

0 comments on commit 1d6aad2

Please sign in to comment.