Giter Club home page Giter Club logo

flycheck-elm's Introduction

flycheck-elm

Flycheck support for the elm language

Usage

  (eval-after-load 'flycheck
    '(add-hook 'flycheck-mode-hook #'flycheck-elm-setup))

flycheck-elm's People

Contributors

bsermons avatar purcell avatar syohex avatar trezona-lecomte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flycheck-elm's Issues

Flycheck error: Checker definition probably flawed.

I am using Node 6.2.2, Elm 0.17.1 and Emacs 24.5.1

I think this is an issue with elm-make though I just wanted to check to see if there is another answer. For some types of elm errors flymake-elm exits abnormally and the checker stops. It spits out a normal elm error message into the mini-buffer and flycheck seems to hang.

I did some checking in the command line and elm-make does not always return a json message even thought the --report=json flag is used. And from reading the source code of flymake-elm, it requires elm-make to return json messages in order to properly parse them.

Here are a few of the types of errors that create the issue:

This file uses 0.16 syntax

-- Main.elm
module Main where

import Html exposing (..)

main : Html
main = text "Test"

Executing elm-make --report=json Main.elm returns the message below rather than json.

 -- SYNTAX PROBLEM ----------------------------------------------------- Main.elm

I ran into something unexpected when parsing your code!

1| module Main where
               ^
I am looking for one of the following things:

    something like `exposing (..)` which replaced `where` in 0.17
    whitespace

This file misspells exposing as Fexposing

-- Main.elm
module Main exposing (..)

import Html Fexposing (..)

main : Html
main = text "Test"

Executing elm-make --report=json Main.elm returns the message below rather than json.

-- SYNTAX PROBLEM ----------------------------------------------------- Main.elm

I need a fresh line to start a new declaration. This means a new line that
starts with stuff, not with spaces or comments.

3| import Html Fexposing (..)
               ^
I am looking for one of the following things:

    reserved word `as`
    reserved word `exposing`
    whitespace

This file tries to import an uninstalled module

module Main exposing (..)

import Unknown -- Some known module
import Html exposing (..)

main : Html
main = text "Test"

Executing elm-make --report=json Main.elm returns the message below rather than json.

I cannot find module 'Unknown'.

Module 'Main' is trying to import it.

Potential problems could be:
  * Misspelled the module name
  * Need to add a source directory or new dependency to elm-package.json

License mismatch?

Hi there, and thanks for flycheck-elm. I use it every day at work and it saves me countless hours.

I have one question about the license of the package. The LICENSE file is gpl version 2 but the source files all refer to version 3+. Which is the real license for the package?

Thanks again!

Cheers,

John

Should have a way to see the full error message

Given this (obviously) broken code

test : String
test = 42

the error message seen in flycheck is pretty much lacking in details

The type annotation for `test` does not match its definition.

Sure, in the trivial case such above that's often good enough, but when the types are more complex and the type mismatch much less obvious it would be very useful to be able to see the rest of the error message somehow

The type annotation for `test` does not match its definition.

1| test : String
          ^^^^^^
The type annotation is saying:

    String

But I am inferring that the definition has this type:

    number

I've learned about flycheck-compile but with the json output it's not at all readable. Seems the only way to see the full error message is to jump to shell and run elm-make manually :-/

elm-make: elm-package.json: openBinaryFile: does not exist (No such file or directory)

My issue is when running the linting on a file from emacs C-c ! C-c I get the following

-*- mode: compilation; default-directory: "~/work/elm-starter/src/elm/" -*-
Compilation started at Wed Oct  5 22:12:13

elm-make --report\=json /Users/nadeem/work/elm-starter/src/elm/Main.elm --output\=/dev/null
elm-make: elm-package.json: openBinaryFile: does not exist (No such file or directory)

Compilation exited abnormally with code 1 at Wed Oct  5 22:12:13

but if I run the following from the command line

elm-make --report\=json /Users/nadeem/work/elm-starter/src/elm/Main.elm --output\=/dev/null

I get

[{"tag":"TYPE MISMATCH","overview":"The argument to function `class` is causing a mismatch.","subregion":{"start":{"line":62,"column":17},"end":{"line":62,"column":18}},"details":"Function `class` is expecting the argument to be:\n\n    String\n\nBut it is:\n\n    number","region":{"start":{"line":62,"column":11},"end":{"line":62,"column":18}},"type":"error","file":"/Users/nadeem/work/elm-starter/src/elm/Main.elm"}]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.