eslint-plugin-testing-library
Version:
ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library
12 lines (11 loc) • 453 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addAsyncToFunctionFix = void 0;
const addAsyncToFunctionFix = (fixer, ruleFix, functionExpression) => {
if (functionExpression && !functionExpression.async) {
functionExpression.async = true;
return [ruleFix, fixer.insertTextBefore(functionExpression, 'async ')];
}
return ruleFix;
};
exports.addAsyncToFunctionFix = addAsyncToFunctionFix;