Allow leading newlines for source map and copyright comments #2121

merged 2 commits into from Nov 26, 2016


None yet

3 participants


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


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 jwilsson Allow leading newlines for source map and copyright comments

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 commented Nov 26, 2016 edited

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 (
 * Copyright 2011-2016 The Bootstrap Authors
 * Copyright 2011-2016 Twitter, Inc.
 * Licensed under MIT (
/*! normalize.css v4.2.0 | MIT License | */

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 jwilsson Update Jest snapshots

@jeddy3 Cool, thanks for the explanation!

Snapshots are updated.


Thanks @jwilsson!

@davidtheclark davidtheclark merged commit c4285ac into stylelint:master Nov 26, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
coverage/coveralls Coverage decreased (-0.04%) to 95.645%
@davidtheclark davidtheclark added a commit that referenced this pull request Nov 26, 2016
@davidtheclark davidtheclark Update 04b7269

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 unknown repository branch Nov 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment