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 rule-selector-property-disallowed-list secondary options #6723

Merged

Conversation

mattxwang
Copy link
Member

@mattxwang mattxwang commented Mar 20, 2023

Which issue, if any, is this issue related to?

Closes #6688.

Is there anything in the PR that needs further explanation?

I'm a bit confused why this wasn't caught by the test suite when the rule was first made/messages were added; presumably, I should write a regression test here. Any suggestions?

@changeset-bot
Copy link

changeset-bot bot commented Mar 20, 2023

🦋 Changeset detected

Latest commit: a510502

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mattxwang mattxwang marked this pull request as ready for review March 21, 2023 22:18
@ybiquitous
Copy link
Member

ybiquitous commented Mar 23, 2023

@mattxwang Thanks for creating the pull request!

I'm a bit confused why this wasn't caught by the test suite when the rule was first made/messages were added; presumably, I should write a regression test here. Any suggestions?

Because the current test suite does not specify a message secondary option. If we add a regression test case, the following can be considered:

// lib/rules/rule-selector-property-disallowed-list/__tests__/index.js
testRule({
	ruleName,
	config: [{ a: 'color' }, { message: 'foo' }],

	reject: [
		{
			code: 'a { color: red; }',
			message: 'foo',
			description: 'custom message',
		},
	],
});

Incidentally, how about also fixing the position of in the rule's doc suggested in #6688 (comment)? The second should point the property name instead of the value.

a { color: red; }
/** ↑ ↑
* Selector and property name */

mattxwang and others added 2 commits March 28, 2023 09:01
Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
@mattxwang
Copy link
Member Author

Thanks for the quick response, and sorry for the delay! I confirmed that the test case you suggested catches the bug, and that removing that one line resolves it. Have also updated the doc arrow to point at color!

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

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

Thank you. LGTM 👍🏼

@mattxwang mattxwang merged commit fe4a86f into main Mar 29, 2023
12 checks passed
@mattxwang mattxwang deleted the fix-rule-selector-property-disallowed-list-primary-option branch March 29, 2023 00:03
@ybiquitous
Copy link
Member

(off-topic) Hi @mattxwang,

Since @jeddy3 will be offline for a while (maybe a few months), could you please help me with the repository maintenance when you have time?

@mattxwang
Copy link
Member Author

could you please help me with the repository maintenance when you have time?

Of course! Didn't realize that @jeddy3 is offline. I can certainly review more PRs and help out with dependencies, etc.

@ybiquitous
Copy link
Member

Thank you! 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fix rule-selector-property-disallowed-list secondary options
2 participants