eslint-plugin-jest-dom
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -20,15 +20,11 @@ /** | ||
module.exports.generateRecommendedConfig = rules => { | ||
return Object.entries(rules).reduce( | ||
(memo, [name, rule]) => | ||
rule.meta.docs.recommended ? { ...memo, [name]: 'error' } : memo, | ||
{} | ||
); | ||
}; | ||
module.exports.configs = { | ||
recommended: { | ||
plugins: ['jest-dom'], | ||
rules: module.exports.generateRecommendedConfig(module.exports.rules), | ||
rules: { | ||
'jest-dom/prefer-checked': 'error', | ||
'jest-dom/prefer-enabled-disabled': 'error', | ||
'jest-dom/prefer-required': 'error', | ||
}, | ||
}, | ||
}; |
{ | ||
"name": "eslint-plugin-jest-dom", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "lint rules for use with jest-dom", | ||
@@ -18,3 +18,3 @@ "keywords": [ | ||
"dependencies": { | ||
"requireindex": "~1.2.0" | ||
"requireindex": "~1.1.0" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
# eslint-plugin-jest-dom | ||
[![Build Status](https://travis-ci.org/testing-library/eslint-plugin-jest-dom.svg?branch=master)](https://travis-ci.org/testing-library/eslint-plugin-jest-dom) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-3-orange.svg?style=flat-square)](#contributors) | ||
lint rules for use with jest-dom | ||
lint rules for use with [jest-dom](https://github.com/testing-library/jest-dom). | ||
@@ -35,3 +37,7 @@ ## Installation | ||
{ | ||
"rules": {} | ||
"rules": { | ||
"jest-dom/prefer-checked": "error", | ||
"jest-dom/prefer-enabled-disabled": "error", | ||
"jest-dom/prefer-required": "error" | ||
} | ||
} | ||
@@ -70,1 +76,19 @@ ``` | ||
<!-- __END AUTOGENERATED TABLE__ --> | ||
## Contributors ✨ | ||
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): | ||
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> | ||
<!-- prettier-ignore --> | ||
<table> | ||
<tr> | ||
<td align="center"><a href="https://github.com/benmonro"><img src="https://avatars3.githubusercontent.com/u/399236?v=4" width="100px;" alt="Ben Monro"/><br /><sub><b>Ben Monro</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=benmonro" title="Documentation">📖</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=benmonro" title="Code">💻</a> <a href="#example-benmonro" title="Examples">💡</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=benmonro" title="Tests">⚠️</a></td> | ||
<td align="center"><a href="https://nickmccurdy.com/"><img src="https://avatars0.githubusercontent.com/u/927220?v=4" width="100px;" alt="Nick McCurdy"/><br /><sub><b>Nick McCurdy</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=nickmccurdy" title="Code">💻</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=nickmccurdy" title="Documentation">📖</a> <a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=nickmccurdy" title="Tests">⚠️</a></td> | ||
<td align="center"><a href="https://twitter.com/gnapse"><img src="https://avatars0.githubusercontent.com/u/15199?v=4" width="100px;" alt="Ernesto García"/><br /><sub><b>Ernesto García</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-jest-dom/commits?author=gnapse" title="Documentation">📖</a></td> | ||
</tr> | ||
</table> | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! |
@@ -1,2 +0,2 @@ | ||
const { rules, generateRecommendedConfig, configs } = require('../lib/index'); | ||
const { rules } = require('../lib/index'); | ||
@@ -6,10 +6,1 @@ 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({ 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
27220
21
93
430
+ Addedrequireindex@1.1.0(transitive)
- Removedrequireindex@1.2.0(transitive)
Updatedrequireindex@~1.1.0