@cornerstonejs/codemods 6.0.0-beta.1 → 6.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.oxlintrc.json +4 -0
- package/package.json +1 -1
- package/registry/cornerstone3d/6/README.md +46 -0
- package/registry/cornerstone3d/6/classes-and-types/README.md +16 -0
- package/registry/cornerstone3d/6/classes-and-types/scripts/classes-and-types.ts +32 -90
- package/registry/cornerstone3d/6/classes-and-types/scripts/lib.ts +864 -16
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/jsx-in-a-js-file/expected.js +31 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/jsx-in-a-js-file/input.js +31 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/jsx-in-a-js-file/metrics.json +46 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx +34 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/not-analysed-a-name-declared-twice/input.tsx +34 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/tsx/not-analysed-a-name-declared-twice/metrics.json +12 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-classes/metrics.json +10 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/renamed-classes-make-two-operands-one/expected.ts +61 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/renamed-classes-make-two-operands-one/input.ts +65 -0
- package/registry/cornerstone3d/6/classes-and-types/tests/typescript/renamed-classes-make-two-operands-one/metrics.json +36 -0
- package/registry/cornerstone3d/6/display-sets/README.md +4 -0
- package/registry/cornerstone3d/6/display-sets/scripts/display-sets.ts +4 -2
- package/registry/cornerstone3d/6/display-sets/scripts/lib.ts +864 -16
- package/registry/cornerstone3d/6/display-sets/tests/tsx/jsx-in-a-js-file/expected.js +45 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/jsx-in-a-js-file/input.js +39 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/jsx-in-a-js-file/metrics.json +84 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx +42 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/not-analysed-a-name-declared-twice/input.tsx +42 -0
- package/registry/cornerstone3d/6/display-sets/tests/tsx/not-analysed-a-name-declared-twice/metrics.json +12 -0
- package/registry/cornerstone3d/6/events/README.md +4 -0
- package/registry/cornerstone3d/6/events/scripts/events.ts +5 -3
- package/registry/cornerstone3d/6/events/scripts/lib.ts +864 -16
- package/registry/cornerstone3d/6/events/tests/tsx/jsx-in-a-js-file/expected.js +18 -0
- package/registry/cornerstone3d/6/events/tests/tsx/jsx-in-a-js-file/input.js +18 -0
- package/registry/cornerstone3d/6/events/tests/tsx/jsx-in-a-js-file/metrics.json +38 -0
- package/registry/cornerstone3d/6/events/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx +21 -0
- package/registry/cornerstone3d/6/events/tests/tsx/not-analysed-a-name-declared-twice/input.tsx +21 -0
- package/registry/cornerstone3d/6/events/tests/tsx/not-analysed-a-name-declared-twice/metrics.json +12 -0
- package/registry/cornerstone3d/6/settings/README.md +4 -0
- package/registry/cornerstone3d/6/settings/scripts/lib.ts +864 -16
- package/registry/cornerstone3d/6/settings/scripts/settings.ts +5 -3
- package/registry/cornerstone3d/6/settings/tests/tsx/jsx-in-a-js-file/expected.js +18 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/jsx-in-a-js-file/input.js +18 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/jsx-in-a-js-file/metrics.json +46 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx +21 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/not-analysed-a-name-declared-twice/input.tsx +21 -0
- package/registry/cornerstone3d/6/settings/tests/tsx/not-analysed-a-name-declared-twice/metrics.json +12 -0
- package/registry/cornerstone3d/6/tools/README.md +5 -0
- package/registry/cornerstone3d/6/tools/scripts/lib.ts +864 -16
- package/registry/cornerstone3d/6/tools/scripts/tools.ts +6 -3
- package/registry/cornerstone3d/6/tools/tests/tsx/jsx-in-a-js-file/expected.js +35 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/jsx-in-a-js-file/input.js +35 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/jsx-in-a-js-file/metrics.json +52 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx +38 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/not-analysed-a-name-declared-twice/input.tsx +38 -0
- package/registry/cornerstone3d/6/tools/tests/tsx/not-analysed-a-name-declared-twice/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-members/README.md +5 -0
- package/registry/cornerstone3d/6/viewport-members/scripts/lib.ts +864 -16
- package/registry/cornerstone3d/6/viewport-members/scripts/viewport-members.ts +5 -3
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/jsx-in-a-js-file/expected.js +41 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/jsx-in-a-js-file/input.js +41 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/jsx-in-a-js-file/metrics.json +108 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx +44 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/not-analysed-a-name-declared-twice/input.tsx +44 -0
- package/registry/cornerstone3d/6/viewport-members/tests/tsx/not-analysed-a-name-declared-twice/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-types/README.md +35 -0
- package/registry/cornerstone3d/6/viewport-types/scripts/lib.ts +864 -16
- package/registry/cornerstone3d/6/viewport-types/scripts/viewport-types.ts +192 -4
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/jsx-in-a-js-file/expected.js +76 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/jsx-in-a-js-file/input.js +76 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/jsx-in-a-js-file/metrics.json +102 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx +79 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/not-analysed-a-name-declared-twice/input.tsx +79 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/not-analysed-a-name-declared-twice/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/not-analysed-a-name-declared-twice-in-a-js-file/expected.js +78 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/not-analysed-a-name-declared-twice-in-a-js-file/input.js +78 -0
- package/registry/cornerstone3d/6/viewport-types/tests/tsx/not-analysed-a-name-declared-twice-in-a-js-file/metrics.json +12 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/ohif-returns-of-two-types-become-one/expected.ts +173 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/ohif-returns-of-two-types-become-one/input.ts +173 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/ohif-returns-of-two-types-become-one/metrics.json +166 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/ohif-two-operands-become-one/expected.ts +103 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/ohif-two-operands-become-one/input.ts +103 -0
- package/registry/cornerstone3d/6/viewport-types/tests/typescript/ohif-two-operands-become-one/metrics.json +78 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Enums } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ACTORS_CHANGED, NEW_IMAGE: STACK_NEW_IMAGE } = Enums.Events;
|
|
5
|
+
const NEW_IMAGE = 'local';
|
|
6
|
+
|
|
7
|
+
export function Listener({ element }) {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const onActors = (evt) => evt.detail;
|
|
10
|
+
|
|
11
|
+
element.addEventListener(Enums.Events.PRE_STACK_NEW_IMAGE, onPre);
|
|
12
|
+
element.addEventListener(ACTORS_CHANGED, onActors);
|
|
13
|
+
element.addEventListener('CORNERSTONE_STACK_NEW_IMAGE', onPre);
|
|
14
|
+
element.addEventListener(STACK_NEW_IMAGE, onPre);
|
|
15
|
+
}, [element]);
|
|
16
|
+
|
|
17
|
+
return <span>{NEW_IMAGE}</span>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Enums } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ACTORS_CHANGED, STACK_NEW_IMAGE } = Enums.Events;
|
|
5
|
+
const NEW_IMAGE = 'local';
|
|
6
|
+
|
|
7
|
+
export function Listener({ element }) {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const onActors = (evt) => evt.detail;
|
|
10
|
+
|
|
11
|
+
element.addEventListener(Enums.Events.PRE_STACK_NEW_IMAGE, onPre);
|
|
12
|
+
element.addEventListener(ACTORS_CHANGED, onActors);
|
|
13
|
+
element.addEventListener('CORNERSTONE_STACK_NEW_IMAGE', onPre);
|
|
14
|
+
element.addEventListener(STACK_NEW_IMAGE, onPre);
|
|
15
|
+
}, [element]);
|
|
16
|
+
|
|
17
|
+
return <span>{NEW_IMAGE}</span>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.js",
|
|
6
|
+
"line": "11",
|
|
7
|
+
"rule": "Events.PRE_STACK_NEW_IMAGE"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.js",
|
|
14
|
+
"line": "13",
|
|
15
|
+
"rule": "'CORNERSTONE_STACK_NEW_IMAGE'"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cardinality": {
|
|
21
|
+
"file": "input.js",
|
|
22
|
+
"line": "4",
|
|
23
|
+
"rule": "Events.ACTORS_CHANGED"
|
|
24
|
+
},
|
|
25
|
+
"count": 1
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"cornerstone3d-6-review": [
|
|
29
|
+
{
|
|
30
|
+
"cardinality": {
|
|
31
|
+
"file": "input.js",
|
|
32
|
+
"line": "4",
|
|
33
|
+
"rule": "Events.STACK_NEW_IMAGE: NEW_IMAGE also fires for each slice of a volume"
|
|
34
|
+
},
|
|
35
|
+
"count": 1
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
package/registry/cornerstone3d/6/events/tests/tsx/not-analysed-a-name-declared-twice/expected.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Enums } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ACTORS_CHANGED, STACK_NEW_IMAGE } = Enums.Events;
|
|
5
|
+
const NEW_IMAGE = 'local';
|
|
6
|
+
|
|
7
|
+
export function Listener({ element }) {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const onActors = (evt) => evt.detail;
|
|
10
|
+
|
|
11
|
+
element.addEventListener(Enums.Events.PRE_STACK_NEW_IMAGE, onPre);
|
|
12
|
+
element.addEventListener(ACTORS_CHANGED, onActors);
|
|
13
|
+
element.addEventListener('CORNERSTONE_STACK_NEW_IMAGE', onPre);
|
|
14
|
+
element.addEventListener(STACK_NEW_IMAGE, onPre);
|
|
15
|
+
}, [element]);
|
|
16
|
+
|
|
17
|
+
return <span>{NEW_IMAGE}</span>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const twice = 1;
|
|
21
|
+
const twice = 2;
|
package/registry/cornerstone3d/6/events/tests/tsx/not-analysed-a-name-declared-twice/input.tsx
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { Enums } from '@cornerstonejs/core';
|
|
3
|
+
|
|
4
|
+
const { ACTORS_CHANGED, STACK_NEW_IMAGE } = Enums.Events;
|
|
5
|
+
const NEW_IMAGE = 'local';
|
|
6
|
+
|
|
7
|
+
export function Listener({ element }) {
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const onActors = (evt) => evt.detail;
|
|
10
|
+
|
|
11
|
+
element.addEventListener(Enums.Events.PRE_STACK_NEW_IMAGE, onPre);
|
|
12
|
+
element.addEventListener(ACTORS_CHANGED, onActors);
|
|
13
|
+
element.addEventListener('CORNERSTONE_STACK_NEW_IMAGE', onPre);
|
|
14
|
+
element.addEventListener(STACK_NEW_IMAGE, onPre);
|
|
15
|
+
}, [element]);
|
|
16
|
+
|
|
17
|
+
return <span>{NEW_IMAGE}</span>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const twice = 1;
|
|
21
|
+
const twice = 2;
|
|
@@ -54,6 +54,10 @@ reference to it changed, the new ones come in, under a fresh alias such as
|
|
|
54
54
|
key stays for the reader).
|
|
55
55
|
- `viewport.setUseCPURendering()`, the member of a stack viewport, is
|
|
56
56
|
reported by `@cornerstonejs/cornerstone3d-6-viewport-members`.
|
|
57
|
+
- Manual, at line 1: `the file was not analysed:` with the reason, for a
|
|
58
|
+
file whose names cannot be looked up (the tool cannot read it, or a name
|
|
59
|
+
is declared twice in one scope). The file stays as it is. See the README
|
|
60
|
+
of `@cornerstonejs/cornerstone3d-6`.
|
|
57
61
|
|
|
58
62
|
## Development
|
|
59
63
|
|