Skip to content

Commit 91a5efd

Browse files
committed
Typescript config
1 parent 76f8eaa commit 91a5efd

4 files changed

Lines changed: 48 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This project is built using the following tools/technologies:
99
1. [Next.js](https://nextjs.org/)
1010
2. [Chakra UI](https://chakra-ui.com/)
1111

12+
This project uses a combination of Javascript and Typescript (Javascript - as that was the language of the original website, and Typescript - to enforce typing for the data files).
13+
1214
## Requirements
1315

1416
1. [Node.js](https://nodejs.org/)

next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.

src/types/global.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// This file helps TypeScript understand your existing JavaScript code
2+
// Add more type declarations as needed
3+
4+
declare module '*.md' {
5+
const content: string
6+
export default content
7+
}
8+
9+
declare module '*.mdx' {
10+
const content: string
11+
export default content
12+
}
13+
14+
// Add any other module declarations you need

tsconfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"allowJs": true,
6+
"skipLibCheck": true,
7+
"strict": false,
8+
"noEmit": true,
9+
"esModuleInterop": true,
10+
"module": "esnext",
11+
"moduleResolution": "bundler",
12+
"resolveJsonModule": true,
13+
"isolatedModules": true,
14+
"jsx": "preserve",
15+
"incremental": true,
16+
"plugins": [
17+
{
18+
"name": "next"
19+
}
20+
],
21+
"paths": {
22+
"@/*": ["./src/*"]
23+
}
24+
},
25+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
26+
"exclude": ["node_modules"]
27+
}

0 commit comments

Comments
 (0)