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

Option to prevent rewriting tsconfig.json file #703

Closed
3 tasks done
basarat opened this issue Nov 3, 2015 · 13 comments · Fixed by #715
Closed
3 tasks done

Option to prevent rewriting tsconfig.json file #703

basarat opened this issue Nov 3, 2015 · 13 comments · Fixed by #715

Comments

@basarat
Copy link
Member

basarat commented Nov 3, 2015

For people that don't care about keeping files in sync (for other IDE use) or just don't want us messing with their tsconfig.json file formatting, provide an option to disable tsconfig.json overwriting

  • Add some place to use this setting (the simplest location would be to use tsconfig.json as that file is available to tsconfig.ts (our code that rewrites tsconfig.json)
  • Add code to tsconfig.ts to use this option
  • Document option here and optionally here
@jkillian
Copy link

jkillian commented Nov 3, 2015

👍 We're using grunt-ts to update the files on compile and it writes paths/orders them a little different than atom-typescript. It would be great to have a way to disable auto-updating files.

@slikts
Copy link

slikts commented Nov 4, 2015

The current atom-ts options in tsconfig.json have the problem of being easy to confuse with the default TS options, especially to people unfamiliar with atom-ts. Adding more options would make this problem worse, so new options should at least be under a separate key to make it clear what they belong to.

@basarat
Copy link
Member Author

basarat commented Nov 4, 2015

so new options should at least be under a separate key to make it clear what they belong to

👍 in this case as we want grunt to ignore this option

@blakeembrey
Copy link
Member

If it's going to be a key in tsconfig.json, it should be default off otherwise people need to add implementation specific details to disable implementation specific features. I would prefer a checkbox in the atom package itself. I personally don't use any of the auto-updating in any packages, but I know it's always possible that I'd end up consuming one.

@szunami
Copy link

szunami commented Nov 10, 2015

This feature is fairly annoying for my project's setup and I'd be happy to implement this. I'm currently having some trouble getting the project to build; are their docs on this?

When I run grunt, I get a ton of errors like:

atom-typescript/lib/main/atom/typescriptGrammar.ts(183,53): error TS2503: Cannot find namespace 'ts'.
atom-typescript/lib/main/lang/core/project.ts(43,32): error TS2304: Cannot find name 'ts'.
atom-typescript/lib/main/lang/fixmyts/quickFixes/addClassMember.ts(112,13): error TS2322: Type '{ span: { start: any; length: number; }; newText: string; filePath: any; }' is not assignable to type 'Refactoring'.

@szunami
Copy link

szunami commented Nov 11, 2015

I realized that the grunt file was broken (#4).

I'm working on this now.

szunami pushed a commit to szunami/atom-typescript that referenced this issue Nov 11, 2015
The rewriteTsconfig flag enables users to prevent Atom-Typescript
from rewriting their tsconfig.json. The flag defaults to true,
so users who upgrade won't observe any different behavior.

The FAQ and tsconfig docs have been modified to reflect
rewriteTsconfig.

This resolves TypeStrong#703.
szunami pushed a commit to szunami/atom-typescript that referenced this issue Nov 12, 2015
The rewriteTsconfig flag enables users to prevent Atom-Typescript
from rewriting their tsconfig.json. The flag defaults to true,
so users who upgrade won't observe any different behavior.

The FAQ and tsconfig docs have been modified to reflect
rewriteTsconfig.

This resolves TypeStrong#703.
@basarat
Copy link
Member Author

basarat commented Nov 16, 2015

@tomitrescak
Copy link

@basarat The tsconfig now stopped automatically recognising new files with the following error in the console:

TypeError: Cannot read property 'rewriteTsconfig' of undefined
    at Object.getProjectSync (/Users/tomi/.atom/packages/atom-typescript/dist/main/tsconfig/tsconfig.js:218:81)
    at getOrCreateProjectFile (/Users/tomi/.atom/packages/atom-typescript/dist/main/lang/projectCache.js:73:36)
    at Object.getOrCreateProject (/Users/tomi/.atom/packages/atom-typescript/dist/main/lang/projectCache.js:140:27)
    at Object.getProjectFileDetails (/Users/tomi/.atom/packages/atom-typescript/dist/main/lang/projectService.js:331:34)
    at Child.RequesterResponder.processRequest (/Users/tomi/.atom/packages/atom-typescript/dist/worker/lib/workerLib.js:48:60)
    at process.<anonymous> (/Users/tomi/.atom/packages/atom-typescript/dist/worker/lib/workerLib.js:226:23)
    at emitTwo (events.js:87:13)
    at process.emit (events.js:172:7)
    at handleMessage (internal/child_process.js:685:10)
    at Pipe.channel.onread (internal/child_process.js:440:11)

@tomitrescak
Copy link

Is there any quick fix for this or shall I roll back to previous version? Thanks!

@thomastrapanese
Copy link

up, i have the same issue

@basarat
Copy link
Member Author

basarat commented Nov 16, 2015

@tomitrescak rollback for now please.

Pinging @sszuflita for investigation 🌹

@basarat basarat reopened this Nov 16, 2015
@basarat
Copy link
Member Author

basarat commented Nov 16, 2015

@tomitrescak nevermind. Hotfix released : https://github.com/TypeStrong/atom-typescript/releases/tag/v7.11.0 hopefully that fixes it 🌹

@thomastrapanese
Copy link

it work well for me, thanks

@TypeStrong TypeStrong locked and limited conversation to collaborators Jan 20, 2019
angelestelar5z added a commit to angelestelar5z/atom-typescript that referenced this issue Aug 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants