eslint-plugin-jest-dom
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -20,11 +20,17 @@ /** | ||
module.exports.generateRecommendedConfig = rules => { | ||
return Object.entries(rules).reduce( | ||
(memo, [name, rule]) => | ||
rule.meta.docs.recommended | ||
? { ...memo, [`jest-dom/${name}`]: 'error' } | ||
: memo, | ||
{} | ||
); | ||
}; | ||
module.exports.configs = { | ||
recommended: { | ||
plugins: ['jest-dom'], | ||
rules: { | ||
'jest-dom/prefer-checked': 'error', | ||
'jest-dom/prefer-enabled-disabled': 'error', | ||
'jest-dom/prefer-required': 'error', | ||
}, | ||
rules: module.exports.generateRecommendedConfig(module.exports.rules), | ||
}, | ||
}; |
{ | ||
"name": "eslint-plugin-jest-dom", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "lint rules for use with jest-dom", | ||
@@ -18,3 +18,3 @@ "keywords": [ | ||
"dependencies": { | ||
"requireindex": "~1.1.0" | ||
"requireindex": "~1.2.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -37,7 +37,3 @@ # eslint-plugin-jest-dom | ||
{ | ||
"rules": { | ||
"jest-dom/prefer-checked": "error", | ||
"jest-dom/prefer-enabled-disabled": "error", | ||
"jest-dom/prefer-required": "error" | ||
} | ||
"rules": {} | ||
} | ||
@@ -44,0 +40,0 @@ ``` |
@@ -1,2 +0,2 @@ | ||
const { rules } = require('../lib/index'); | ||
const { rules, generateRecommendedConfig, configs } = require('../lib/index'); | ||
@@ -6,1 +6,10 @@ it('should have all the rules', () => { | ||
}); | ||
it('should have a recommended config with recommended rules', () => { | ||
expect( | ||
generateRecommendedConfig({ | ||
good: { meta: { docs: { recommended: true } } }, | ||
bad: { meta: { docs: { recommended: false } } }, | ||
}) | ||
).toEqual({ 'jest-dom/good': 'error' }); | ||
}); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28526
443
89
+ Addedrequireindex@1.2.0(transitive)
- Removedrequireindex@1.1.0(transitive)
Updatedrequireindex@~1.2.0