SublimeLinter / SublimeLinter-flow

SublimeLinter plugin for JavaScript static type checking, using flow.
MIT License
116 stars 24 forks source link

No visible markers #41

Closed SEAPUNK closed 7 years ago

SEAPUNK commented 8 years ago

I have two linters enabled: standard and flow.

standard's linter errors show up just fine, but flow's don't at all, although both get displayed in the console.

Reinstalling SublimeLinter, SublimeLinter-flow, restarting ST3, toggling the standard linter all didn't seem to work.

groteworld commented 8 years ago

@ckaznocha or @nsfmc would know better, but the issue to me seems to be that the linter is taking the column and subtracting one from it. see linter.py#L78 which is causing it to try to highlight the line above it, which doesn't have a column 28, or 34. Then again, that doesn't explain why column 12 of line 17 isn't being highlighted...

just observing, but I don't know this linter or this plugin.

nsfmc commented 8 years ago

hi there, i've been using this local branch https://github.com/nsfmc/SublimeLinter-flow/tree/check-stdin of sublimelinter-flow recently, it requires a recentish version of flow, but will probably have better error output. it is still a bit fragile but does much better than previous versions of the linter in terms of not freaking out on output.

let me know if you find any issues, i haven't tested it rigorously, but any sets of eyes would help

ckaznocha commented 8 years ago

@SEAPUNK could you try the latest 4.0.0 version and see if the issue persists?

SEAPUNK commented 8 years ago

I'll try it out tomorrow.

SEAPUNK commented 8 years ago

Nope, same thing. Standard shows markers, flow doesn't.

nsfmc commented 8 years ago

interesting! i just copied a similar method in a file i'm working on and get this output

with the following log data

SublimeLinter: flow 2 errors. passed: False 
SublimeLinter: flow line: 162, col: 2, level: error, message: servic (identifier `servic`) Could not resolve name 
SublimeLinter: flow line: 163, col: 9, level: error, message: logger (property `logger`) Property not found in service (Number) 

i assume you're running st3 in linux, i can try firing up a vm and giving it a go later today, it's truly a weird problem. the good news (at the minimum) is that the flow linter is no longer crashing on input, so that rules that out at least. thanks!

SEAPUNK commented 8 years ago

Yeah, I'm running ST3 build 3126 on Arch Linux.

$ node -v
v6.7.0
$ npm -v
3.10.8
SEAPUNK commented 8 years ago

SublimeLinter config:

{
    "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": true,
                "args": [],
                "excludes": []
            },
            "flow": {
                "@disable": false,
                "args": [],
                "excludes": [],
                "show-all-errors": true
            },
            "rust": {
                "@disable": false,
                "args": [],
                "crate-root": null,
                "excludes": [],
                "use-cargo": true,
                "use-cargo-check": false,
                "use-crate-root": false
            },
            "semistandard": {
                "@disable": true,
                "args": [],
                "excludes": []
            },
            "standard": {
                "@disable": false,
                "args": [],
                "excludes": []
            }
        },
        "mark_style": "outline",
        "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",
            "javascript (babel)": "javascript",
            "magicpython": "python",
            "php": "html",
            "python django": "python"
        },
        "warning_color": "DDB700",
        "wrap_find": true
    }
}
SEAPUNK commented 8 years ago

Linters installed:

SublimeLinter 3.7.4
SublimeLinter-flow 4.0.0
SublimeLinter-contrib-eslint 1.10.0
SublimeLinter-contrib-rustc 1.4.0
SublimeLinter-contrib-semistandard 1.0.4
SublimeLinter-contrib-standard 3.1.1
nsfmc commented 8 years ago

just got sublime setup in ubuntu with only SublimeLinter and SublimeLinter-flow installed. The only setting i have changed in the linter prefs is turning debug: true

here's the output that i see

it looks like one of the other linters might be clobbering the output or confusing sublimelinter, causing the merged lint output to fail since sublimelinter-flow's output does correctly see both errors but sublimelinter is only highlighting the first one.

SEAPUNK commented 8 years ago

I'll see if uninstalling the other linters will work.

SEAPUNK commented 8 years ago

I uninstalled all the linters except flow, it's still not working. I'll reinstall SublimeLinter.

SEAPUNK commented 8 years ago

I uninstalled SublimeLinter and all linters, restarted ST3, then installed SublimeLinter and flow, restarted ST3, and it's still not showing anything. I'll see if it's my current theme that's doing it.

SEAPUNK commented 8 years ago

The theme is not causing it either, I'm on the default theme.

nsfmc commented 8 years ago

i'm not sure where to proceed from here, to be honest. I am prone to believe that there is some other interaction we aren't seeing. i can send you the small test repo that had that error, maybe you can see if that also exhibits the same issue?

SEAPUNK commented 8 years ago

Sure, I'll try that out.

nsfmc commented 8 years ago

here's what i used https://github.com/nsfmc/flow-bugtest

SEAPUNK commented 8 years ago

Yeah, the markers don't show up.

Output log:

SublimeLinter: standard: index.js ['/usr/bin/standard', '--stdin', '--verbose'] 
SublimeLinter: standard output:
standard: Unexpected linter output:

Error: Failed to load plugin react: Cannot find module 'eslint-plugin-react'
Referenced from: /usr/lib/node_modules/standard/eslintrc.json
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.load (/usr/lib/node_modules/eslint/lib/config/plugins.js:129:26)
    at Array.forEach (native)
    at Object.loadAll (/usr/lib/node_modules/eslint/lib/config/plugins.js:151:21)
    at load (/usr/lib/node_modules/eslint/lib/config/config-file.js:504:21)
    at /usr/lib/node_modules/eslint/lib/config/config-file.js:391:36
    at Array.reduceRight (native)

If you think this is a bug in `standard`, open an issue: https://github.com/feross/standard/issues 
SublimeLinter: flow attempting to run from: ['/home/ivan/code/github/flow-bugtest/node_modules/.bin/flow', 'check-contents', '@', '--show-all-errors', '--json'] 
SublimeLinter: found flow pragma! 
SublimeLinter: flow: index.js ['/home/ivan/code/github/flow-bugtest/node_modules/.bin/flow', 'check-contents', '@', '--show-all-errors', '--json'] 
SublimeLinter: flow output:
{"flowVersion":"0.33.0","errors":[{"kind":"infer","level":"error","message":[{"context":"\tservic","descr":"identifier `servic`","type":"Blame","loc":{"source":"/home/ivan/code/github/flow-bugtest/index.js","type":"SourceFile","start":{"line":4,"column":2,"offset":50},"end":{"line":4,"column":7,"offset":56}},"path":"/home/ivan/code/github/flow-bugtest/index.js","line":4,"endline":4,"start":2,"end":7},{"context":null,"descr":"Could not resolve name","type":"Comment","path":"","line":0,"endline":0,"start":1,"end":0}]},{"kind":"infer","level":"error","message":[{"context":"\tconst {logger} = service;","descr":"property `logger`","type":"Blame","loc":{"source":"/home/ivan/code/github/flow-bugtest/index.js","type":"SourceFile","start":{"line":5,"column":9,"offset":65},"end":{"line":5,"column":14,"offset":71}},"path":"/home/ivan/code/github/flow-bugtest/index.js","line":5,"endline":5,"start":9,"end":14},{"context":null,"descr":"Property not found in","type":"Comment","path":"","line":0,"endline":0,"start":1,"end":0},{"context":"\tconst {logger} = service;","descr":"Number","type":"Blame","loc":{"source":"/home/ivan/code/github/flow-bugtest/index.js","type":"SourceFile","start":{"line":5,"column":19,"offset":75},"end":{"line":5,"column":25,"offset":82}},"path":"/home/ivan/code/github/flow-bugtest/index.js","line":5,"endline":5,"start":19,"end":25}]}],"passed":false}Launching Flow server for /home/ivan/code/github/flow-bugtest
Spawned flow server (pid=15638)
Logs will go to /tmp/flow/zShomezSivanzScodezSgithubzSflow-bugtest.log
Started a new flow server: - 
SublimeLinter: flow {"flowVersion":"0.33.0","errors":[{"kind":"infer","level":"error","message":[{"context":"\tservic","descr":"identifier `servic`","type":"Blame","loc":{"source":"/home/ivan/code/github/flow-bugtest/index.js","type":"SourceFile","start":{"line":4,"column":2,"offset":50},"end":{"line":4,"column":7,"offset":56}},"path":"/home/ivan/code/github/flow-bugtest/index.js","line":4,"endline":4,"start":2,"end":7},{"context":null,"descr":"Could not resolve name","type":"Comment","path":"","line":0,"endline":0,"start":1,"end":0}]},{"kind":"infer","level":"error","message":[{"context":"\tconst {logger} = service;","descr":"property `logger`","type":"Blame","loc":{"source":"/home/ivan/code/github/flow-bugtest/index.js","type":"SourceFile","start":{"line":5,"column":9,"offset":65},"end":{"line":5,"column":14,"offset":71}},"path":"/home/ivan/code/github/flow-bugtest/index.js","line":5,"endline":5,"start":9,"end":14},{"context":null,"descr":"Property not found in","type":"Comment","path":"","line":0,"endline":0,"start":1,"end":0},{"context":"\tconst {logger} = service;","descr":"Number","type":"Blame","loc":{"source":"/home/ivan/code/github/flow-bugtest/index.js","type":"SourceFile","start":{"line":5,"column":19,"offset":75},"end":{"line":5,"column":25,"offset":82}},"path":"/home/ivan/code/github/flow-bugtest/index.js","line":5,"endline":5,"start":19,"end":25}]}],"passed":false}Launching Flow server for /home/ivan/code/github/flow-bugtest
Spawned flow server (pid=15638)
Logs will go to /tmp/flow/zShomezSivanzScodezSgithubzSflow-bugtest.log
Started a new flow server: - 

I'll try to do a fresh install of ST3, and incrementally rebuild my environment, starting with SublimeLinter, and try to figure out which other package must be interfering with the setup.

SEAPUNK commented 8 years ago

Oh, wait, they show up now. I had to type some characters to update the linter.

SEAPUNK commented 8 years ago

That's awfully weird, huh?

nsfmc commented 8 years ago

computers ¯(ツ)

SEAPUNK commented 8 years ago

So this must mean that something is messing with my project's flow setup.

I'll quickly dump a partial package.json and .flowconfig.

Also note that one file in the original screenshot was the only file in the entire project that has the // @flow pragma.

SEAPUNK commented 8 years ago

package.json

{
  "name": "@xbpf/feed-jbi-service",
  "version": "0.1.0",
  "main": "lib/index.js",
  "scripts": {
    "test": "standard && flow",
    "build": "babel -D -d lib src",
    "build:run": "npm run build && npm start",
    "start": "node . XBPF_FEED_JBI_____________________________________"
  },
  "author": "Ivan K <ivan@sq10.net>",
  "license": "UNLICENSED",
  "dependencies": {
    "@xbpf/svcconfig": "^2.0.0",
    "@xbpf/svcdir": "^2.1.0",
    "@xbpf/svchttp": "^1.0.0",
    "@xbpf/svclogger": "^1.0.0",
    "@xbpf/svctitle": "^2.0.0",
    "babel-polyfill": "^6.16.0",
    "chalk": "^1.1.3",
    "deep-diff": "^0.3.4",
    "delay": "^1.3.1",
    "guaranteed-error": "^1.0.0",
    "iconv-lite": "^0.4.13",
    "jsftp": "^1.5.4",
    "kcors": "^2.1.1",
    "koa": "^2.0.0",
    "koa-json-body": "^5.0.0",
    "koa-mount": "^2.0.0",
    "koa-router": "^7.0.1",
    "ms": "^0.7.1",
    "pify": "^2.3.0",
    "recaller": "^1.0.0",
    "uuid": "^2.0.3"
  },
  "devDependencies": {
    "babel-cli": "^6.16.0",
    "babel-eslint": "^7.0.0",
    "babel-plugin-transform-flow-strip-types": "^6.14.0",
    "babel-preset-es2015-node6": "^0.3.0",
    "babel-preset-latest": "^6.16.0",
    "eslint-plugin-flowtype": "^2.20.0",
    "flow-bin": "^0.33.0",
    "standard": "^8.4.0"
  },
  "standard": {
    "parser": "babel-eslint",
    "plugins": [
      "flowtype"
    ]
  },
  "engines": {
    "node": ">=6"
  }
}

.flowconfig

[ignore]

[include]

[libs]

[options]
SEAPUNK commented 8 years ago

.gitignore

logs
*.log
npm-debug.log*
pids
*.pid
*.seed
.npm

node_modules

data
lib

.babelrc

{
  "presets": [
    "es2015-node6",
    ["latest", {
      es2015: false
    }]
  ],
  "plugins": [
    "transform-flow-strip-types"
  ]
}

Those are the only dotfiles in the project.

ckaznocha commented 7 years ago

Gonna close this one unless anyone knows for sure how to replicate.