Comments (5)
This sounds more like an issue with JSON Schema and/or VS Code. Do you have suggestions on how to improve the schema?
FYI, you can also use a knip.ts
and use types like so:
import type { KnipConfig } from 'knip';
const config: KnipConfig = {};
export default config;
from knip.
I don't think so. This is the first the first time for me that a schema is broken in vscode.
For my API I used the standard schema from http://json-schema.org/ and VSCode has no problems with it.
Here is a short summary of my schema:
{
"$schema": "http://json-schema.org/schema",
"properties": {
"objProp": {
"type": "object",
"description": "An object of the schema",
"additionalProperties": false, // can the user define extra properties?
"required": ["prop1", "prop2", "prop3"], // these props are required for this object property
"properties": {
"prop1": {
"type": "string",
"description": "description of prop1"
},
....
"prop4": {
"type": "string",
"description": "I am defined but not required"
},
}
},
"prop1": true, // Is part of an object an is required. But it can be used as for other objects too.
"prop2": true,
"prop3": true,
"prop5": {
"type": "boolean",
"default": false, // suggested default value
"description": "I am a flag"
},
"required": ["objProp", "prop5"] // what properties of this schema are required for it to work?
}
I'm new to json schema, but this helped me a lot https://github.com/CyberT33N/JSON-Schema-cheat-sheet
from knip.
Another possibility would be that you deploy it from the web, while APIs usually export their schemas. But if I only knew how, I would be happy to help.
from knip.
Is this still an issue? I seem to have no issues in my VS Code.
from knip.
No, the problems are gone. The auto completion is way better. Well done!
My only nitpick would be that the plugins should not default to false
but to {}
, since false
is already the implicit value.
But for now I close this issue because the original problem is fixed.
from knip.
Related Issues (20)
- To read TypeScript configuration files Jest requires "ts-node" HOT 2
- Re-exported type reported as unused with `ignoreExportsUsedInFile` HOT 3
- Imports with foreign file extensions fail with "Unable to find" file error HOT 13
- --cache-location is an unknown option HOT 2
- Programatically Run HOT 1
- Re-exports with usage of barrel files isn't indexed correctly HOT 5
- Support for external plugins HOT 1
- Commitlint plugin: specifier.startsWith is not a function HOT 1
- commitlint plugin update breaks when `parserPreset` isn't a `string`
- SvelteKit Demo App $app/* unresolved HOT 2
- 5.14.0 breaks knip in git submodules
- Documentation Site Version Selector leads to 404 HOT 1
- Support local custom plugin HOT 1
- Pino v7+ transports HOT 2
- Unused functions are not being detected HOT 5
- Default import name being used to determine if export is used HOT 4
- Re-exported enum members incorrectly reported as unused HOT 5
- False positive when using a dynamic default importing HOT 2
- Module '"knip"' has no exported member 'KnipConfig'. Did you mean to use 'import KnipConfig from "knip"' instead? HOT 2
- "ignore" file working even though it shouldn't based on the docs HOT 4
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 knip.