Skip to content

Commit

Permalink
Create rule S1444: Public "static" fields should be read-only (#4453)
Browse files Browse the repository at this point in the history
  • Loading branch information
yassin-kammoun-sonarsource authored Dec 5, 2023
1 parent 65e340d commit 76a783a
Show file tree
Hide file tree
Showing 23 changed files with 743 additions and 48 deletions.
64 changes: 64 additions & 0 deletions its/ruling/src/test/expected/jsts/TypeScript/typescript-S1444.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"TypeScript:scripts/tslint/nextLineRule.ts": [
8,
9
],
"TypeScript:scripts/tslint/noBomRule.ts": [
5
],
"TypeScript:scripts/tslint/noInOperatorRule.ts": [
5
],
"TypeScript:scripts/tslint/noIncrementDecrementRule.ts": [
5,
6
],
"TypeScript:scripts/tslint/noTypeAssertionWhitespaceRule.ts": [
5
],
"TypeScript:scripts/tslint/objectLiteralSurroundingSpaceRule.ts": [
5,
6,
7,
8
],
"TypeScript:scripts/tslint/typeOperatorSpacingRule.ts": [
5
],
"TypeScript:src/harness/harnessLanguageService.ts": [
111
],
"TypeScript:src/server/scriptVersionCache.ts": [
275,
276,
277
],
"TypeScript:src/services/formatting/ruleOperationContext.ts": [
13
],
"TypeScript:src/services/types.ts": [
814,
815,
816,
817,
818,
819,
820,
821,
823,
825,
826,
827,
828,
829,
830,
831,
832,
833,
834,
835,
836,
837,
838
]
}
254 changes: 254 additions & 0 deletions its/ruling/src/test/expected/jsts/ag-grid/typescript-S1444.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
{
"ag-grid:src/ts/columnController/autoGroupColService.ts": [
10
],
"ag-grid:src/ts/components/componentUtil.ts": [
10,
15,
20,
26,
30,
39,
62,
71
],
"ag-grid:src/ts/constants.ts": [
3,
4,
5,
6,
7,
8,
9,
10,
12,
13,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
31,
33,
34,
35,
36,
38,
39,
40,
41,
42,
43,
44,
45,
47,
48,
49,
50,
51,
52,
54,
55,
57,
58,
60,
61,
62,
64,
89,
104
],
"ag-grid:src/ts/dragAndDrop/dragAndDropService.ts": [
69,
70,
71,
72,
73,
74,
75,
76,
77,
79
],
"ag-grid:src/ts/entities/column.ts": [
30,
32,
34,
36,
37,
39,
41,
43,
45,
48,
50,
52,
54,
55,
57,
58
],
"ag-grid:src/ts/entities/columnGroup.ts": [
12,
13,
15,
16
],
"ag-grid:src/ts/entities/originalColumnGroup.ts": [
9
],
"ag-grid:src/ts/entities/rowNode.ts": [
32,
33,
34,
35,
36,
37,
38,
39,
40
],
"ag-grid:src/ts/events.ts": [
10,
12,
15,
18,
21,
24,
27,
30,
33,
36,
39,
42,
45,
48,
51,
54,
57,
60,
63,
65,
66,
67,
68,
69,
70,
71,
72,
74,
75,
77,
81,
82,
83,
86,
90,
91,
92,
95,
97,
98,
101,
104,
106,
108,
110,
112,
113,
115,
116,
119,
121,
124,
127,
131,
133,
135,
136,
137,
140,
141,
143,
148,
149,
150,
151
],
"ag-grid:src/ts/filter/baseFilter.ts": [
46,
47,
48,
49,
50,
51,
52,
54,
55,
56,
57
],
"ag-grid:src/ts/filter/numberFilter.ts": [
13,
15,
16,
17,
18,
19,
30
],
"ag-grid:src/ts/filter/textFilter.ts": [
25
],
"ag-grid:src/ts/gridOptionsWrapper.ts": [
59,
60,
62,
63,
65
],
"ag-grid:src/ts/headerRendering/headerGroup/headerGroupComp.ts": [
41
],
"ag-grid:src/ts/rendering/cellRendererFactory.ts": [
14,
15,
16
],
"ag-grid:src/ts/rendering/renderedRow.ts": [
58
],
"ag-grid:src/ts/rowModels/cache/rowNodeBlock.ts": [
15,
17,
18,
19,
20
],
"ag-grid:src/ts/rowModels/cache/rowNodeCache.ts": [
23
],
"ag-grid:src/ts/svgFactory.ts": [
7
],
"ag-grid:src/ts/widgets/agCheckbox.ts": [
13
],
"ag-grid:src/ts/widgets/component.ts": [
8
],
"ag-grid:src/ts/widgets/touchListener.ts": [
21,
22
]
}
57 changes: 57 additions & 0 deletions its/ruling/src/test/expected/jsts/ant-design/typescript-S1444.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"ant-design:components/_util/wave.tsx": [
35
],
"ant-design:components/affix/index.tsx": [
56
],
"ant-design:components/anchor/Anchor.tsx": [
92,
97
],
"ant-design:components/anchor/AnchorLink.tsx": [
18,
22
],
"ant-design:components/locale-provider/LocaleReceiver.tsx": [
18,
22
],
"ant-design:components/locale-provider/index.tsx": [
57
],
"ant-design:components/menu/MenuItem.tsx": [
21
],
"ant-design:components/menu/index.tsx": [
180,
182,
184,
186
],
"ant-design:components/spin/index.tsx": [
79
],
"ant-design:components/statistic/Countdown.tsx": [
22
],
"ant-design:components/transfer/index.tsx": [
113,
115,
117,
119
],
"ant-design:components/transfer/list.tsx": [
84
],
"ant-design:site/theme/template/Color/ColorPicker.tsx": [
16
],
"ant-design:site/theme/template/IconDisplay/index.tsx": [
33,
35
],
"ant-design:site/theme/template/Layout/Header/index.tsx": [
92
]
}
18 changes: 18 additions & 0 deletions its/ruling/src/test/expected/jsts/console/typescript-S1444.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"console:src/components/MapProps/MapProps.tsx": [
7
],
"console:src/components/ResizableBox.tsx": [
9,
15
],
"console:src/components/Tether/Tether.tsx": [
28
],
"console:src/types/gettingStarted.ts": [
60
],
"console:src/views/CLIAuthView/CLIAuthView/CLIAuthView.tsx": [
52
]
}
Loading

0 comments on commit 76a783a

Please sign in to comment.