Skip to content

Commit

Permalink
Add TypeScript compiler config
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 22, 2023
1 parent 6500bf2 commit 73a706a
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 8 deletions.
8 changes: 8 additions & 0 deletions app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.base.json",
"include": ["**/*.js", "**/*.json"],
"exclude": ["**/*.test.*"],
"compilerOptions": {
"resolveJsonModule": true
}
}
35 changes: 28 additions & 7 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@percy/cli": "^1.20.0",
"@percy/puppeteer": "^2.0.2",
"@percy/sdk-utils": "^1.20.0",
"@types/node": "^18.11.18",
"cheerio": "^1.0.0-rc.12",
"editorconfig-checker": "^5.0.1",
"eslint": "^8.34.0",
Expand All @@ -105,7 +106,8 @@
"standard": "^17.0.0",
"stylelint": "^14.16.1",
"stylelint-config-gds": "^0.2.0",
"stylelint-order": "^6.0.2"
"stylelint-order": "^6.0.2",
"typescript": "^4.9.5"
},
"overrides": {
"chokidar@^2": {
Expand Down
9 changes: 9 additions & 0 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.base.json",
"include": ["**/*.mjs"],
"exclude": ["**/*.test.*"],
"compilerOptions": {
"lib": ["ESNext", "DOM"],
"target": "ES2015"
}
}
1 change: 1 addition & 0 deletions tasks/gulp/__tests__/after-build-package.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ describe('package/', () => {
'!**/*.test.*',
'!**/__snapshots__/',
'!**/__snapshots__/**',
'!**/tsconfig.json',
'!govuk/README.md'
]

Expand Down
1 change: 1 addition & 0 deletions tasks/gulp/copy-to-destination.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export function copyFiles () {
'!**/*.test.*',
'!**/__snapshots__/',
'!**/__snapshots__/**',
'!**/tsconfig.json',

// Preserve destination README when copying to ./package
// https://github.com/alphagov/govuk-frontend/tree/main/package#readme
Expand Down
14 changes: 14 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"allowJs": true,
"checkJs": true,
"lib": ["ESNext"],
"module": "NodeNext",
"noEmit": true,
"strict": false,
"strictBindCallApply": true,
"strictFunctionTypes": true,
"target": "ESNext",
"types": ["node"]
}
}
12 changes: 12 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./tsconfig.base.json",
"files": [],
"references": [
{
"path": "./app"
},
{
"path": "./src"
}
]
}

0 comments on commit 73a706a

Please sign in to comment.