-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve typescript configuration
- Loading branch information
Showing
56 changed files
with
322 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,3 +34,4 @@ apps/web/cypress/screenshots/**/__tkey-*.png | |
apps/librelingo_tools/dist | ||
**/dist/ | ||
*.tsbuildinfo | ||
report.*.*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules/*"], | ||
"compilerOptions": { | ||
"outDir": "dist", | ||
"esModuleInterop": true, | ||
"types": ["jest", "node"] | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "@tsconfig/svelte/tsconfig.json", | ||
"include": ["src/**/*", "src/node_modules"], | ||
"exclude": ["node_modules/*", "__sapper__/*", "public/*"], | ||
"compilerOptions": { | ||
"outDir": "dist" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,27 @@ | ||
const getActualParent = node => node.parentElement.id ? node.parentElement : node.parentElement.parentElement | ||
const getActualParent = (node: HTMLElement): HTMLElement => { | ||
if (node?.parentElement?.id) { | ||
return node.parentElement | ||
} | ||
|
||
if (node?.parentElement?.parentElement) { | ||
return node.parentElement.parentElement | ||
} | ||
|
||
throw new Error("Invalid <Chip />") | ||
} | ||
|
||
export const getNodeType = node => getActualParent(node).id | ||
export const getNodeType = (node: HTMLElement): string => getActualParent(node).id | ||
|
||
export const getChipIndex = node => { | ||
if (!node.classList.contains("chip")) { | ||
export const getChipIndex = (node: HTMLElement): number => { | ||
if (!node.classList.contains("chip") && node.parentElement) { | ||
return getChipIndex(node.parentElement) | ||
} | ||
|
||
if (!node.previousSibling) { | ||
return 0 | ||
|
||
if (node.previousSibling !== null) { | ||
return 1 + getChipIndex(node.previousSibling as HTMLElement) | ||
} | ||
|
||
return 1 + getChipIndex(node.previousSibling) | ||
return 0 | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
2b464c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: