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

Allow leading newlines for source map and copyright comments #2121

Merged
merged 2 commits into from
Nov 26, 2016
Merged

Allow leading newlines for source map and copyright comments #2121

merged 2 commits into from
Nov 26, 2016

Conversation

jwilsson
Copy link
Member

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

#2120

Is there anything in the PR that needs further explanation?

I opted for a regexp to check for any kind of whitespace so it will accept tabs as well. Let me know if you want tests for tabs too.

@jwilsson
Copy link
Member Author

I've never worked with Jest before but when looking at the build failure, I'm guessing I need to update the snapshots for it?

@jeddy3
Copy link
Member

jeddy3 commented Nov 26, 2016

I'm guessing I need to update the snapshots for it?

The jest snapshots changes look good:

Object {
             "column": 3,
    -        "line": 1,
    -        "rule": "comment-whitespace-inside",
    -        "severity": "error",
    -        "text": "Expected whitespace after "/*" (comment-whitespace-inside)",
    -      },

i.e. we are loosing one comment-whitespace-inside warning at 1:3. This is correct as the top of the 001 stylesheet looks like so:

/*!
 * Bootstrap v4.0.0-alpha.5 (https://getbootstrap.com)
 * Copyright 2011-2016 The Bootstrap Authors
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
/*! normalize.css v4.2.0 | MIT License | github.com/necolas/normalize.css */

Where the bootstrap copyright was erroneously triggering a warning (and the normalise one was not)

@jwilsson Yep, press u at the interactive menu (npm run jest -- --watch) to update the snapshot, and then commit&push the changes.

@jwilsson
Copy link
Member Author

@jeddy3 Cool, thanks for the explanation!

Snapshots are updated.

@davidtheclark
Copy link
Contributor

Thanks @jwilsson!

@davidtheclark davidtheclark merged commit c4285ac into stylelint:master Nov 26, 2016
davidtheclark added a commit that referenced this pull request Nov 26, 2016
@davidtheclark
Copy link
Contributor

Added note to changelog:

  • Fixed: comment-whitespace-inside no longer complains about /*! comments with non-space whitespace (e.g. newlines) (#2121)

@jwilsson jwilsson deleted the issue-2120 branch November 27, 2016 12:32
sergesemashko pushed a commit to sergesemashko/stylelint that referenced this pull request Mar 3, 2017
…nt#2121)

Allow leading newlines for source map and copyright comments
sergesemashko pushed a commit to sergesemashko/stylelint that referenced this pull request Mar 3, 2017
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.

3 participants