Compiler Directives
There are a few compiler options you can try that will change how your code or even all code imported under behave.
Example
Here, we want to allow for coffeescript classes
coffee
using compiler::coffeeClasses;
class MyClass
constructor: ->
rew::io::out.print "hello"
Public Compiler Options
Using the public
keyword, we can publicly use compiler options.
coffee
using public compiler::coffeeClasses;
using public compiler::implicitReturns.disable;
import "./path/to/something.coffee"; # it will allow coffeeClasses there as well
Notes
Keep in mind that when you do this, you are guaranteeing each file under it to be compiled differently, therefore maybe breaking other apps that were intended to use differently. But each file can override the previous options by strictly disabling or enabling them in your file.
All options
coffeeCompat
: Enable all coffee compatiblity settingsautoVar
: Automatically usevar
when u declare variablesautoLet
: Automatically uselet
when u declare variablesautoConst
: Automatically useconst
when u declare variablescoffeeBinaryExistential
: implied in the namecoffeeBooleans
: implied in the namecoffeeClasses
: implied in the namecoffeeComment
: implied in the namecoffeeDo
: implied in the namecoffeeEq
: implied in the namecoffeeForLoops
: implied in the namecoffeeInterpolation
: implied in the namecoffeeJSX
: implied in the namecoffeeLineContinuation
: implied in the namecoffeeNot
: implied in the namecoffeeOf
: implied in the namecoffeePrototype
: I do not reccommend disabling thisimplicitReturns
:true
by default, you won't have to strictly sayreturn
in functions