You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on developing a variant of civet syntax, so I give my files extensions which are not '.civet'. However, when I try to use the --typecheck option and provide the actual file name, I get an error which I think is because the file extension is not '.civet'. E.g., consider the following file:
let x: string = 42
Let's say I create 2 different files with these same contents, and name them test.civet and test.other. Here is the result of executing civet --typecheck test.civet
$ civet --typecheck test.civet
test.civet.tsx:1:5 - error TS2322: Type 'number' is not assignable to type 'string'.
1 let x: string = 42
~
which is what I expect. However, when I execute civet --typecheck test.other, I get:
$ civet --typecheck test.other
TypeError: Cannot read properties of null (reading 'code')
at cli (C:\Users\johnd\llutils\node_modules\@danielx\civet\dist\civet:562:32)
The text was updated successfully, but these errors were encountered:
I agree that the CLI shouldn't error like this, but I'm not sure what the behavior should be. I think it's reasonable to expect civet --typecheck to work with both .civet files and .ts/.js files (which just get passed onto TypeScript). How is it supposed to know what to do with .other files?
To understand your context: Are you transpiling from .other to .civet? If so, why not use civet --typecheck on the resulting .civet files? Or are modifying Civet itself to support .other? If so, why not modify the CLI accordingly? I think I'm missing the intended application where other extensions make sense with the Civet CLI.
I'm working on developing a variant of civet syntax, so I give my files extensions which are not '.civet'. However, when I try to use the
--typecheck
option and provide the actual file name, I get an error which I think is because the file extension is not '.civet'. E.g., consider the following file:let x: string = 42
Let's say I create 2 different files with these same contents, and name them
test.civet
andtest.other
. Here is the result of executingcivet --typecheck test.civet
which is what I expect. However, when I execute
civet --typecheck test.other
, I get:The text was updated successfully, but these errors were encountered: