Comments (9)
Well, you can't just use a module without type definitions in a TypeScript project, you get errors.
So we either
1- Add local definitions
2- Submit definitions to the module itself.
3- Submit definitions to this repository.
Adding them to the DefinitelyTyped repository is by far the best method for future sync between the module and it's definitions, but it involves adding tests as well. So until someone wants to do that, I can just share the definitions.
declare module 'circular-dependency-plugin' {
import { Compiler, Plugin } from 'webpack'
interface CircularDependencyPluginOptions {
exclude?: RegExp
failOnError?: boolean
}
class CircularDependencyPlugin implements Plugin {
constructor(options?: CircularDependencyPluginOptions)
apply(compiler: Compiler): void
}
namespace CircularDependencyPlugin { }
export = CircularDependencyPlugin
}
from circular-dependency-plugin.
I was just unclear about what tests could be created for a type definition file.
Please do go ahead and submit a PR to add the type definitions.
from circular-dependency-plugin.
Can you post it as part of a comment? I'm unclear on what benefit a TS/Flow user would get from it for this project.
from circular-dependency-plugin.
but it involves adding tests as well
Can you explain more about what you mean by this?
from circular-dependency-plugin.
Aside from that yes, I would accept a PR for adding the types. I assume in an index.d.ts
file?
from circular-dependency-plugin.
Sorry if I wasn't clear in my initial message.
Can you explain more about what you mean by this?
The testing part was for this option:
3- Submit definitions to this repository.
According to their contribution guidelines, a contributor has to submit the types along with some tests. If someone wrote those tests and adds the definition file that repository, then TS users are able to get these via:
npm install circular-dependency-plugin
npm install @types/circular-dependency-plugin
The benefit of adding the definitions there is that the types will have their own versioning so it'll be easy for community to update them as your API changes without knocking on your door.
2- Submit definitions to the module itself.
This option involves just adding the index.d.ts
file to your repo, no tests are not mandatory. The definitions will be pulled automatically and the TS compiler will be happy. The downside of this method is if your API changes, you should update the definition file yourself as the maintainer of the module.
I'm not saying you should do this or do the other, I'm just bringing the definitions in case anyone is interested in maintaining them or maybe submitting them to DefinitelyTyped. :)
from circular-dependency-plugin.
I'm going to close this as it's not something I'm willing to take on myself, but I would still accept a PR.
from circular-dependency-plugin.
Why close this? I'd just tag with help-wanted
instead.
from circular-dependency-plugin.
DefinitelyTyped/DefinitelyTyped#33952
from circular-dependency-plugin.
Related Issues (20)
- Typescript Type Dependencies Not Found HOT 2
- still has warnning when excluded HOT 1
- SASS files fail with error that file is circular dependency of itself HOT 3
- Named exports and imports circulars HOT 1
- webpack@5 support HOT 20
- Performance degradation webpack 5.3.2 + this plugin 5.2.2 on recompile HOT 3
- Improve readme.md
- [email protected] support with circular dependency HOT 3
- Circular dependency checker can be slow HOT 1
- Support for ignoring lazy (not weak) async imports HOT 2
- Webpack 5 HOT 4
- Support for ignore React.lazy async imports
- Log to file? HOT 2
- @types/circular-dependency-plugin is not compatible with Webpack 5 HOT 3
- Cannot read property 'tap' of undefined HOT 1
- TypeError: plugin.options.include.test is not a function HOT 2
- This plugin does not appear to work in webpack=> 4.64.4 typeScript => 4.5.5 react=> 17.0.2 environments HOT 2
- Escaped forward slashes in paths do not work on Windows
- Fast builds during development HOT 2
- [FR] Vite Support HOT 1
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 circular-dependency-plugin.