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

Add ignoreSelectors option to block-opening-brace-space-before #4640

Merged
merged 2 commits into from Jun 2, 2020

Conversation

charlessuh
Copy link
Contributor

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

Fixes #4624

Is there anything in the PR that needs further explanation?

No, it's self-explanatory.

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

@charlessuh Thanks for the pull request. It's looking good.

I've made some requests around the tests.

ruleName,
config: ['always', { ignoreAtRules: ['for'] }],
fix: true,
for (const selector of ['for', '/fo/', /fo/]) {
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for cleaning up the tests!

I suggest we remove the for loop and place the array within the config so that it is idomatic with our other test files, like so:

config: ['always', { ignoreAtRules: ['for', '/fo/', /fo/] }],

ruleName,
config: ['always', { ignoreAtRules: '/fo/' }],
fix: true,
for (const selector of ['a', '/a/', /a/]) {
Copy link
Member

Choose a reason for hiding this comment

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

Same here, please. Let's add the array to the config instead of using a loop.

],
});
reject: [
{
Copy link
Member

Choose a reason for hiding this comment

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

I think a single reject test will suffice to show that the option is working as the other parts, e.g. the optionsMatches function, are tested elsewhere. We can use the first test, using b{.

Copy link
Member

@mattxwang mattxwang left a comment

Choose a reason for hiding this comment

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

Just looping back on this, I think overall the PR is good to merge (now that the test feedback was implemented). However, it looks like there's now a merge conflict: @charlessuh, do you mind resolving it (if not, we can).

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

@charlessuh Thank you for making the changes, LGTM.

@malsf21 Thanks for looping back around on this. I didn't get a notification of the amends.

like there's now a merge conflict

I resolved this.

Copy link
Member

@mattxwang mattxwang left a comment

Choose a reason for hiding this comment

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

LGTM!

@m-allanson m-allanson merged commit 617f68e into stylelint:master Jun 2, 2020
@m-allanson
Copy link
Member

Updated changelog:

  • Added: ignoreSelectors[] to block-opening-brace-space-before (#4640)

m-allanson added a commit that referenced this pull request Jun 3, 2020
# By Mike Allanson (6) and others
# Via GitHub
* master:
  Bump @types/lodash from 4.14.152 to 4.14.154 (#4817)
  Update CHANGELOG.md
  Fix with workaround a TypeError thrown for "html" (#4797)
  Update CHANGELOG.md
  Fix false positives for variables in font-family-no-missing-generic-family-keyword (#4806)
  Update CHANGELOG.md
  Add ignoreSelectors option to block-opening-brace-space-before (#4640)
  Update CHANGELOG.md
  Fix error message percentage/number precision for alpha-value-notation (#4802)
  Create new 'createPartialStylelintResult' module (#4815)
  Move function normalizeAllRuleSettings() out to a separate module (#4810)
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.

Add ignoreSelectors: [] to block-opening-brace-space-before
4 participants