Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-testing-library

Package Overview
Dependencies
Maintainers
3
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-testing-library - npm Package Compare versions

Comparing version 6.0.0-alpha.4 to 6.0.0-alpha.5

2

package.json
{
"name": "eslint-plugin-testing-library",
"version": "6.0.0-alpha.4",
"version": "6.0.0-alpha.5",
"description": "ESLint rules for Testing Library",

@@ -5,0 +5,0 @@ "keywords": [

@@ -209,3 +209,3 @@ <div align="center">

| ------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------- | --- | ---------------------------------------------------------------------------------- |
| [`await-async-event`](./docs/rules/await-async-event.md) | Enforce promises from async event methods are handled | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
| [`await-async-event`](./docs/rules/await-async-event.md) | Enforce promises from async event methods are handled | 🔧 | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |
| [`await-async-query`](./docs/rules/await-async-query.md) | Enforce promises from async queries to be handled | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |

@@ -212,0 +212,0 @@ | [`await-async-utils`](./docs/rules/await-async-utils.md) | Enforce promises from async utils to be awaited properly | | ![dom-badge][] ![angular-badge][] ![react-badge][] ![vue-badge][] ![marko-badge][] |

@@ -29,2 +29,3 @@ "use strict";

},
fixable: 'code',
schema: [

@@ -63,8 +64,9 @@ {

const functionWrappersNames = [];
function reportUnhandledNode(node, closestCallExpressionNode, messageId = 'awaitAsyncEvent') {
function reportUnhandledNode({ node, closestCallExpression, messageId = 'awaitAsyncEvent', fix, }) {
if (!(0, node_utils_1.isPromiseHandled)(node)) {
context.report({
node: closestCallExpressionNode.callee,
node: closestCallExpression.callee,
messageId,
data: { name: node.name },
fix,
});

@@ -95,3 +97,12 @@ }

if (references.length === 0) {
reportUnhandledNode(node, closestCallExpression);
reportUnhandledNode({
node,
closestCallExpression,
fix: (fixer) => {
if ((0, node_utils_1.isMemberExpression)(node.parent)) {
return fixer.insertTextBefore(node.parent, 'await ');
}
return null;
},
});
}

@@ -101,3 +112,6 @@ else {

if (utils_1.ASTUtils.isIdentifier(reference.identifier)) {
reportUnhandledNode(reference.identifier, closestCallExpression);
reportUnhandledNode({
node: reference.identifier,
closestCallExpression,
});
}

@@ -112,3 +126,10 @@ }

}
reportUnhandledNode(node, closestCallExpression, 'awaitAsyncEventWrapper');
reportUnhandledNode({
node,
closestCallExpression,
messageId: 'awaitAsyncEventWrapper',
fix: (fixer) => {
return fixer.insertTextBefore(node, 'await ');
},
});
}

@@ -115,0 +136,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc