How to use the ci-info.isPR function in ci-info

To help you get started, we’ve selected a few ci-info examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / eslint-plugin-unicorn / rules / expiring-todo-comments.js View on Github external
if (dates.length > 1) {
			uses++;
			context.report({
				node: null,
				loc: comment.loc,
				messageId: MESSAGE_ID_AVOID_MULTIPLE_DATES,
				data: {
					expirationDates: dates.join(', '),
					message: parseTodoMessage(comment.value)
				}
			});
		} else if (dates.length === 1) {
			uses++;
			const [date] = dates;

			const shouldIgnore = options.ignoreDatesOnPullRequests && ci.isPR;
			if (!shouldIgnore && reachedDate(date)) {
				context.report({
					node: null,
					loc: comment.loc,
					messageId: MESSAGE_ID_EXPIRED_TODO,
					data: {
						expirationDate: date,
						message: parseTodoMessage(comment.value)
					}
				});
			}
		}

		if (packageVersions.length > 1) {
			uses++;
			context.report({

ci-info

Get details about the current Continuous Integration environment

MIT
Latest version published 6 months ago

Package Health Score

79 / 100
Full package analysis