Skip to content

Commit

Permalink
Use @tsconfig/strictest instead
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Sep 24, 2022
1 parent d011f62 commit 57f9b5a
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 67 deletions.
29 changes: 21 additions & 8 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions dist/post/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lint-doc/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lint-fmt/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"yaml": "2.1.1"
},
"devDependencies": {
"@tsconfig/strictest": "1.0.1",
"@types/node": "18.7.18",
"@types/semver": "7.3.12",
"@typescript-eslint/eslint-plugin": "5.38.0",
Expand Down
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lint-doc/odoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function lintOdoc() {
const options: ExecOptions = {
env: {
...process.env,
PATH: process.env.PATH ?? "",
PATH: process.env["PATH"] ?? "",
ODOC_WARN_ERROR: "true",
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/lint-fmt/ocamlformat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import * as path from "path";
import { convertToUnix } from "./compat";

async function parse() {
const githubWorkspace = process.env.GITHUB_WORKSPACE ?? process.cwd();
const githubWorkspace = process.env["GITHUB_WORKSPACE"] ?? process.cwd();
const fpath = path.join(githubWorkspace, ".ocamlformat");
const buf = await fs.readFile(fpath);
const str = buf.toString();
Expand Down
6 changes: 3 additions & 3 deletions src/setup-ocaml/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function composeOpamDownloadCacheKeys() {

function composeCygwinCachePaths() {
const paths = [];
const githubWorkspace = process.env.GITHUB_WORKSPACE ?? process.cwd();
const githubWorkspace = process.env["GITHUB_WORKSPACE"] ?? process.cwd();
const cygwinRoot = path.join("D:", "cygwin");
paths.push(cygwinRoot);
const cygwinRootSymlinkPath = path.posix.join("/cygdrive", "d", "cygwin");
Expand All @@ -132,7 +132,7 @@ function composeDuneCachePaths() {
const duneCacheDir = path.join(homeDir, "Local Settings", "Cache", "dune");
paths.push(duneCacheDir);
} else {
const xdgCacheHome = process.env.XDG_CACHE_HOME;
const xdgCacheHome = process.env["XDG_CACHE_HOME"];
const duneCacheDir = xdgCacheHome
? path.join(xdgCacheHome, "dune")
: path.join(homeDir, ".cache", "dune");
Expand Down Expand Up @@ -164,7 +164,7 @@ function composeOpamCachePaths() {
const opamRootCachePath = path.join(homeDir, ".opam");
paths.push(opamRootCachePath);
}
const githubWorkspace = process.env.GITHUB_WORKSPACE ?? process.cwd();
const githubWorkspace = process.env["GITHUB_WORKSPACE"] ?? process.cwd();
const opamLocalCachePath = path.join(githubWorkspace, "_opam");
paths.push(opamLocalCachePath);
return paths;
Expand Down
32 changes: 16 additions & 16 deletions src/setup-ocaml/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,27 +66,27 @@ export async function installer(): Promise<void> {
core.endGroup();
}
if (platform === Platform.Win32) {
core.exportVariable("HOME", process.env.USERPROFILE);
core.exportVariable("HOME", process.env["USERPROFILE"]);
core.exportVariable("MSYS", "winsymlinks:native");
}
if (platform === Platform.Win32) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const originalPath = process.env.PATH!.split(path.delimiter);
const originalPath = process.env["PATH"]!.split(path.delimiter);
const msys64Path = path.join("C:", "msys64", "usr", "bin");
const patchedPath = [msys64Path, ...originalPath];
process.env.PATH = patchedPath.join(path.delimiter);
process.env["PATH"] = patchedPath.join(path.delimiter);
await restoreCygwinCache();
process.env.PATH = originalPath.join(path.delimiter);
process.env["PATH"] = originalPath.join(path.delimiter);
}
let opamCacheHit;
if (platform === Platform.Win32) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const originalPath = process.env.PATH!.split(path.delimiter);
const originalPath = process.env["PATH"]!.split(path.delimiter);
const msys64Path = path.join("C:", "msys64", "usr", "bin");
const patchedPath = [msys64Path, ...originalPath];
process.env.PATH = patchedPath.join(path.delimiter);
process.env["PATH"] = patchedPath.join(path.delimiter);
opamCacheHit = await restoreOpamCache();
process.env.PATH = originalPath.join(path.delimiter);
process.env["PATH"] = originalPath.join(path.delimiter);
} else {
opamCacheHit = await restoreOpamCache();
}
Expand All @@ -102,24 +102,24 @@ export async function installer(): Promise<void> {
await installOcaml(ocamlCompiler);
if (platform === Platform.Win32) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const originalPath = process.env.PATH!.split(path.delimiter);
const originalPath = process.env["PATH"]!.split(path.delimiter);
const msys64Path = path.join("C:", "msys64", "usr", "bin");
const patchedPath = [msys64Path, ...originalPath];
process.env.PATH = patchedPath.join(path.delimiter);
process.env["PATH"] = patchedPath.join(path.delimiter);
await saveOpamCache();
process.env.PATH = originalPath.join(path.delimiter);
process.env["PATH"] = originalPath.join(path.delimiter);
} else {
await saveOpamCache();
}
}
if (platform === Platform.Win32) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const originalPath = process.env.PATH!.split(path.delimiter);
const originalPath = process.env["PATH"]!.split(path.delimiter);
const msys64Path = path.join("C:", "msys64", "usr", "bin");
const patchedPath = [msys64Path, ...originalPath];
process.env.PATH = patchedPath.join(path.delimiter);
process.env["PATH"] = patchedPath.join(path.delimiter);
await restoreOpamDownloadCache();
process.env.PATH = originalPath.join(path.delimiter);
process.env["PATH"] = originalPath.join(path.delimiter);
} else {
await restoreOpamDownloadCache();
}
Expand All @@ -129,12 +129,12 @@ export async function installer(): Promise<void> {
if (DUNE_CACHE) {
if (platform === Platform.Win32) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const originalPath = process.env.PATH!.split(path.delimiter);
const originalPath = process.env["PATH"]!.split(path.delimiter);
const msys64Path = path.join("C:", "msys64", "usr", "bin");
const patchedPath = [msys64Path, ...originalPath];
process.env.PATH = patchedPath.join(path.delimiter);
process.env["PATH"] = patchedPath.join(path.delimiter);
await restoreDuneCache();
process.env.PATH = originalPath.join(path.delimiter);
process.env["PATH"] = originalPath.join(path.delimiter);
} else {
await restoreDuneCache();
}
Expand Down
Loading

0 comments on commit 57f9b5a

Please sign in to comment.