R
roblox-ts•4w ago
Elysian

Transformer & Dependency Compilation Error

54 Replies
iSentinel
iSentinel•4w ago
Can you post your tsconfig and package.json
Elysian
ElysianOP•4w ago
tsconfig.json
{
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",
"target": "ESNext",
"jsx": "react",
"jsxFactory": "React.createElement",
"jsxFragmentFactory": "React.Fragment",
"moduleDetection": "force",
"noLib": true,
"experimentalDecorators": true,
"baseUrl": "src",
"rootDir": "src",
"module": "commonjs",
"moduleResolution": "Node",
"resolveJsonModule": true,
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],
"strict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"useUnknownInCatchVariables": true,
"downlevelIteration": true,
"outDir": "out/",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"plugins": [
{
"transform": "rbxts-transformer-flamework",
"obfuscation": false
},
{
"transform": "rbxts-transform-debug"
},
{
"transform": "rbxts-transform-env",
"shortCircuitNodeEnv": false,
"defaultEnvironment": "development"
}
]
},
"exclude": [
"./eslint.config.ts",
"./commitlint.config.ts",
"**/node_modules"
]
}
{
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "out/tsconfig.tsbuildinfo",
"target": "ESNext",
"jsx": "react",
"jsxFactory": "React.createElement",
"jsxFragmentFactory": "React.Fragment",
"moduleDetection": "force",
"noLib": true,
"experimentalDecorators": true,
"baseUrl": "src",
"rootDir": "src",
"module": "commonjs",
"moduleResolution": "Node",
"resolveJsonModule": true,
"typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"],
"strict": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"useUnknownInCatchVariables": true,
"downlevelIteration": true,
"outDir": "out/",
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"plugins": [
{
"transform": "rbxts-transformer-flamework",
"obfuscation": false
},
{
"transform": "rbxts-transform-debug"
},
{
"transform": "rbxts-transform-env",
"shortCircuitNodeEnv": false,
"defaultEnvironment": "development"
}
]
},
"exclude": [
"./eslint.config.ts",
"./commitlint.config.ts",
"**/node_modules"
]
}
Solution
Tesmi
Tesmi•4w ago
No description
Tesmi
Tesmi•4w ago
here is your problem
Tesmi
Tesmi•4w ago
I advise you to simply remove them
No description
iSentinel
iSentinel•4w ago
I use noUncheckedIndexAccess all the time, but I don't use noUnusedLocals, tend to use eslint for things like that
Elysian
ElysianOP•4w ago
Hm, let me try disabling noUnusedLocals Those errors seem to be gone now. I gotta fix a few unrelated ones and then see if the game builds just fine
iSentinel
iSentinel•4w ago
I need to remove the tsconfig.build.json from my template lol its not needed anymore
Tesmi
Tesmi•4w ago
usually you first see syntax errors from typescript after all the transformers have finished running, after which you may see errors from roblox-ts itself
Elysian
ElysianOP•4w ago
Yep, seems like the typescript errors are dealt with. The current ones are error TS roblox-ts: Thanks a ton for the help. I'll mark this as solved in a bit once the game builds (just to make sure) Hey @iSentinel, is typescript-eslint/no-unused-vars enabled by default in your eslint config?
iSentinel
iSentinel•4w ago
yes
Elysian
ElysianOP•4w ago
Disabling noUnusedLocals in tsconfig.json seems to have completely removed all warnings of it
iSentinel
iSentinel•4w ago
under:
"ts/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
reportUsedIgnorePattern: true,
varsIgnorePattern: "^_",
},
],
"ts/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
reportUsedIgnorePattern: true,
varsIgnorePattern: "^_",
},
],
Elysian
ElysianOP•4w ago
Eslint isn't logging it, either
Elysian
ElysianOP•4w ago
It's just grayed out
No description
Elysian
ElysianOP•4w ago
That's odd, even directly specifying no-unused-vars in eslint.config.json does nothing...
No description
Elysian
ElysianOP•4w ago
No description
iSentinel
iSentinel•4w ago
Can you run 'npx @eslint/config-inspector' and see the state of the rule?
Elysian
ElysianOP•4w ago
Sure
Elysian
ElysianOP•4w ago
Never used the inspector before, but do you mean this? Filtered for the specific file shown in the screenshot
No description
Elysian
ElysianOP•4w ago
Seems to be enabled
Elysian
ElysianOP•4w ago
Full screenshot
No description
iSentinel
iSentinel•4w ago
Yes, just wanted to make sure it was enabled I'll have a look later and see if it works on my end still What version of my config are you on
Elysian
ElysianOP•4w ago
1.0.0 Seems latest is 1.2.6, should I upgrade?
iSentinel
iSentinel•4w ago
Could be worth trying But you might get a few eslint errors XD
Elysian
ElysianOP•4w ago
Haha, let's see It's fixed!
Elysian
ElysianOP•4w ago
That's an awesome rule
No description
iSentinel
iSentinel•4w ago
šŸŽ‰
Elysian
ElysianOP•4w ago
A few is a bit of an understatement
Elysian
ElysianOP•4w ago
Elysian
ElysianOP•4w ago
Ah, didn't mean to ping on reply
iSentinel
iSentinel•4w ago
its cool i prefer it
Elysian
ElysianOP•4w ago
So do I Ah you're talking about the ping? I meant the new rules
iSentinel
iSentinel•4w ago
the ping šŸ˜„
Elysian
ElysianOP•4w ago
Haha
iSentinel
iSentinel•4w ago
I just need to go through and figure out perf at some point, its a bit slow at times
Elysian
ElysianOP•4w ago
Never really noticed any delays, to be honest Might be different for massive codebases, though?
iSentinel
iSentinel•4w ago
It can be. My machine is fine with it, but fresh-runs can be slower. Running npx eslint in my previous project could take ~15s I think spell checking was like a 1/3rd of that
Elysian
ElysianOP•4w ago
Jeez How large was your previous project? Sentinel, did you enforce arrow-parens in the latest updates?
iSentinel
iSentinel•4w ago
err, reasonably, it was a lot of react code, but nothing like giganstic either As in like function((x) => {}?
Elysian
ElysianOP•4w ago
Yep
iSentinel
iSentinel•4w ago
Yes
Elysian
ElysianOP•4w ago
iSentinel
iSentinel•4w ago
I kind of prefer not having them when not needed But at the same time It makes adding new params harder for example
Elysian
ElysianOP•4w ago
That's fair
iSentinel
iSentinel•4w ago
Since you have to go add them in just to add a new arg
Elysian
ElysianOP•4w ago
I guess it's aesthetic vs practicality
iSentinel
iSentinel•4w ago
Yeah, so it's trying to find a balance And in the end I just decided it wasn't worth it and if anything it was less consistent
Elysian
ElysianOP•4w ago
I agree with consistency, but it also feels a lot cleaner doing something like const x = function(object => {}) Looks a bit more difficult to read with the parenthesis I'll probably just disable it if i can find the rule
Elysian
ElysianOP•4w ago
iSentinel
iSentinel•4w ago
It's in prettier Under "arrowParens: "always"," You should just be able to, in the config, set prettier under "formatters" with that option and then it'll only override the option you gave
Elysian
ElysianOP•4w ago
Yep, all done
formatters: { prettierOptions: { arrowParens: "avoid" } },
formatters: { prettierOptions: { arrowParens: "avoid" } },
Thanks
iSentinel
iSentinel•4w ago
np!

Did you find this page helpful?