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 false positives for "/" in function-whitespace-after #3132

Closed
dsine-de opened this Issue Jan 17, 2018 · 4 comments

Comments

2 participants
@dsine-de

dsine-de commented Jan 17, 2018

Allow "/" as an allowed character in the "function-whitespace-after" rule to allow e.g. line-height shorthand value in "font" property.

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

function-whitespace-after

What CSS is needed to reproduce this issue?

.foo {
  font: calc(16px + .2vw)/1 sans-serif;
}

What stylelint configuration is needed to reproduce this issue?

{
  "extends": "stylelint-config-standard"
}

Which version of stylelint are you using?

8.4.0

How are you running stylelint: CLI, PostCSS plugin, Node API?

gulp-stylelint

Does your issue relate to non-standard syntax (e.g. SCSS, nesting, etc.)?

No.

What did you expect to happen?

Allowance of the "/" character as default.

What actually happened (e.g. what warnings or errors you are getting)?

Expected whitespace after ")" (function-whitespace-after)

@dsine-de

This comment has been minimized.

dsine-de commented Jan 17, 2018

This probably conflicts with checking for division character between two functions...

@ntwb

This comment has been minimized.

Member

ntwb commented Jan 20, 2018

Via @Arcanemagus in the PR #3131 (comment)

A concern I had was that this may be valid for font, but this PR is making it valid for any position after a ). Does that actually make sense? Or should this be limited to font somehow?

@ntwb

This comment has been minimized.

Member

ntwb commented Jan 20, 2018

I probably should have researched this issue a little more before commenting/reviewing the PR 😉

I've dug into the past history of ACCEPTABLE_AFTER_CLOSING_PAREN in the function-whitespace-after rule and I think it will be fine to not have to restrict it to the font rule.

In #1391 was when ACCEPTABLE_AFTER_CLOSING_PAREN the colon : was also added, it's currently undocumented in the readme or rules inline docs and following the logic in #1391 I don't see the addition of the / being of a concern as it will only be limited to the function-whitespace-after rule and is not used in any stylelint utils.

@ntwb

This comment has been minimized.

Member

ntwb commented Jan 20, 2018

This probably conflicts with checking for division character between two functions...

With what I said above, let's also add some tests in the function-whitespace-after to determine if indeed that is the case

@jeddy3 jeddy3 changed the title from Allow "/" as an allowed character in the "function-whitespace-after" rule to False positives for "/" in function-whitespace-after Feb 7, 2018

@jeddy3 jeddy3 changed the title from False positives for "/" in function-whitespace-after to Fix false positives for "/" in function-whitespace-after May 17, 2018

@jeddy3 jeddy3 closed this in #3346 Jun 4, 2018

bors bot added a commit to mozilla/delivery-console that referenced this issue Jun 15, 2018

Merge #194
194: Update dependency stylelint to v9.3.0 r=rehandalal a=renovate[bot]

This Pull Request updates dependency [stylelint](https://github.com/stylelint/stylelint) from `v9.2.1` to `v9.3.0`



<details>
<summary>Release Notes</summary>

### [`v9.3.0`](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md#&#8203;930)
[Compare Source](stylelint/stylelint@9.2.1...9.3.0)
-   Added: support for `<style>` tags and `style=""` attributes in XML and XSLT files ([#&#8203;3386](`stylelint/stylelint#3386)).
-   Added: `globbyOptions` option ([#&#8203;3339](`stylelint/stylelint#3339)).
-   Added: `keyframes-name-pattern` rule ([#&#8203;3321](`stylelint/stylelint#3321)).
-   Added: `media-feature-name-value-whitelist` rule ([#&#8203;3320](`stylelint/stylelint#3320)).
-   Added: `selector-pseudo-element-colon-notation` autofix ([#&#8203;3345](`stylelint/stylelint#3345)).
-   Fixed: `.vue` files throwing errors for `<style lang="stylus">` and `<style lang="postcss">` ([#&#8203;3331](`stylelint/stylelint#3331)).
-   Fixed: `declaration-block-no-*` false positives for non-standard syntax ([#&#8203;3381](`stylelint/stylelint#3381)).
-   Fixed: `function-whitespace-after` false positives for "/" ([#&#8203;3132](`stylelint/stylelint#3132)).
-   Fixed: `length-zero-no-unit` incorrect autofix for at-includes ([#&#8203;3347](`stylelint/stylelint#3347)).
-   Fixed: `max-nesting-depth` false positives for nested properties ([#&#8203;3349](`stylelint/stylelint#3349)).
-   Fixed: `no-empty-source` false positives on vue external sources `<style src="*">` tag ([#&#8203;3331](`stylelint/stylelint#3331)).
-   Fixed: `max-line-length` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).
-   Fixed: `no-eol-whitespace` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).
-   Fixed: `no-extra-semicolons` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).
-   Fixed: `no-missing-end-of-source-newline` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).

Co-authored-by: Renovate Bot <bot@renovateapp.com>

schalkneethling added a commit to mdn/interactive-examples that referenced this issue Jun 16, 2018

chore(deps): update dependency stylelint to v9.3.0 (#973)
This Pull Request updates dependency [stylelint](https://github.com/stylelint/stylelint) from `v9.2.1` to `v9.3.0`



<details>
<summary>Release Notes</summary>

### [`v9.3.0`](https://github.com/stylelint/stylelint/blob/master/CHANGELOG.md#&#8203;930)
[Compare Source](stylelint/stylelint@9.2.1...9.3.0)
-   Added: support for `<style>` tags and `style=""` attributes in XML and XSLT files ([#&#8203;3386](`stylelint/stylelint#3386)).
-   Added: `globbyOptions` option ([#&#8203;3339](`stylelint/stylelint#3339)).
-   Added: `keyframes-name-pattern` rule ([#&#8203;3321](`stylelint/stylelint#3321)).
-   Added: `media-feature-name-value-whitelist` rule ([#&#8203;3320](`stylelint/stylelint#3320)).
-   Added: `selector-pseudo-element-colon-notation` autofix ([#&#8203;3345](`stylelint/stylelint#3345)).
-   Fixed: `.vue` files throwing errors for `<style lang="stylus">` and `<style lang="postcss">` ([#&#8203;3331](`stylelint/stylelint#3331)).
-   Fixed: `declaration-block-no-*` false positives for non-standard syntax ([#&#8203;3381](`stylelint/stylelint#3381)).
-   Fixed: `function-whitespace-after` false positives for "/" ([#&#8203;3132](`stylelint/stylelint#3132)).
-   Fixed: `length-zero-no-unit` incorrect autofix for at-includes ([#&#8203;3347](`stylelint/stylelint#3347)).
-   Fixed: `max-nesting-depth` false positives for nested properties ([#&#8203;3349](`stylelint/stylelint#3349)).
-   Fixed: `no-empty-source` false positives on vue external sources `<style src="*">` tag ([#&#8203;3331](`stylelint/stylelint#3331)).
-   Fixed: `max-line-length` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).
-   Fixed: `no-eol-whitespace` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).
-   Fixed: `no-extra-semicolons` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).
-   Fixed: `no-missing-end-of-source-newline` false positives for non-CSS blocks ([#&#8203;3367](`stylelint/stylelint#3367)).

---

</details>




---

This PR has been generated by [Renovate Bot](https://renovatebot.com).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment