kungfusheep / SublimeLinter-contrib-stylelint

this repo is no longer maintained - please see https://github.com/SublimeLinter/SublimeLinter-stylelint
MIT License
116 stars 19 forks source link

Issue with inline Sass double slash comments #16

Open chris-pearce opened 8 years ago

chris-pearce commented 8 years ago

Not sure if this related to your Sublime plug-in but when I have Sass comments like this:

display: flex; // [2]

It throws this error in the console:

SublimeLinter: stylelint output:
CssSyntaxError: /var/folders/5k/l6bx7lys5mlcznbq3zj3q2_cp_csgm/T/SublimeLinter3-chrisp/form-input-with-label.css:50:20: Unknown word
    at Input.error (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/postcss/lib/input.js:61:22)
    at Parser.unknownWord (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/postcss/lib/parser.js:457:26)
    at Parser.word (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/postcss/lib/parser.js:174:14)
    at Parser.loop (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/postcss/lib/parser.js:60:26)
    at parse (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/postcss/lib/parse.js:26:12)
    at new LazyResult (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/postcss/lib/lazy-result.js:61:24)
    at Processor.process (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/postcss/lib/processor.js:34:16)
    at lintString (/Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/stylelint/dist/standalone.js:88:9)
    at /Users/chrisp/workspace/campaign-monitor/workflowbuildercontext.uiservice/WorkflowBuilderContext.UIService/node_modules/stylelint/dist/standalone.js:70:14 

Removing the comments and it goes back to working.

backflip commented 8 years ago

I think this occurs when the syntax is set to CSS instead of SCSS. I was working around this here: https://github.com/kungfusheep/SublimeLinter-contrib-stylelint/issues/15

However, it would probably make sense for the linter to asses the syntax automatically instead of having to define it in the config.

chris-pearce commented 8 years ago

No joy with that I'm afraid, here's the contents of my SublimeLinter-sublime-settings—User file with "args": ["--syntax", "scss"] added:

{
    "user": {
        "debug": true,
        "delay": 0.25,
        "error_color": "D02000",
        "gutter_theme": "Packages/SublimeLinter/gutter-themes/Default/Default.gutter-theme",
        "gutter_theme_excludes": [],
        "lint_mode": "background",
        "linters": {
            "eslint": {
                "@disable": false,
                "args": [],
                "chdir": "${project}",
                "excludes": []
            },
            "scss": {
                "@disable": false,
                "args": [],
                "chdir": "${project}",
                "exclude-linter": "",
                "excludes": [],
                "include-linter": ""
            },
            "stylelint": {
                "@disable": false,
                "args": ["--syntax", "scss"],
                "chdir": "${project}",
                "excludes": []
            }
        },
        "mark_style": "fill",
        "no_column_highlights_line": false,
        "passive_warnings": false,
        "paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "python_paths": {
            "linux": [],
            "osx": [],
            "windows": []
        },
        "rc_search_limit": 3,
        "shell_timeout": 10,
        "show_errors_on_save": false,
        "show_marks_in_minimap": true,
        "syntax_map": {
            "html (django)": "html",
            "html (rails)": "html",
            "html 5": "html",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}
chris-pearce commented 8 years ago

Any ideas on this?

chris-pearce commented 8 years ago

See

pjconnors commented 8 years ago

I'm experiencing the same issue, and have tried some of the adjustments listed here without much luck. I just noticed this though, and thought I'd share:

// Passes
.black {
  // color: #000;
}

// Fails 
// .black {
//   color: #000;
// }
ivancuric commented 8 years ago

Any updates on this issue? It's kind of a roadblock.