TriplyDB / Yasgui

Yet Another Sparql GUI
https://yasgui.triply.cc
MIT License
190 stars 55 forks source link

Fix: devDependency update for Yasqe and Yasr (@types/codemirror 0.0.8… #165

Closed Ningensei848 closed 4 years ago

Ningensei848 commented 4 years ago

ERROR in /path/to/node_modules/@triply/yasqe/build/ts/src/index.d.ts(156,47):

    154 |         maxHighlightLength?: number;
    155 |         viewportMargin?: number;
  > 156 |         lint?: boolean | import("codemirror").LintOptions;
        |                                               ^
    157 |         placeholder?: string;
    158 |         collapsePrefixesOnLoad: boolean;
    159 |         syntaxErrorCheck: boolean;

  1. I use Yarn and ran the command yarn add @triply/yasgui according to the documentation you provided.

  2. I'm developing in nuxt + typescript, so I got an error that says to install a type definition file (details are as follows).

    Could not find a declaration file for module 'codemirror'. 
    '/path/to/node_modules/codemirror/lib/codemirror.js' implicitly has an 'any' type.
    Try `npm install @types/codemirror` if it exists or add a new declaration (.d.ts) file containing `declare module 'codemirror';`
      > 1 | import { Editor as CmEditor, Doc as CmDoc, Token as CmToken, Position as CmPosition, EditorConfiguration as CmEditorConfiguration } from "codemirror";
  3. Following the error message, yarn add @types/codemirror was executed, replacing the npm command with yarn.

  4. Some errors have disappeared, but there is one error that I can't seem to fix. That error is shown in the opening paragraph of this issue.


my proposal:

On the repository of @types/codemirror, there was an MERGE update about a month ago that changed LintOption to LintStateOptions | Linter | AsyncLinter. Therefore, I think Yasqe (and Yasr) should follow this change.

cf. 🤖 Merge PR #45097 [codemirror] Add additional lint options by @youngbob · DefinitelyTyped/DefinitelyTyped@e6ef022

After build, the relevant part of index.d.ts will be changed as follows.

-   lint?: boolean | import("codemirror").LintOptions;
-                                        ^
+   lint?: boolean | import("codemirror").LintStateOptions | import("codemirror").Linter | import("codemirror").AsyncLinter;
LaurensRietveld commented 4 years ago

Thanks, I've upgraded the codemirror typings to the latest version