Enrique Santeliz
04/29/2021, 7:58 PMnpx create-serverless-stack@latest my-sst-app --language typescript . And treating this as one of the packages of the monorepo.
The problem begins when I try to use other packages from my monorepo to develop something.
I have two packages:
rest-api this is the sst package
@temis/utils this is another typescript package
Inside rest-api I do a yarn add @temis/utils in order to use this package as a dependency, and develop some logic.
So, I run yarn build inside @temis/utils and builds successfully.
Then I run the same in rest-api and when its linting the code, this happens:
.../dist/validator/index.js
3:7 error Unexpected dangling '_' in '__createBinding' no-underscore-dangle
4:12 error Unexpected dangling '_' in '__createBinding' no-underscore-dangle
6:7 warning Unexpected unnamed function func-names
7:31 error Assignment to function parameter 'k2'
.........
There was a problem linting the source.
There was an error synthesizing your app.
Note that the sst package is trying to lint the compiled code from @temis/utils (using the dist folder: dist/validator/index.js).
The tsconfig in @temis/utils is simple:
{
"compilerOptions": {
"declarationMap": false,
"target": "es5",
"module": "commonjs",
"strict": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist",
"rootDir": "./src"
}
}
And the tsconfig in the sst package is the default one, I haven't touched it so far:
{
"compilerOptions": {
"target": "ES2018",
"module": "commonjs",
"lib": [
"es2018",
"dom"
],
"types": [
"node"
],
"declaration": true,
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": false,
"inlineSources": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"sourceMap": true,
"baseUrl": ".",
"esModuleInterop": true,
"skipLibCheck": true
},
"include": [
"lib",
"src"
]
}
So, anyone has faced this problem before?
Maybe its related to some typescript specific config that I don't know yet. I fairly new using typescript.
Thank you in advanceFrank
Jay
dist/ folder is getting picked up. Where are you running yarn build from? Is the .../dist/validator/index.js make sense? Is your dist/ folder above the where the rest-api is?Enrique Santeliz
04/29/2021, 8:32 PMpackages and services are the workspaces containing TS projectsEnrique Santeliz
04/29/2021, 8:58 PMlint: false and this fixed the issue đŸ™‚Jay
Enrique Santeliz
04/29/2021, 9:05 PM