Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: enable TS strict mode #889

Merged
merged 28 commits into from
Sep 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
bd38f4d
chore: let's go baby
kanadgupta Sep 7, 2023
45b4195
Merge branch 'next' into ts-strict-mode
kanadgupta Sep 11, 2023
d37d141
refactor: add new AuthenticatedCommandOptions type
kanadgupta Sep 11, 2023
fe7d9d1
chore: bring AuthenticatedCommandOptions into createGHA file
kanadgupta Sep 11, 2023
d22e3cc
refactor: version parameter in `cleanHeaders`
kanadgupta Sep 11, 2023
64b085a
chore: other little typefixes in fetch file
kanadgupta Sep 11, 2023
2a91415
chore: more little TS fixes
kanadgupta Sep 11, 2023
69ed44c
chore: more straightforward type fixes
kanadgupta Sep 11, 2023
a71a0bb
Merge branch 'next' into ts-strict-mode
kanadgupta Sep 13, 2023
f7a2249
fix: various version typings
kanadgupta Sep 13, 2023
d21785f
chore: improved typing on oas prompt
kanadgupta Sep 13, 2023
ea2e542
fix: enable another tsconfig flag
kanadgupta Sep 14, 2023
b38e3a9
chore: add overdue stricter type
kanadgupta Sep 14, 2023
edf1240
refactor: backfill some types so we can re-enable lib check
kanadgupta Sep 14, 2023
bc36971
chore: temporarily disable strict mode to see if tests pass
kanadgupta Sep 14, 2023
c87861e
chore: remove some unnecessary overrides
kanadgupta Sep 14, 2023
5100923
revert: actually bring back skipLibCheck
kanadgupta Sep 14, 2023
fa2f524
fix: do not fallback to json
kanadgupta Sep 14, 2023
9c549d7
Merge branch 'next' into ts-strict-mode
kanadgupta Sep 14, 2023
f181e5b
Merge branch 'next' into ts-strict-mode
kanadgupta Sep 14, 2023
3c7305f
test: fix test
kanadgupta Sep 14, 2023
f6c64ce
revert: re-enable strictness
kanadgupta Sep 14, 2023
529e96f
chore: stricter option typing
kanadgupta Sep 14, 2023
dd326bd
refactor: remove function nesting
kanadgupta Sep 14, 2023
fd1c619
chore: fix typing in analyzer
kanadgupta Sep 14, 2023
b7dfaba
refactor: clearer type names
kanadgupta Sep 14, 2023
3bac0e2
chore: pr feedback
kanadgupta Sep 14, 2023
d0a55c6
fix: lint
kanadgupta Sep 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: fix typing in analyzer
  • Loading branch information
kanadgupta committed Sep 14, 2023
commit fd1c6199d2d19c0861cc981c8b2a60fce9c809da
19 changes: 9 additions & 10 deletions src/lib/analyzeOas.ts
Original file line number Diff line number Diff line change
@@ -169,31 +169,30 @@ const README_FEATURE_DOCS: Record<keyof Analysis['readme'], Pick<AnalyzedFeature
*
*/
async function analyzeOas(definition: OASDocument) {
return analyzer(definition).then((analysis: Analysis) => {
return analyzer(definition).then(analysisResult => {
const analysis = analysisResult as Analysis;
if (analysis.openapi) {
Object.entries(OPENAPI_FEATURE_DOCS).forEach(([feature, docs]: [keyof Analysis['openapi'], AnalyzedFeature]) => {
// eslint-disable-next-line no-param-reassign
analysis.openapi[feature] = {
...analysis.openapi[feature],
Object.entries(OPENAPI_FEATURE_DOCS).forEach(([feature, docs]) => {
analysis.openapi[feature as keyof Analysis['openapi']] = {
...analysis.openapi[feature as keyof Analysis['openapi']],
...docs,
};
});
}

if (analysis.readme) {
Object.entries(README_FEATURE_DOCS).forEach(([feature, docs]: [keyof Analysis['readme'], AnalyzedFeature]) => {
Object.entries(README_FEATURE_DOCS).forEach(([feature, docs]) => {
// If this ReadMe feature isn't in our resulted analysis result then it's a deprecated
// feature that this API definition doesn't contain so we don't need to inform the user of
// something they neither use, can't use anyways, nor should know about.
if (!(feature in analysis.readme)) {
return;
}

// eslint-disable-next-line no-param-reassign
analysis.readme[feature] = {
...analysis.readme[feature],
analysis.readme[feature as keyof Analysis['readme']] = {
...analysis.readme[feature as keyof Analysis['readme']],
...docs,
};
} as AnalyzedFeature;
});
}