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

Parse error on interpolated values #44

Closed
joshuacc opened this issue Aug 28, 2015 · 6 comments
Closed

Parse error on interpolated values #44

joshuacc opened this issue Aug 28, 2015 · 6 comments

Comments

@joshuacc
Copy link
Contributor

The following examples all compile fine with libsass via gulp-sass. However, they cause a parse error in sass-lint (run via gulp-sass-lint).

Original case:

$list-item-spacing: #{$baseline-ratio * 0.25}em;

Reduced case:

li {
    margin-top: #{1}em;
}
@Snugug
Copy link
Member

Snugug commented Aug 28, 2015

Can you provide the error as well?

@joshuacc
Copy link
Contributor Author

Sure.

C:\project-path\node_modules\sass-lint\lib\groot.js:21
    throw new Error('Parsing error' + fileInfo + ': ' + e.message);
          ^
Error: Parsing error at src\typography\_typography-baseline.scss: Please check validity of the block starting from line #111
    at module.exports (C:\project-path\node_modules\sass-lint\lib\groot.js:21:11)
    at Function.sassLint.lintText (C:\project-path\node_modules\sass-lint\index.js:23:13)
    at DestroyableTransform._transform (C:\project-path\node_modules\gulp-sass-lint\index.js:32:27)
    at DestroyableTransform.Transform._read (C:\project-path\node_modules\gulp-sass-lint\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:172:10)
    at DestroyableTransform.Transform._write (C:\project-path\node_modules\gulp-sass-lint\node_modules\through2\node_modules\readable-stream\lib\_stream_transform.js:160:12)
    at doWrite (C:\project-path\node_modules\gulp-sass-lint\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:326:12)
    at writeOrBuffer (C:\project-path\node_modules\gulp-sass-lint\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:312:5)
    at DestroyableTransform.Writable.write (C:\project-path\node_modules\gulp-sass-lint\node_modules\through2\node_modules\readable-stream\lib\_stream_writable.js:239:11)
    at write (C:\project-path\node_modules\gulp-plumber\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:623:24)
    at flow (C:\project-path\node_modules\gulp-plumber\node_modules\through2\node_modules\readable-stream\lib\_stream_readable.js:632:7)

@Snugug
Copy link
Member

Snugug commented Aug 28, 2015

I believe this is an issue that was recently fixed in the AST parser we use but hasn't made its way in to a release yet.

@bradly-fairbanks
Copy link

I'm getting that same error but instead on lines with comments. Could they be related?

For example -

$base_font_size: 1em; //16px

or

// $golden: 1.618;

or even just a plain text comment

// Responsive breakpoints

@jdwillemse
Copy link

I'm having the same issue with #{$property}: $px-values + px;

This is the error I get:

/project-path/node_modules/gulp-sass-lint/node_modules/sass-lint/lib/groot.js:21
    throw new Error('Parsing error' + fileInfo + ': ' + e.message);
    ^

Error: Parsing error at client/sass/theme/_tools.utilities.scss: Please check validity of the block starting from line #32
  at module.exports (/project-path/node_modules/gulp-sass-lint/node_modules/sass-lint/lib/groot.js:21:11)
  at Function.sassLint.lintText (/project-path/node_modules/gulp-sass-lint/node_modules/sass-lint/index.js:36:13)
  at DestroyableTransform._transform (/project-path/node_modules/gulp-sass-lint/index.js:38:27)
  at DestroyableTransform.Transform._read (/project-path/node_modules/gulp-sass-lint/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:10)
  at DestroyableTransform.Transform._write (/project-path/node_modules/gulp-sass-lint/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:160:12)
  at doWrite (/project-path/node_modules/gulp-sass-lint/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:333:12)
  at writeOrBuffer (/project-path/node_modules/gulp-sass-lint/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:319:5)
  at DestroyableTransform.Writable.write (/project-path/node_modules/gulp-sass-lint/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:246:11)
  at write (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
  at flow (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
  at DestroyableTransform.pipeOnReadable (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
  at emitNone (events.js:67:13)
  at DestroyableTransform.emit (events.js:166:7)
  at emitReadable_ (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:448:10)
  at emitReadable (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:444:5)
  at readableAddChunk (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:187:9)
  at DestroyableTransform.Readable.push (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:149:10)
  at DestroyableTransform.Transform.push (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:145:32)
  at afterTransform (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:101:12)
  at TransformState.afterTransform (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:79:12)
  at DestroyableTransform.noop [as _transform] (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/through2.js:26:3)
  at DestroyableTransform.Transform._read (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)
  at DestroyableTransform.Transform._write (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)
  at doWrite (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:237:10)
  at writeOrBuffer (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:227:5)
  at DestroyableTransform.Writable.write (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:194:11)
  at write (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24)
  at flow (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7)
  at DestroyableTransform.pipeOnReadable (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:664:5)
  at emitNone (events.js:67:13)
  at DestroyableTransform.emit (events.js:166:7)
  at emitReadable_ (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:448:10)
  at emitReadable (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:444:5)
  at readableAddChunk (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:187:9)
  at DestroyableTransform.Readable.push (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:149:10)
  at DestroyableTransform.Transform.push (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:145:32)
  at afterTransform (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:101:12)
  at TransformState.afterTransform (/project-path/node_modules/gulp/node_modules/vinyl-fs/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:79:12)
  at /project-path/node_modules/gulp/node_modules/vinyl-fs/lib/src/getContents/bufferFile.js:12:5
  at FSReqWrap.readFileAfterClose [as oncomplete] (evalmachine.<anonymous>:380:3)

@DanPurdy
Copy link
Member

This is fixed in sass-lint 1.6.0

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

No branches or pull requests

6 participants