-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
chore: refactor tsconfigs to use project references #9038
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
{ | ||
"extends": "./tsconfig.build.json", | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"composite": false, | ||
"rootDir": "." | ||
"outDir": "../../dist/out-tsc/ast-spec" | ||
Comment on lines
-2
to
+4
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a "solution" file, there's actually no reason to extend anything here; these options are all noops. But, I'm not sure that this layout is quite right, depending on other tooling which may assume that the tsconfig contains the options for the code. Maybe this extension is why you dont' have problems? |
||
}, | ||
"include": ["src", "typings", "tests", "tools", "**/fixtures/**/config.ts"], | ||
"exclude": ["**/fixtures/**/fixture.ts", "**/fixtures/**/fixture.tsx"], | ||
"references": [{ "path": "../typescript-estree/tsconfig.build.json" }] | ||
"files": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
Comment on lines
+6
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is interesting; I assume these are the main code and the tests, in which case I would have actually expected you to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea behind this approach/config structure was as follows:
Does that all make sense? Is there a different/more optimal way to achieve the above objectives around having typecheck and build be separate actions/targets? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That does make some sense, I was jus tlooking for ways to simplify things. But this is not dissimilar to how vite does things where it makes an extra tsconfig that's referenced just for config files. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc/ast-spec", | ||
"types": ["jest", "node"], | ||
"noImplicitAny": false | ||
}, | ||
"exclude": ["tests/fixtures"], | ||
"include": [ | ||
"tests", | ||
"tools", | ||
"**/*.test.ts", | ||
"**/*.spec.ts", | ||
"**/*.test.tsx", | ||
"**/*.spec.tsx", | ||
"**/*.test.js", | ||
"**/*.spec.js", | ||
"**/*.test.jsx", | ||
"**/*.spec.jsx", | ||
"**/*.d.ts" | ||
], | ||
"references": [ | ||
{ | ||
"path": "../typescript-estree/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "./tsconfig.build.json" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,25 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
// specifically disable declarations for the plugin | ||
// specifically disable declarations for the plugin (which requires disabling composite) | ||
"composite": false, | ||
"declaration": false, | ||
"declarationMap": false, | ||
"outDir": "./dist", | ||
"rootDir": "./src", | ||
"emitDeclarationOnly": false, | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["src", "typings"], | ||
"references": [{ "path": "../utils/tsconfig.build.json" }] | ||
"references": [ | ||
{ | ||
"path": "../rule-tester/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../utils/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../type-utils/tsconfig.build.json" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
{ | ||
"extends": "./tsconfig.build.json", | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
// specifically disable declarations for the plugin (which requires disabling composite) | ||
"composite": false, | ||
"target": "ES2022", | ||
"emitDeclarationOnly": false, | ||
"noEmit": true, | ||
"declaration": false, | ||
"declarationMap": false, | ||
"rootDir": "." | ||
}, | ||
"include": ["src", "typings", "tests", "index.d.ts"], | ||
"references": [{ "path": "../utils/tsconfig.build.json" }] | ||
"references": [ | ||
{ | ||
"path": "../rule-tester/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../utils/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../type-utils/tsconfig.build.json" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,32 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"compilerOptions": { | ||
// specifically disable declarations for the plugin | ||
// specifically disable declarations for the plugin (which requires disabling composite) | ||
// see reasoning in packages/eslint-plugin/rules.d.ts | ||
"composite": false, | ||
"declaration": false, | ||
"declarationMap": false, | ||
"outDir": "./dist", | ||
"rootDir": "./src", | ||
"emitDeclarationOnly": false, | ||
"rootDir": "src", | ||
"outDir": "dist", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["src", "typings"], | ||
"references": [ | ||
{ "path": "../utils/tsconfig.build.json" }, | ||
{ "path": "../parser/tsconfig.build.json" }, | ||
{ "path": "../scope-manager/tsconfig.build.json" }, | ||
{ "path": "../type-utils/tsconfig.build.json" } | ||
{ | ||
"path": "../utils/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../parser/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../rule-tester/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../scope-manager/tsconfig.build.json" | ||
}, | ||
{ | ||
"path": "../type-utils/tsconfig.build.json" | ||
} | ||
] | ||
} |
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.
Oh, hm, you're using
emitDeclarationOnly
, but only sometimes. It seems simpler to only set noEmit for test projects, then leave all emit on in the base config, then only havetsconfig.json
andtsconfig.spec.json
per-package if you want to split apart tests.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.
Let me know if my comment here #9038 (comment) alters your view on this please. Having type-checking not produce .js etc artifacts would seem to be desirable, and therefore we would need a way to distinguish between type-checking vs building