@hero-design/snowflake-guard 1.3.7 → 1.4.0

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.
@@ -45,6 +45,7 @@ describe('parseSource', () => {
45
45
  approvedLocs: [55, 57, 73, 82, 19],
46
46
  styleLocs: [
47
47
  72, 76, 83, 49, 51, 52, 53, 54, 65, 67, 68, 69, 70, 71, 85, 94, 103,
48
+ 111,
48
49
  ],
49
50
  styledComponentLocs: [15, 24, 29],
50
51
  violatingAttributes: [
@@ -230,6 +231,13 @@ describe('parseSource', () => {
230
231
  inlineStyleProps: 'style',
231
232
  loc: 103,
232
233
  },
234
+ {
235
+ attributeName: 'padding',
236
+ attributeValue: '10',
237
+ componentName: 'TextInput.Group',
238
+ inlineStyleProps: 'style',
239
+ loc: 111,
240
+ },
233
241
  ],
234
242
  });
235
243
  });
@@ -31,6 +31,9 @@ describe('reportCustomStyleProperties', () => {
31
31
  const result = (0, reportCustomStyleProperties_1.default)(ast, componentList, commentList);
32
32
  expect(result).toEqual({
33
33
  style: [8],
34
+ barStyle: [],
35
+ textStyle: [],
36
+ containerStyle: [],
34
37
  violatingAttributes: [
35
38
  {
36
39
  attributeName: 'padding',
@@ -51,6 +54,9 @@ describe('reportCustomStyleProperties', () => {
51
54
  const result = (0, reportCustomStyleProperties_1.default)(ast, componentList, commentList);
52
55
  expect(result).toEqual({
53
56
  style: [2],
57
+ barStyle: [],
58
+ textStyle: [],
59
+ containerStyle: [],
54
60
  violatingAttributes: [
55
61
  {
56
62
  attributeName: 'padding',
@@ -72,6 +78,9 @@ describe('reportCustomStyleProperties', () => {
72
78
  const result = (0, reportCustomStyleProperties_1.default)(ast, componentList, commentList);
73
79
  expect(result).toEqual({
74
80
  style: [3],
81
+ barStyle: [],
82
+ textStyle: [],
83
+ containerStyle: [],
75
84
  violatingAttributes: [
76
85
  {
77
86
  attributeName: 'padding',
@@ -91,7 +100,13 @@ describe('reportCustomStyleProperties', () => {
91
100
  `;
92
101
  const ast = (0, testUtils_1.parseTypeScript)(source);
93
102
  const result = (0, reportCustomStyleProperties_1.default)(ast, componentList, commentList);
94
- expect(result).toEqual({ style: [], violatingAttributes: [] });
103
+ expect(result).toEqual({
104
+ style: [],
105
+ barStyle: [],
106
+ textStyle: [],
107
+ containerStyle: [],
108
+ violatingAttributes: [],
109
+ });
95
110
  });
96
111
  it('should ignore approved inline styles', () => {
97
112
  const mockedCommentList = {
@@ -118,6 +133,12 @@ describe('reportCustomStyleProperties', () => {
118
133
  `;
119
134
  const ast = (0, testUtils_1.parseTypeScript)(source);
120
135
  const result = (0, reportCustomStyleProperties_1.default)(ast, componentList, mockedCommentList);
121
- expect(result).toEqual({ style: [], violatingAttributes: [] });
136
+ expect(result).toEqual({
137
+ style: [],
138
+ barStyle: [],
139
+ textStyle: [],
140
+ containerStyle: [],
141
+ violatingAttributes: [],
142
+ });
122
143
  });
123
144
  });
@@ -75,6 +75,7 @@ declare const MOBILE_RULESET_MAP: {
75
75
  'Tabs.Scroll': string[];
76
76
  Tag: string[];
77
77
  TextInput: string[];
78
+ 'TextInput.Group': string[];
78
79
  TimePicker: string[];
79
80
  'Toast.Container': string[];
80
81
  'Toast.Provider': string[];
@@ -356,6 +356,7 @@ const MOBILE_RULESET_MAP = {
356
356
  ...TEXT_ATTRS,
357
357
  ...HEIGHT_ATTRS,
358
358
  ],
359
+ 'TextInput.Group': [...COMMON_PROHIBITED_ATTRS, ...HEIGHT_ATTRS],
359
360
  TimePicker: [
360
361
  ...PADDING_ATTRS,
361
362
  ...BORDER_ATTRS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hero-design/snowflake-guard",
3
- "version": "1.3.7",
3
+ "version": "1.4.0",
4
4
  "description": "A hero-design bot detecting snowflake usage",
5
5
  "author": "Hau Dao",
6
6
  "license": "ISC",