|
1 | 1 | /// <reference path="./fourslash.ts" />
|
2 | 2 |
|
3 | 3 | // @filename: /package.json
|
4 |
| -//// { "dependencies": { "@types/classnames": "*" } } |
| 4 | +//// { "dependencies": { "@types/classnames": "*" } |
5 | 5 |
|
6 | 6 | // @filename: /tsconfig.json
|
7 |
| -//// { |
8 |
| -//// "compilerOptions": { |
9 |
| -//// "module": "esnext", |
10 |
| -//// "target": "es2015", |
11 |
| -//// "esModuleInterop": true, |
12 |
| -//// "allowSyntheticDefaultImports": true |
13 |
| -//// } |
14 |
| -//// } |
| 7 | +//// {} |
15 | 8 |
|
16 | 9 | // @filename: /node_modules/@types/classnames/package.json
|
17 | 10 | //// { "name": "@types/classnames", "types": "index.d.ts" }
|
18 | 11 |
|
19 | 12 | // @filename: /node_modules/@types/classnames/index.d.ts
|
20 |
| -//// declare const classNames = () => string; |
| 13 | +//// declare const classNames: () => string; |
21 | 14 | //// export = classNames;
|
| 15 | +//// export as namespace classNames; |
22 | 16 |
|
23 | 17 | // @filename: /SomeReactComponent.tsx
|
24 | 18 | //// import * as React from 'react';
|
25 | 19 | ////
|
26 |
| -//// const el = <div className={class/*0*/}>foo</div>; |
27 |
| -//// const el = <div className={classNames/*1*/}>foo</div>; |
28 |
| - |
29 |
| -goTo.marker("0"); |
30 |
| - |
31 |
| -verify.completions({ |
32 |
| - includes: [{ |
33 |
| - name: "classNames", |
34 |
| - hasAction: true, |
35 |
| - source: "/node_modules/@types/classnames/index", |
36 |
| - sortText: completion.SortText.AutoImportSuggestions, |
37 |
| - }], |
38 |
| - preferences: { |
39 |
| - includeCompletionsForModuleExports: true, |
40 |
| - } |
41 |
| -}); |
| 20 | +//// const el1 = <div className={classNames/*1*/}>foo</div>; |
42 | 21 |
|
43 | 22 | goTo.marker("1");
|
44 | 23 |
|
45 | 24 | format.setOption("newLineCharacter", "\n");
|
46 | 25 | verify.importFixAtPosition([
|
47 |
| -`import classNames from 'classnames'; |
| 26 | +`import classNames = require('classnames'); |
48 | 27 | import * as React from 'react';
|
49 | 28 |
|
50 |
| -const el = <div className={class}>foo</div>; |
51 |
| -const el = <div className={classNames}>foo</div>;` |
| 29 | +const el1 = <div className={classNames}>foo</div>;` |
52 | 30 | ]);
|
0 commit comments