Skip to content

Instantly share code, notes, and snippets.

@AGhost-7
Last active December 21, 2015 02:46
Show Gist options
  • Select an option

  • Save AGhost-7/5e964f9a356c049f668c to your computer and use it in GitHub Desktop.

Select an option

Save AGhost-7/5e964f9a356c049f668c to your computer and use it in GitHub Desktop.
Very strict Coffeescript
{
"arrow_spacing": {
"level": "ignore"
},
"braces_spacing": {
"level": "ignore",
"spaces": 0,
"empty_object_spaces": 0
},
"camel_case_classes": {
"level": "error"
},
"coffeescript_error": {
"level": "error"
},
"colon_assignment_spacing": {
"level": "ignore",
"spacing": {
"left": 0,
"right": 0
}
},
"cyclomatic_complexity": {
"level": "ignore",
"value": 10
},
"duplicate_key": {
"level": "error"
},
"empty_constructor_needs_parens": {
"level": "ignore"
},
"ensure_comprehensions": {
"level": "warn"
},
"eol_last": {
"level": "ignore"
},
"indentation": {
"value": 1,
"level": "error"
},
"line_endings": {
"level": "error",
"value": "unix"
},
"max_line_length": {
"value": 80,
"level": "error",
"limitComments": true
},
"missing_fat_arrows": {
"level": "ignore",
"is_strict": false
},
"newlines_after_classes": {
"value": 3,
"level": "ignore"
},
"no_backticks": {
"level": "error"
},
"no_debugger": {
"level": "warn",
"console": false
},
"no_empty_functions": {
"level": "ignore"
},
"no_empty_param_list": {
"level": "ignore"
},
"no_implicit_braces": {
"level": "error",
"strict": true
},
"no_implicit_parens": {
"level": "error",
"strict": true
},
"no_interpolation_in_single_quotes": {
"level": "ignore"
},
"no_nested_string_interpolation": {
"level": "warn"
},
"no_plusplus": {
"level": "error"
},
"no_private_function_fat_arrows": {
"level": "warn"
},
"no_stand_alone_at": {
"level": "ignore"
},
"no_tabs": {
"level": "ignore"
},
"no_this": {
"level": "error"
},
"no_throwing_strings": {
"level": "error"
},
"no_trailing_semicolons": {
"level": "error"
},
"no_trailing_whitespace": {
"level": "error",
"allowed_in_comments": false,
"allowed_in_empty_lines": true
},
"no_unnecessary_double_quotes": {
"level": "ignore"
},
"no_unnecessary_fat_arrows": {
"level": "error"
},
"non_empty_constructor_needs_parens": {
"level": "ignore"
},
"prefer_english_operator": {
"level": "ignore",
"doubleNotLevel": "ignore"
},
"space_operators": {
"level": "ignore"
},
"spacing_after_comma": {
"level": "ignore"
},
"transform_messes_up_line_numbers": {
"level": "warn"
}
}

Parens

Probably one of the few real issues I see with coffeescript is the parenthesis omition making it hard to understand what the code unless if you're very familiar with the rules of the compiler.

foo = (a) -> a + 1
foo foo 1, 2

Turns into this:

var foo;

foo = function() {};

foo(foo(1, 2));

You can also get some odd syntax such as this:

foo 1, 2, a: 2, b: 2

Which will turn into the following:

foo(1, 2, {
  a: 2,
  b: 2
});

The solution is pretty simple; if you want to use coffeescript on a project but don't like how you can omit parens you can just prevent people from doing so by changing some options in coffeelint.

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