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

imports without quotes in sass syntax #204

Open
chrisdrackett opened this issue Jul 26, 2016 · 4 comments
Open

imports without quotes in sass syntax #204

chrisdrackett opened this issue Jul 26, 2016 · 4 comments

Comments

@chrisdrackett
Copy link

when using sass syntax I would expect to be able to use an import without quotes ala:

http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html#_import

however, currently I get the following:

Please check validity of the block starting from line #1

when using https://github.com/sasstools/sass-lint. I also have an issue on that project:

sasstools/sass-lint#795 (comment)

@chrisdrackett
Copy link
Author

so this seems to work unless I have leading periods in the import. For example the following works:

@import variables

while this does not:

@import ../variables

@tonyganch
Copy link
Owner

@DanPurdy @bgriffith, I need help with formalising that one. @import can be followed by any number of any characters except line breaks and semicolons = does that sound correct?

@DanPurdy
Copy link
Collaborator

DanPurdy commented Nov 1, 2016

@tonyganch I believe anything that can be a valid file name / path, yes. You can't use glob characters though as each partial has to be imported individually.

@import "foundation/components/block-grid",
"foundation/components/buttons",
"foundation/components/forms",
"foundation/components/grid",
"my-scss/my-typography",
"my-scss/my-branding",
"my-scss/my-buttons";

@pwilver12
Copy link

I am experiencing a similar error when using sass-lint along with Webpack sass-loader. I am using their custom import syntax to resolve import paths by prepending a ~ to my import statements, i.e.

@import ~path/to/partial

The same error (Please check validity of the block...) is appearing in this instance as well, which prevents any further linting of these affected files. For context, this has recently become a larger issue for my team specifically, with the introduction of pre-commit git hooks to our codebase. I'd be curious if there is a solution to resolve this syntax without having to transition our codebase to use quoted import statements.

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

5 participants