-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Fixed global eslint and tsconfig #36
Conversation
They seem not to be needed when using npm workspaces, as it should add symlinks
The "funny thing" was that the issue was with not wrapping pattern with ''🤦. See eslint/eslint#13896 (comment)
…ative resolution happy
@@ -11,12 +11,12 @@ | |||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | |||
"plugin:prettier/recommended" | |||
], | |||
"ignorePatterns": ["dist/", "lib/"], | |||
"ignorePatterns": ["**/dist/", "**/lib/"], |
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.
To ignore nested folders inside packages.
@@ -0,0 +1,9 @@ | |||
{ | |||
"extends": "./tsconfig.shared.json", | |||
"include": ["./packages/**/*.ts", "./docs/**/*.ts", "./tsup.config.ts"], |
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.
Eslint seems not to deal well with the project references. But they're needed to correctly resolve correctly dependencies by TypeScript. That's why, as a workaround, I added a dedicated file that removes dependencies but adds "./packages/**/*.ts"
. It's weird, but it works...
@@ -0,0 +1,3 @@ | |||
{ |
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.
Those dummy files are needed for vscode eslint plugin, as it runs eslint config locally for packages. And as in the file, we have a reference for tsconfig.eslint.json
. Then if it won't find such a file in the local package folder, then it will cry out loud and doesn't highlight eslint errors.
Needed to configure a separate config for eslint, as it doesn't deal well with the TypeScript project references. Also, it wasn't checking correctly the eslint settings, as eslint requires wrapping global pattern in
''
to be passed as a parameter instead of taken as the shell pattern. 🤦Updated also pipeline to run ts build before linting to have correctly resolved dependencies between packages and non-package code.
Fixes #18.