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

feat: add tsconfig and .ts file extensions to .forceignore #590

Merged
merged 3 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions packages/lightning-lsp-common/src/__tests__/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ it('configureSfdxProject()', async () => {
// .forceignore
const forceignoreContent = fs.readFileSync(forceignorePath, 'utf8');
expect(forceignoreContent).toContain('**/jsconfig.json');
expect(forceignoreContent).toContain('**/tsconfig.json');
expect(forceignoreContent).toContain('**/.eslintrc.json');
expect(forceignoreContent).toContain('**/*.ts');
Comment on lines 200 to +204
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've also manually verified this works in a sfdx workspace by running the following sf cli command:

sf project list ignored --source-dir force-app/main/default

Which results in the following:

Found the following ignored files:
...
force-app/main/default/lwc/test/test.ts
force-app/main/default/lwc/tsconfig.json


// typings
expect(join(sfdxTypingsPath, 'lds.d.ts')).toExist();
Expand Down
2 changes: 2 additions & 0 deletions packages/lightning-lsp-common/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,9 @@ export class WorkspaceContext {

private async updateForceIgnoreFile(ignoreFile: string): Promise<void> {
await utils.appendLineIfMissing(ignoreFile, '**/jsconfig.json');
await utils.appendLineIfMissing(ignoreFile, '**/tsconfig.json');
await utils.appendLineIfMissing(ignoreFile, '**/.eslintrc.json');
await utils.appendLineIfMissing(ignoreFile, '**/*.ts');
}

/**
Expand Down
Loading