Skip to content

Instantly share code, notes, and snippets.

@josephj
Created June 20, 2013 00:19
Show Gist options
  • Save josephj/5819307 to your computer and use it in GitHub Desktop.
Save josephj/5819307 to your computer and use it in GitHub Desktop.
CoffeeLint configuration file.
{
"arrow_spacing": {
"level" : "error"
},
"camel_case_classes" : {
"level" : "error"
},
"coffeescript_error" : {
"level" : "error"
},
"cyclomatic_complexity" : {
"value" : 12,
"level" : "warn"
},
"duplicate_key" : {
"level" : "error"
},
"empty_constructor_needs_parens" : {
"level" : "ignore"
},
"indentation" : {
"value" : 2,
"level" : "error"
},
"line_endings" : {
"value" : "unix",
"level" : "ignore"
},
"max_line_length" : {
"value": 80,
"level" : "error"
},
"newlines_after_classes" : {
"level" : "ignore"
},
"no_backticks" : {
"level" : "error"
},
"no_empty_param_list" : {
"level" : "error"
},
"no_implicit_braces" : {
"level" : "error"
},
"no_implicit_parens" : {
"level" : "error"
},
"no_plusplus" : {
"level" : "error"
},
"no_stand_alone_at" : {
"level": "error"
},
"no_tabs" : {
"level" : "error"
},
"no_throwing_strings" : {
"level" : "error"
},
"no_trailing_semicolons" : {
"level" : "error"
},
"no_trailing_whitespace" : {
"level" : "error"
},
"non_empty_constructor_needs_parens" : {
"level" : "ignore"
},
"space_operators" : {
"level" : "error"
}
}
@josephj
Copy link
Author

josephj commented Jun 20, 2013

讓 vim 做檢查...

  • 把上面的檔案放在 ~/coffeelint.json

  • 需安裝 vim-coffee-script

    cd ~/.vim
    git submodule add [email protected]:kchmck/vim-coffee-script.git bundle/vim-coffee-script 
    
  • 在 ~/.vimrc 加入設定:

    let coffee_lint_options = '-f lint.json'

Reference: CoffeeLint Options

@josephj
Copy link
Author

josephj commented Jun 20, 2013

上面那個要選範圍,感覺不太優,這個是 QuickFix 檢查整個檔案:

https://gist.github.com/davidmfoley/2283673

無奈執行後我的畫面會爛掉

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