Skip to content

Commit

Permalink
Add promise-function-async rule
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Feb 10, 2019
1 parent c7fcf83 commit ff9a8f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Expand Up @@ -180,6 +180,7 @@ module.exports = {
// '@typescript-eslint/prefer-interface': 'error',

'@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/type-annotation-spacing': 'error'
}
Expand Down

3 comments on commit ff9a8f0

@fregante
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is ready for prime time. I tried it on Refined GitHub and it's lighting up a lot of non-promised functions like:

const renderAvatar = image => {
	const src = new URL(image.src);
	src.searchParams.set('s', String(avatarSize * window.devicePixelRatio));
	image.src = src;
	image.width = avatarSize;
	image.height = avatarSize;

	return (
		<a
			href={image.parentElement.href}
			aria-label={image.alt.substr(1)}
			class="tooltipped tooltipped-n avatar-group-item mr-1"
		>
			{image}
		</a>
	);
};
function cleanSearchQuery(query) {
	return query
		.replace(/\bis:(pr|issue)\b/gi, '')
		.replace(/\s{2,}/g, ' ').trim();
}

@sindresorhus
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fregante
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Please sign in to comment.