Giter Site home page Giter Site logo

Comments (10)

jhanschoo avatar jhanschoo commented on May 27, 2024 1

from configuration.

daffl avatar daffl commented on May 27, 2024

I don't think I understand the error. Does that mean Typescript errors on every npm module that doesn't have definitions?

from configuration.

corydeppen avatar corydeppen commented on May 27, 2024

@daffl The prior error I mentioned seems to occur when TS detects a declaration file but doesn't have any content (I had commented out the module definition). If the TS declaration file isn't present for a module that's being imported, you'd see this:

Could not find a declaration file for module 'feathers-configuration'. '/path-to/node_modules/feathers-configuration/lib/index.js' implicitly has an 'any' type.
  Try `npm install @types/feathers-configuration` if it exists or add a new declaration (.d.ts) file containing `declare module 'feathers-configuration';`

from configuration.

daffl avatar daffl commented on May 27, 2024

But there is no declaration at all in this repository. Not that we wouldn't accept one but it should be complete (and not having one at all shouldn't cause any errors).

from configuration.

corydeppen avatar corydeppen commented on May 27, 2024

But there is no declaration at all in this repository

That's the issue. If TS is configured to use "strict": true or "noImplicitAny": true the error I mentioned (TS7016) will be thrown and prevent the project from compiling. Folks opting to relax the strictness options won't see the error, but that seems to defeat the purpose of a type checker like TypeScript.

from configuration.

jhanschoo avatar jhanschoo commented on May 27, 2024

The PR I just created should fix the issue for the current version.

from configuration.

ScreamZ avatar ScreamZ commented on May 27, 2024

Hey, still having

src/app.ts(9,32): error TS2497: Module '"C:/Users/andre/js-dev/reactnative/api/node_modules/feathers-configuration/index"' resolves to a non-modul
e entity and cannot be imported using this construct.

using this import syntax

import * as configuration from "feathers-configuration";

Are you sure of type definition or am I doing it wrong ?

Please also consider adding @types/config to dependencies. This avoid developers to include this in their own project for this warning node_modules/feathers-configuration/index.d.ts(4,23): error TS2688: Cannot find type definition file for 'config'.

Best regards

from configuration.

jhanschoo avatar jhanschoo commented on May 27, 2024

If you're using the latest versions (>1.0.0-pre.*) it seems like the file was removed in this commit 4cdff7a .

Sorry, but I won't be able to maintain the definitions file since I'm not using FeathersJS in my stack at the moment.

from configuration.

daffl avatar daffl commented on May 27, 2024

That is why it is a prerelease 😉 Definitions will be maintained in https://github.com/feathersjs-ecosystem/feathers-typescript and published separately going forward.

from configuration.

ScreamZ avatar ScreamZ commented on May 27, 2024

@daffl I can only suggest you to publish them using the standardized way. See that link.

Feathers is an awesome tool, built with perfect nice pattern that make the code clear. It deserve an awesome definition file for its packages.
Keep it that way :)

@types/feathers
@types/feathers-rest

etc...

Or directly in the lib using the types key of package.json.

Best regards

from configuration.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.