Hello,
I used to use contracts in Racket of all languages, so glad to see something similar exists for JS!
Anyway, every time I try to compile anything with the contracts plugin, I get Unexpected token (2:9). It doesn't matter what is at position 2:9, even comments will trigger the same error.
.babelrc
{
"plugins": [
["contracts", {
"names": {
"assert": "assert",
"precondition": "pre",
"postcondition": "post",
"invariant": "invariant",
"return": "it",
"old": "old"
}
}]
]
}
test.js
const add1 = n => {
pre: typeof n === 'number';
return n + 1
}
babel --version
6.26.0 (babel-core 6.26.3)
Do I need babel 7 for this? 6.26.3 is the latest version in npm.
https://www.npmjs.com/package/babel-core
Hello,
I used to use contracts in Racket of all languages, so glad to see something similar exists for JS!
Anyway, every time I try to compile anything with the contracts plugin, I get
Unexpected token (2:9). It doesn't matter what is at position 2:9, even comments will trigger the same error..babelrc
{ "plugins": [ ["contracts", { "names": { "assert": "assert", "precondition": "pre", "postcondition": "post", "invariant": "invariant", "return": "it", "old": "old" } }] ] }test.js
babel --version
Do I need babel 7 for this? 6.26.3 is the latest version in npm.
https://www.npmjs.com/package/babel-core