website: typescript config updates
- Added tsconfig file. - Set esbuild target. - Updated eslint rules for JSDoc. Change-Id: I212bdd58a56540da26cccc8af319a8d98fa9f35a Reviewed-on: https://go-review.googlesource.com/c/website/+/376074 Trust: Jamal Carvalho <jamalcarvalho@google.com> Reviewed-by: Alex Rakoczy <alex@golang.org>
This commit is contained in:
Родитель
e63aea0cc5
Коммит
f4f7323ce3
|
@ -18,3 +18,9 @@ overrides:
|
|||
- eslint:recommended
|
||||
- plugin:@typescript-eslint/recommended
|
||||
- plugin:prettier/recommended
|
||||
rules:
|
||||
valid-jsdoc:
|
||||
- error
|
||||
- requireParamType: false
|
||||
requireReturnType: false
|
||||
requireReturn: false
|
||||
|
|
|
@ -652,6 +652,7 @@ func (s *Site) serveTypeScript(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
result := api.Transform(contents.String(), api.TransformOptions{
|
||||
Loader: api.LoaderTS,
|
||||
Target: api.ES2018,
|
||||
})
|
||||
var buf bytes.Buffer
|
||||
for _, v := range result.Errors {
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
/* Visit https://aka.ms/tsconfig.json to read more about this file */
|
||||
"target": "es2018",
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"useUnknownInCatchVariables": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noImplicitOverride": true,
|
||||
"noPropertyAccessFromIndexSignature": true,
|
||||
"skipLibCheck": true,
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче