React typescript '=' expected. TS1005

Viewed 773

I am getting error with

'=' expected.  TS1005
  
   5 |  * LICENSE file in the root directory of this source tree.    
   6 |  */    
>  7 | import type { NewPlugin, Optionsz, OptionsReceived } from './types';
     |             ^
   8 | export type { Colors, Config, Options, OptionsReceived, OldPlugin, NewPlugin, Plugin, Plugins, Printer, Refs, Theme, } from './types';
   9 | export declare const DEFAULT_OPTIONS: Options;    
  10 | /**

Error

Updated code base from index.d.ts:

    import type { NewPlugin, Options, OptionsReceived } from './types';
    export type { Colors, Config, Options, OptionsReceived, OldPlugin, NewPlugin, Plugin, Plugins, Printer, Refs, Theme, } from './types';
    export declare const DEFAULT_OPTIONS: Options;
    /**
     * Returns a presentation string of your `val` object
     * @param val any potential JavaScript object
     * @param options Custom settings
     */
    export declare function format(val: unknown, options?: OptionsReceived): string;
    export declare const plugins: {
        AsymmetricMatcher: NewPlugin;
        ConvertAnsi: NewPlugin;
        DOMCollection: NewPlugin;
        DOMElement: NewPlugin;
        Immutable: NewPlugin;
        ReactElement: NewPlugin;
        ReactTestComponent: NewPlugin;
    };
    export default format;

Updated and add tsconfig.json:

    {
      "compilerOptions": {
        "target": "es5",
        "lib": [
          "dom",
          "dom.iterable",
          "esnext"
        ],
        "allowJs": true,
        "skipLibCheck": true,
        "esModuleInterop": true,
        "allowSyntheticDefaultImports": true,
        "strict": true,
        "forceConsistentCasingInFileNames": true,
        "module": "esnext",
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "isolatedModules": true,
        "noEmit": true,
        "jsx": "react"
      },
      "include": [
        "src"
      ]
    }

Anyone know how to fix this error? Thank you so much

2 Answers

remove type keyword :

import  { NewPlugin, Options, OptionsReceived } from './types';

export  { Colors, Config, Options, OptionsReceived, OldPlugin, NewPlugin, Plugin, Plugins, Printer, Refs, Theme, } from './types';

export declare const DEFAULT_OPTIONS: Options;
Related