eslint-plugin-testing-library
Advanced tools
Comparing version 3.6.0 to 3.7.0
{ | ||
"name": "eslint-plugin-testing-library", | ||
"version": "3.6.0", | ||
"version": "3.7.0", | ||
"description": "ESLint rules for Testing Library", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -26,3 +26,3 @@ <div align="center"> | ||
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-30-orange.svg?style=flat-square)](#contributors-) | ||
[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors-) | ||
<!-- ALL-CONTRIBUTORS-BADGE:END --> | ||
@@ -220,2 +220,3 @@ | ||
<td align="center"><a href="http://aless.co"><img src="https://avatars0.githubusercontent.com/u/5139846?v=4" width="100px;" alt=""/><br /><sub><b>Alessia Bellisario</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=alessbell" title="Code">💻</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=alessbell" title="Tests">⚠️</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=alessbell" title="Documentation">📖</a></td> | ||
<td align="center"><a href="https://skovy.dev"><img src="https://avatars1.githubusercontent.com/u/5247455?v=4" width="100px;" alt=""/><br /><sub><b>Spencer Miskoviak</b></sub></a><br /><a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=skovy" title="Code">💻</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=skovy" title="Tests">⚠️</a> <a href="https://github.com/testing-library/eslint-plugin-testing-library/commits?author=skovy" title="Documentation">📖</a></td> | ||
</tr> | ||
@@ -222,0 +223,0 @@ </table> |
@@ -26,2 +26,3 @@ "use strict"; | ||
preferExplicitAssert: 'Wrap stand-alone `getBy*` query with `expect` function for better explicit assertion', | ||
preferExplicitAssertAssertion: '`getBy*` queries must be asserted with `{{assertion}}`', | ||
}, | ||
@@ -32,3 +33,7 @@ fixable: null, | ||
type: 'object', | ||
additionalProperties: false, | ||
properties: { | ||
assertion: { | ||
type: 'string', | ||
}, | ||
customQueryNames: { | ||
@@ -48,3 +53,3 @@ type: 'array', | ||
var options = _a[0]; | ||
var customQueryNames = options.customQueryNames; | ||
var customQueryNames = options.customQueryNames, assertion = options.assertion; | ||
var getQueryCalls = []; | ||
@@ -68,2 +73,16 @@ return { | ||
} | ||
else if (assertion) { | ||
var expectation = node.parent.parent.parent; | ||
if (expectation.type === 'MemberExpression' && | ||
expectation.property.type === 'Identifier' && | ||
expectation.property.name !== assertion) { | ||
context.report({ | ||
node: expectation.property, | ||
messageId: 'preferExplicitAssertAssertion', | ||
data: { | ||
assertion: assertion, | ||
}, | ||
}); | ||
} | ||
} | ||
}); | ||
@@ -70,0 +89,0 @@ }, |
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
102809
1678
228