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

Refactoring common tsconfig #9507

Merged
merged 5 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
17 changes: 1 addition & 16 deletions applications/browser-extension/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,7 @@
{
// You can see the full details at https://github.com/sindresorhus/tsconfig/blob/main/tsconfig.json
// Note: `strict: true` enables many flags that aren’t explicitly listed in that file
"extends": "@sindresorhus/tsconfig",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"sourceMap": true,
"module": "esnext",
"target": "es2023",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"baseUrl": ".",
"outDir": null,
"declaration": false,

// TODO: Drop these lines to make TS stricter https://github.com/pixiebrix/pixiebrix-extension/issues/775
"strictFunctionTypes": false,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": false,
"noUnusedParameters": false,
"paths": {
"@/*": ["src/*"],
"@img/*": ["img/*"],
Expand Down
20 changes: 2 additions & 18 deletions libraries/utils/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,9 @@
{
// You can see the full details at https://github.com/sindresorhus/tsconfig/blob/main/tsconfig.json
// Note: `strict: true` enables many flags that aren’t explicitly listed in that file
"extends": "@sindresorhus/tsconfig",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"sourceMap": true,
"module": "esnext",
"target": "es2023",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"baseUrl": ".",
"outDir": null,
"declaration": false,

// TODO: Drop these lines to make TS stricter https://github.com/pixiebrix/pixiebrix-extension/issues/775
"strictFunctionTypes": false,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": false,
"noUnusedParameters": false,
"paths": {
"@/*": ["src/*"]
}
},
"exclude": ["node_modules"]
}
}
3 changes: 3 additions & 0 deletions pixiebrix-extension.iml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<excludeFolder url="file://$MODULE_DIR$/applications/browser-extension/scripts/bin" />
<excludeFolder url="file://$MODULE_DIR$/.playwright-report" />
<excludeFolder url="file://$MODULE_DIR$/applications/browser-extension/dist" />
<excludeFolder url="file://$MODULE_DIR$/applications/browser-extension/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/libraries/utils/coverage" />
<excludePattern pattern="applications/browser-extension/report.html" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
22 changes: 22 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
// You can see the full details at https://github.com/sindresorhus/tsconfig/blob/main/tsconfig.json
// Note: `strict: true` enables many flags that aren’t explicitly listed in that file
"extends": "@sindresorhus/tsconfig",
Comment on lines +2 to +4
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to consider just copying the relevant config values to make them more explicit. We override a fair bit of these anyways

"compilerOptions": {
"sourceMap": true,
"module": "esnext",
"target": "es2023",
"moduleResolution": "bundler",
"resolveJsonModule": true,
"baseUrl": ".",
"outDir": null,
"declaration": false,

// TODO: Drop these lines to make TS stricter https://github.com/pixiebrix/pixiebrix-extension/issues/775
Copy link
Contributor

@twschiller twschiller Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: we should consider making some of these stricter in the base config (would require discussion of style)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They've been on my radar for post strictNullChecks

"strictFunctionTypes": false,
"noPropertyAccessFromIndexSignature": false,
"noImplicitReturns": false,
"noUnusedParameters": false
},
"exclude": ["node_modules"]
}
Loading