@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,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as cornerstone from '@cornerstonejs/core';
|
|
3
|
+
import { StackViewport, utilities } from '@cornerstonejs/core';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export function Panel({ viewport, threeD, properties }) {
|
|
7
|
+
const fresh = new StackViewport({
|
|
8
|
+
id: 'x',
|
|
9
|
+
element: document.createElement('div'),
|
|
10
|
+
});
|
|
11
|
+
const isVolume = viewport instanceof cornerstone.VolumeViewport;
|
|
12
|
+
const generic = utilities.isGenericViewport(viewport);
|
|
13
|
+
const typed = viewport;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div>
|
|
17
|
+
{String(fresh)} {String(isVolume)} {String(generic)} {String(threeD)}{' '}
|
|
18
|
+
{String(typed)}
|
|
19
|
+
{JSON.stringify(properties)}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function is3DClass(viewport) {
|
|
25
|
+
return (
|
|
26
|
+
viewport instanceof cornerstone.VolumeViewport3D ||
|
|
27
|
+
viewport instanceof cornerstone.VolumeViewport3D
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class Mine extends StackViewport {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as cornerstone from '@cornerstonejs/core';
|
|
3
|
+
import { StackViewport, utilities } from '@cornerstonejs/core';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export function Panel({ viewport, threeD, properties }) {
|
|
7
|
+
const fresh = new StackViewport({
|
|
8
|
+
id: 'x',
|
|
9
|
+
element: document.createElement('div'),
|
|
10
|
+
});
|
|
11
|
+
const isVolume = viewport instanceof cornerstone.VolumeViewport;
|
|
12
|
+
const generic = utilities.isGenericViewport(viewport);
|
|
13
|
+
const typed = viewport;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div>
|
|
17
|
+
{String(fresh)} {String(isVolume)} {String(generic)} {String(threeD)}{' '}
|
|
18
|
+
{String(typed)}
|
|
19
|
+
{JSON.stringify(properties)}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function is3DClass(viewport) {
|
|
25
|
+
return (
|
|
26
|
+
viewport instanceof cornerstone.VolumeViewport3D ||
|
|
27
|
+
viewport instanceof cornerstone.GenericVolumeViewport3D
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class Mine extends StackViewport {}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-manual": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.js",
|
|
6
|
+
"line": "11",
|
|
7
|
+
"rule": "instanceof VolumeViewport: the viewport may not show its data yet"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.js",
|
|
14
|
+
"line": "12",
|
|
15
|
+
"rule": "isGenericViewport"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cardinality": {
|
|
21
|
+
"file": "input.js",
|
|
22
|
+
"line": "31",
|
|
23
|
+
"rule": "StackViewport"
|
|
24
|
+
},
|
|
25
|
+
"count": 1
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"cardinality": {
|
|
29
|
+
"file": "input.js",
|
|
30
|
+
"line": "7",
|
|
31
|
+
"rule": "StackViewport"
|
|
32
|
+
},
|
|
33
|
+
"count": 1
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"cornerstone3d-6-review": [
|
|
37
|
+
{
|
|
38
|
+
"cardinality": {
|
|
39
|
+
"file": "input.js",
|
|
40
|
+
"line": "27",
|
|
41
|
+
"rule": "VolumeViewport3D: two operands of one || are the same now, read what each tested in 5.x"
|
|
42
|
+
},
|
|
43
|
+
"count": 1
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as cornerstone from '@cornerstonejs/core';
|
|
3
|
+
import { StackViewport, utilities } from '@cornerstonejs/core';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export function Panel({ viewport, threeD, properties }) {
|
|
7
|
+
const fresh = new StackViewport({
|
|
8
|
+
id: 'x',
|
|
9
|
+
element: document.createElement('div'),
|
|
10
|
+
});
|
|
11
|
+
const isVolume = viewport instanceof cornerstone.VolumeViewport;
|
|
12
|
+
const generic = utilities.isGenericViewport(viewport);
|
|
13
|
+
const typed = viewport;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div>
|
|
17
|
+
{String(fresh)} {String(isVolume)} {String(generic)} {String(threeD)}{' '}
|
|
18
|
+
{String(typed)}
|
|
19
|
+
{JSON.stringify(properties)}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function is3DClass(viewport) {
|
|
25
|
+
return (
|
|
26
|
+
viewport instanceof cornerstone.VolumeViewport3D ||
|
|
27
|
+
viewport instanceof cornerstone.GenericVolumeViewport3D
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class Mine extends StackViewport {}
|
|
32
|
+
|
|
33
|
+
const twice = 1;
|
|
34
|
+
const twice = 2;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import * as cornerstone from '@cornerstonejs/core';
|
|
3
|
+
import { StackViewport, utilities } from '@cornerstonejs/core';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export function Panel({ viewport, threeD, properties }) {
|
|
7
|
+
const fresh = new StackViewport({
|
|
8
|
+
id: 'x',
|
|
9
|
+
element: document.createElement('div'),
|
|
10
|
+
});
|
|
11
|
+
const isVolume = viewport instanceof cornerstone.VolumeViewport;
|
|
12
|
+
const generic = utilities.isGenericViewport(viewport);
|
|
13
|
+
const typed = viewport;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div>
|
|
17
|
+
{String(fresh)} {String(isVolume)} {String(generic)} {String(threeD)}{' '}
|
|
18
|
+
{String(typed)}
|
|
19
|
+
{JSON.stringify(properties)}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function is3DClass(viewport) {
|
|
25
|
+
return (
|
|
26
|
+
viewport instanceof cornerstone.VolumeViewport3D ||
|
|
27
|
+
viewport instanceof cornerstone.GenericVolumeViewport3D
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class Mine extends StackViewport {}
|
|
32
|
+
|
|
33
|
+
const twice = 1;
|
|
34
|
+
const twice = 2;
|
package/registry/cornerstone3d/6/classes-and-types/tests/typescript/positive-classes/metrics.json
CHANGED
|
@@ -24,5 +24,15 @@
|
|
|
24
24
|
},
|
|
25
25
|
"count": 1
|
|
26
26
|
}
|
|
27
|
+
],
|
|
28
|
+
"cornerstone3d-6-review": [
|
|
29
|
+
{
|
|
30
|
+
"cardinality": {
|
|
31
|
+
"file": "input.ts",
|
|
32
|
+
"line": "33",
|
|
33
|
+
"rule": "ECGViewport: two operands of one || are the same now, read what each tested in 5.x"
|
|
34
|
+
},
|
|
35
|
+
"count": 1
|
|
36
|
+
}
|
|
27
37
|
]
|
|
28
38
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/* eslint-disable no-duplicate-case */
|
|
2
|
+
import {
|
|
3
|
+
VolumeViewport3D,
|
|
4
|
+
VideoViewport,
|
|
5
|
+
ECGViewport,
|
|
6
|
+
WSIViewport,
|
|
7
|
+
} from '@cornerstonejs/core';
|
|
8
|
+
import type { Types, PlanarViewport } from '@cornerstonejs/core';
|
|
9
|
+
|
|
10
|
+
export function is3D(viewport: Types.IViewport) {
|
|
11
|
+
return (
|
|
12
|
+
viewport instanceof VolumeViewport3D ||
|
|
13
|
+
viewport instanceof VolumeViewport3D
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function isNotVideo(viewport: Types.IViewport) {
|
|
18
|
+
return (
|
|
19
|
+
!(viewport instanceof VideoViewport) &&
|
|
20
|
+
!(viewport instanceof VideoViewport)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const SIGNAL_CLASSES = [ECGViewport, ECGViewport];
|
|
25
|
+
|
|
26
|
+
export function isSignal(viewport: Types.IViewport) {
|
|
27
|
+
return SIGNAL_CLASSES.includes(viewport.constructor);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function laneOf(viewport: Types.IViewport) {
|
|
31
|
+
switch (viewport.constructor) {
|
|
32
|
+
case VideoViewport:
|
|
33
|
+
return 'legacy';
|
|
34
|
+
case VideoViewport:
|
|
35
|
+
return 'next';
|
|
36
|
+
default:
|
|
37
|
+
return 'other';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const classesToRegister = [VideoViewport, VideoViewport];
|
|
42
|
+
|
|
43
|
+
export function isVideoOrSlide(viewport: Types.IViewport) {
|
|
44
|
+
return (
|
|
45
|
+
viewport instanceof VideoViewport || viewport instanceof WSIViewport
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function twoCastsOfOneValue(viewport: Types.IViewport) {
|
|
50
|
+
return (
|
|
51
|
+
(viewport as PlanarViewport).id ||
|
|
52
|
+
(viewport as PlanarViewport).id
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function isLegacy3D(viewport: Types.IViewport) {
|
|
57
|
+
return (
|
|
58
|
+
viewport instanceof VolumeViewport3D &&
|
|
59
|
+
!(viewport instanceof VolumeViewport3D)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* eslint-disable no-duplicate-case */
|
|
2
|
+
import {
|
|
3
|
+
GenericVolumeViewport3D,
|
|
4
|
+
VolumeViewport3D,
|
|
5
|
+
LegacyVolumeViewport3D,
|
|
6
|
+
VideoViewport,
|
|
7
|
+
VideoGenericViewport,
|
|
8
|
+
ECGViewport,
|
|
9
|
+
ECGGenericViewport,
|
|
10
|
+
WSIViewport,
|
|
11
|
+
} from '@cornerstonejs/core';
|
|
12
|
+
import type { Types } from '@cornerstonejs/core';
|
|
13
|
+
|
|
14
|
+
export function is3D(viewport: Types.IViewport) {
|
|
15
|
+
return (
|
|
16
|
+
viewport instanceof VolumeViewport3D ||
|
|
17
|
+
viewport instanceof GenericVolumeViewport3D
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function isNotVideo(viewport: Types.IViewport) {
|
|
22
|
+
return (
|
|
23
|
+
!(viewport instanceof VideoGenericViewport) &&
|
|
24
|
+
!(viewport instanceof VideoViewport)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const SIGNAL_CLASSES = [ECGViewport, ECGGenericViewport];
|
|
29
|
+
|
|
30
|
+
export function isSignal(viewport: Types.IViewport) {
|
|
31
|
+
return SIGNAL_CLASSES.includes(viewport.constructor);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function laneOf(viewport: Types.IViewport) {
|
|
35
|
+
switch (viewport.constructor) {
|
|
36
|
+
case VideoViewport:
|
|
37
|
+
return 'legacy';
|
|
38
|
+
case VideoGenericViewport:
|
|
39
|
+
return 'next';
|
|
40
|
+
default:
|
|
41
|
+
return 'other';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const classesToRegister = [VideoViewport, VideoGenericViewport];
|
|
46
|
+
|
|
47
|
+
export function isVideoOrSlide(viewport: Types.IViewport) {
|
|
48
|
+
return (
|
|
49
|
+
viewport instanceof VideoGenericViewport || viewport instanceof WSIViewport
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function twoCastsOfOneValue(viewport: Types.IViewport) {
|
|
54
|
+
return (
|
|
55
|
+
(viewport as Types.IStackViewport).id ||
|
|
56
|
+
(viewport as Types.IVolumeViewport).id
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function isLegacy3D(viewport: Types.IViewport) {
|
|
61
|
+
return (
|
|
62
|
+
viewport instanceof LegacyVolumeViewport3D &&
|
|
63
|
+
!(viewport instanceof GenericVolumeViewport3D)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cornerstone3d-6-review": [
|
|
3
|
+
{
|
|
4
|
+
"cardinality": {
|
|
5
|
+
"file": "input.ts",
|
|
6
|
+
"line": "17",
|
|
7
|
+
"rule": "VolumeViewport3D: two operands of one || are the same now, read what each tested in 5.x"
|
|
8
|
+
},
|
|
9
|
+
"count": 1
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"cardinality": {
|
|
13
|
+
"file": "input.ts",
|
|
14
|
+
"line": "24",
|
|
15
|
+
"rule": "VideoViewport: two operands of one && are the same now, read what each tested in 5.x"
|
|
16
|
+
},
|
|
17
|
+
"count": 1
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"cardinality": {
|
|
21
|
+
"file": "input.ts",
|
|
22
|
+
"line": "28",
|
|
23
|
+
"rule": "ECGViewport: two entries of one list used with includes are the same now, read what each named in 5.x"
|
|
24
|
+
},
|
|
25
|
+
"count": 1
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"cardinality": {
|
|
29
|
+
"file": "input.ts",
|
|
30
|
+
"line": "38",
|
|
31
|
+
"rule": "VideoViewport: two case labels of one switch are the same now, read what each chose in 5.x"
|
|
32
|
+
},
|
|
33
|
+
"count": 1
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -158,6 +158,10 @@ as `viewport` alone, a `let`, a `var` and a container type such as
|
|
|
158
158
|
6.0 viewport).
|
|
159
159
|
- A CommonJS module (`require('@cornerstonejs/core')`) gets no `import`: its
|
|
160
160
|
calls are reported.
|
|
161
|
+
- Manual, at line 1: `the file was not analysed:` with the reason, for a
|
|
162
|
+
file whose names cannot be looked up (the tool cannot read it, or a name
|
|
163
|
+
is declared twice in one scope). The file stays as it is. See the README
|
|
164
|
+
of `@cornerstonejs/cornerstone3d-6`.
|
|
161
165
|
|
|
162
166
|
## Development
|
|
163
167
|
|
|
@@ -4,6 +4,8 @@ import { useMetricAtom } from 'codemod:metrics';
|
|
|
4
4
|
import {
|
|
5
5
|
CoreImports,
|
|
6
6
|
EditSet,
|
|
7
|
+
HeldMetric,
|
|
8
|
+
analysed,
|
|
7
9
|
asPrimary,
|
|
8
10
|
bindsAt,
|
|
9
11
|
bracketKey,
|
|
@@ -29,7 +31,7 @@ import {
|
|
|
29
31
|
import type { Node } from './lib.ts';
|
|
30
32
|
|
|
31
33
|
/** Sites that the reader changes. */
|
|
32
|
-
const manual = useMetricAtom('cornerstone3d-6-manual');
|
|
34
|
+
const manual = new HeldMetric(useMetricAtom('cornerstone3d-6-manual'));
|
|
33
35
|
|
|
34
36
|
/** The data members of the legacy viewports that the transform reports. */
|
|
35
37
|
const REPORTED_MEMBERS = new Set([
|
|
@@ -962,4 +964,4 @@ const codemod: Codemod<TSX> = (root) => {
|
|
|
962
964
|
return rootNode.commitEdits([...run.edits.all(), ...importEdits]);
|
|
963
965
|
};
|
|
964
966
|
|
|
965
|
-
export default codemod;
|
|
967
|
+
export default analysed(codemod, manual);
|