Comments (5)
Confirm: current implementation only picks up ts
as the extension.
from ember-cli-typescript.
The problem was actually in the includeExtensions
argument to the TsPreprocessor
constructor.
from ember-cli-typescript.
An alternative approach to consider: stop setting weird values in the tsconfig and see what happens.
from ember-cli-typescript.
Here's my tsconfig.json
-- it seems to be working with new types defined correctly with the app/config
folder (eg: app/config/<module_name>.d.ts
)
// tsconfig.json
{
"compilerOptions": {
"target": "ES6",
"allowJs": true,
"moduleResolution": "node",
"noEmitOnError": false,
"noEmit": true,
"baseUrl": ".",
"paths": {
"mycoolappname/*": ["app/*"],
"mycoolappname/tests/*": ["tests/*"],
"mycoolappname/mirage/*": ["mirage/*"]
}
},
"include": [
"app/**/*",
"tests/**/*",
"mirage/**/*"
]
}
an example of defining support for a module that defines globals:
// app/config/ember-testing.d.ts
declare var visit: (path: string) => PromiseConstructor;
declare var triggerEvent: (selector: string | JQuery, event: string) => PromiseConstructor;
declare var click: (selector: string | JQuery) => PromiseConstructor;
declare var find: (selector: string | JQuery) => JQuery;
an example of defining support for a module that you import from:
app/config/qunit.d.ts
see: https://gist.github.com/leepfrog/0c08bd20ab54a0ba957a4504e87703cf
an example of defining support for something you're going to only use in TS (eg: I converted all of my /mirage folder to TS):
// app/config/ember-cli-mirage.d.ts
declare namespace Mirage {
export namespace Model {
export interface Base {
id: string;
}
// I'll move this into app/models/my-cool-model.ts when it's no longer .js (it would be nice to have ember-cli-typescript auto-define these modules in appropriate namespaces if that makes sense?)
export interface MyCoolModel extends Base {
}
// ....
}
}
declare var server: any;
BTW -- not sure if I'm doing it right (hey - we all get to be new!) -- but it seems to work.
from ember-cli-typescript.
Thanks, @leepfrog! That's a super helpful bit of data. It confirms that the problem was indeed resolved with #22 (as I thought it would be).
from ember-cli-typescript.
Related Issues (20)
- ember install ember-cli-typescript does not set eslint parser to @typescript-eslint/parser HOT 2
- Provide CLI option for `tsconfig.json` path to allow different config per env HOT 1
- Type for location missing in Routing types HOT 2
- Type-checking failure in node_modules on a fresh Ember app HOT 6
- No declaration files output during precompile HOT 3
- Can subclass declarations include the inherited aspects of the base class? HOT 3
- Typechecker eats 70% of CPU when idle HOT 2
- `AsyncHasMany` resolves to `ArrayProxy`, can't access `reload`/`createRecord` methods on resolved promise HOT 2
- Make sure docs are up to date for Signature usage HOT 1
- Cant find `meta` on `PromiseManyArray` HOT 4
- Broken with Embroider 1.9.0 HOT 1
- "@ember/test-helpers/setup-rendering-context"' has no exported member named 'rerender'. Did you mean 'render'? HOT 1
- memory leak of ts errors HOT 1
- bug: when `moduleName` and `package.name` differ, types will not be generated by default HOT 1
- Incompatible ECMAScript version being used during the build HOT 1
- Newly generated component is not buildable: Property 'element' does not exist on type 'TestContext' HOT 2
- Issue when building ember app with exports from GTS file into TS file HOT 2
- Warnings when using ember-cli-babel 8.x HOT 1
- Switch to maintenance mode HOT 18
- v6 release: the last major? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-typescript.