-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
701 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
{ | ||
"cSpell.words": [ | ||
"antd", | ||
"bootcdn", | ||
"bootcss", | ||
"napi", | ||
"threadpool" | ||
] | ||
], | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[rust]": { | ||
"editor.defaultFormatter": "rust-lang.rust-analyzer" | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import test from "ava"; | ||
import { getUsageOfDangerStrings } from "../../index.js"; | ||
import { fileURLToPath } from "node:url"; | ||
import { dirname } from "node:path"; | ||
|
||
// 获取当前文件的路径 | ||
const __filename = fileURLToPath(import.meta.url); | ||
|
||
test("getUsageOfDangerStrings", (t) => { | ||
const response = getUsageOfDangerStrings(["bootcss.com", "bootcdn.com", "polyfill.com", "polyfill.io"], { | ||
cwd: dirname(__filename), | ||
}); | ||
t.snapshot(response.sort((x) => x.filePath)); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Snapshot report for `__test__/danger_string/index.spec.mjs` | ||
|
||
The actual snapshot is saved in `index.spec.mjs.snap`. | ||
|
||
Generated by [AVA](https://avajs.dev). | ||
|
||
## getUsageOfDangerStrings | ||
|
||
> Snapshot 1 | ||
[ | ||
{ | ||
end: 21, | ||
filePath: '/Users/10015448/GitRepository/source-code-diagnosis/__test__/danger_string/features/demo3.js', | ||
matchDangerString: 'bootcss.com', | ||
rawValue: 'bootcss.com', | ||
start: 8, | ||
}, | ||
{ | ||
end: 27, | ||
filePath: '/Users/10015448/GitRepository/source-code-diagnosis/__test__/danger_string/features/demo5.js', | ||
matchDangerString: 'bootcss.com', | ||
rawValue: 'bootcss.com/hello', | ||
start: 8, | ||
}, | ||
{ | ||
end: 25, | ||
filePath: '/Users/10015448/GitRepository/source-code-diagnosis/__test__/danger_string/features/demo1.js', | ||
matchDangerString: 'bootcss.com', | ||
rawValue: 'bootcss.com', | ||
start: 12, | ||
}, | ||
{ | ||
end: 21, | ||
filePath: '/Users/10015448/GitRepository/source-code-diagnosis/__test__/danger_string/features/demo4.js', | ||
matchDangerString: 'bootcss.com', | ||
rawValue: 'bootcss.com', | ||
start: 8, | ||
}, | ||
{ | ||
end: 19, | ||
filePath: '/Users/10015448/GitRepository/source-code-diagnosis/__test__/danger_string/features/demo6.js', | ||
matchDangerString: 'bootcss.com', | ||
rawValue: 'bootcss.com/hello', | ||
start: 0, | ||
}, | ||
{ | ||
end: 13, | ||
filePath: '/Users/10015448/GitRepository/source-code-diagnosis/__test__/danger_string/features/demo2.js', | ||
matchDangerString: 'bootcss.com', | ||
rawValue: 'bootcss.com', | ||
start: 0, | ||
}, | ||
{ | ||
end: 86, | ||
filePath: '/Users/10015448/GitRepository/source-code-diagnosis/__test__/danger_string/features/demo7.jsx', | ||
matchDangerString: 'bootcss.com', | ||
rawValue: 'http://bootcss.com/hello', | ||
start: 60, | ||
}, | ||
] |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import { Button } from "antd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as antd from "antd" | ||
import { deepClone } from "lodash" | ||
|
||
function App(props) { | ||
|
||
useEffect(() => { | ||
let x = deepClone(props.user) | ||
},[]) | ||
|
||
return ( | ||
<div> | ||
<antd.Button /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as antd from "antd" | ||
|
||
function App(props) { | ||
|
||
useEffect(() => { | ||
let x = deepClone(props.user) | ||
},[]) | ||
|
||
return ( | ||
<div> | ||
<antd.Button /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as antd from "antd" | ||
|
||
|
||
React.createElement(antd.Button, null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Grid as G } from 'antd'; | ||
|
||
|
||
function A() { | ||
return <G>xx</G> | ||
} | ||
|
||
function B() { | ||
return <G>xx</G> | ||
} | ||
|
||
G.a; |
10 changes: 10 additions & 0 deletions
10
__test__/module_member_usage/features/demo14/a.ts/index.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Grid as G } from 'antd'; | ||
|
||
|
||
function A() { | ||
return <G>xx</G> | ||
} | ||
|
||
function B() { | ||
return <G>xx</G> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Grid as G } from 'antd'; | ||
|
||
|
||
function A() { | ||
return <G>xx</G> | ||
} | ||
|
||
function B() { | ||
return <G>xx</G> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// ת�����ʻ���ӳ���ϵ�� | ||
export const i18nKeyMaps = { | ||
zhCN: 'zh_CN', | ||
enUS: 'en_US' | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Button } from "antd" | ||
|
||
Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Button } from "antd" | ||
|
||
function App() { | ||
return ( | ||
<div> | ||
<Button>hello</Button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Button } from "antd" | ||
|
||
function App() { | ||
return ( | ||
<div> | ||
<Button /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import antd from "antd" | ||
|
||
function App() { | ||
return ( | ||
<div> | ||
<antd.Button>btn</antd.Button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import antd from "antd" | ||
|
||
function App() { | ||
return ( | ||
<div> | ||
<antd.Button /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as antd from "antd" | ||
|
||
function App() { | ||
return ( | ||
<div> | ||
<antd.Button>btn</antd.Button> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as antd from "antd" | ||
|
||
function App() { | ||
return ( | ||
<div> | ||
<antd.Button /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import * as antd from "antd" | ||
import { deepClone } from "lodash" | ||
|
||
function App(props) { | ||
|
||
useEffect(() => { | ||
let x = deepClone(props.user) | ||
},[]) | ||
|
||
return ( | ||
<div> | ||
<antd.Button /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import test from "ava"; | ||
import { getModuleMemberUsage } from "../../index.js"; | ||
import { fileURLToPath } from "node:url"; | ||
import { dirname } from "node:path"; | ||
|
||
// 获取当前文件的路径 | ||
const __filename = fileURLToPath(import.meta.url); | ||
|
||
test("getUsageOfDangerStrings", (t) => { | ||
const response = getModuleMemberUsage(["antd"], { | ||
cwd: dirname(__filename), | ||
}); | ||
t.snapshot(response.sort((x) => x.filePath)); | ||
}); |
Oops, something went wrong.