Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test for recommended rule doc notice #1619

Merged
merged 3 commits into from Nov 30, 2021

Conversation

bmish
Copy link
Sponsor Collaborator

@bmish bmish commented Nov 23, 2021

There was a bug in this test so we mistakenly added the recommended rule notice to some rule docs that are not in the recommended config.

The test will now correctly verify that the recommended rules include this notice and non-recommended rules don't.

@@ -236,7 +236,7 @@ test('Every rule has a doc with the appropriate content', t => {
// Decide which notices should be shown at the top of the doc.
const expectedNotices = [];
const unexpectedNotices = [];
if (index.configs.recommended.rules[`unicorn/${ruleName}`]) {
if (index.configs.recommended.rules[`unicorn/${ruleName}`] === 'error') {
expectedNotices.push('configRecommended');
Copy link
Collaborator

Choose a reason for hiding this comment

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

!= 'off',, I believe template-indent was configured as warn.

Copy link
Sponsor Collaborator Author

@bmish bmish Nov 23, 2021

Choose a reason for hiding this comment

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

Thanks, fixed.

Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

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

Had to switch to includes to avoid no-negated-condition.

@bmish
Copy link
Sponsor Collaborator Author

bmish commented Nov 30, 2021

This is ready to be merged.

@sindresorhus sindresorhus merged commit 2108f86 into sindresorhus:main Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants