@atlaskit/eslint-plugin-ui-styling-standard 0.16.5 → 0.16.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/eslint-plugin-ui-styling-standard
2
2
 
3
+ ## 0.16.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [#112386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112386)
8
+ [`762c18186f898`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/762c18186f898) -
9
+ Internal refactoring to use `context.getSourceCode()` instead of `context.sourceCode` to better
10
+ support older versions of eslint.
11
+
3
12
  ## 0.16.5
4
13
 
5
14
  ### Patch Changes
@@ -11,7 +11,7 @@ var _findVariable3 = require("@atlaskit/eslint-utils/find-variable");
11
11
  var isParameter = function isParameter(context, identifier) {
12
12
  var _findVariable;
13
13
  var definitions = (_findVariable = (0, _findVariable3.findVariable)({
14
- sourceCode: context.sourceCode,
14
+ sourceCode: context.getSourceCode(),
15
15
  identifier: identifier
16
16
  })) === null || _findVariable === void 0 ? void 0 : _findVariable.defs;
17
17
  if (!definitions || !definitions.length) {
@@ -23,7 +23,7 @@ var isParameter = function isParameter(context, identifier) {
23
23
  var isIdentifierAllowed = function isIdentifierAllowed(context, identifier) {
24
24
  var _parent;
25
25
  var variable = (0, _findVariable3.findVariable)({
26
- sourceCode: context.sourceCode,
26
+ sourceCode: context.getSourceCode(),
27
27
  identifier: identifier
28
28
  });
29
29
  if (!variable) {
@@ -70,7 +70,7 @@ function isPropertyValueAllowed(property, context) {
70
70
  return isIdentifierAllowed(context, property.value);
71
71
  } else if (property.value.type === 'CallExpression' && property.value.callee.type === 'Identifier') {
72
72
  var variable = (0, _findVariable3.findVariable)({
73
- sourceCode: context.sourceCode,
73
+ sourceCode: context.getSourceCode(),
74
74
  identifier: property.value.callee
75
75
  });
76
76
  // Anything returned by getAllowedFunctionCalls should be used in css prop instead
@@ -84,7 +84,7 @@ function isPropertyValueAllowed(property, context) {
84
84
  } else if (property.value.type === 'MemberExpression' && property.value.object.type === 'Identifier') {
85
85
  var _findVariable2;
86
86
  var definitions = (_findVariable2 = (0, _findVariable3.findVariable)({
87
- sourceCode: context.sourceCode,
87
+ sourceCode: context.getSourceCode(),
88
88
  identifier: property.value.object
89
89
  })) === null || _findVariable2 === void 0 ? void 0 : _findVariable2.defs;
90
90
  if (!definitions || !definitions.length) {
@@ -57,7 +57,7 @@ var schema = [{
57
57
  var isIdentifierImported = function isIdentifierImported(identifier, context, functionAllowList, keysAllowList) {
58
58
  var variable = (0, _findVariable.findVariable)({
59
59
  identifier: identifier,
60
- sourceCode: context.sourceCode
60
+ sourceCode: context.getSourceCode()
61
61
  });
62
62
  if (!variable) {
63
63
  return false;
@@ -71,7 +71,7 @@ var Linter = exports.Linter = /*#__PURE__*/function () {
71
71
  }
72
72
  var variable = (0, _findVariable.findVariable)({
73
73
  identifier: value,
74
- sourceCode: this.context.sourceCode
74
+ sourceCode: this.context.getSourceCode()
75
75
  });
76
76
  if (!variable) {
77
77
  this.lintUnhandledIdentifier(value);
@@ -172,7 +172,7 @@ var Linter = exports.Linter = /*#__PURE__*/function () {
172
172
  }
173
173
  var variable = (0, _findVariable.findVariable)({
174
174
  identifier: identifier,
175
- sourceCode: this.context.sourceCode
175
+ sourceCode: this.context.getSourceCode()
176
176
  });
177
177
  if (!variable) {
178
178
  return false;
@@ -215,7 +215,7 @@ var Linter = exports.Linter = /*#__PURE__*/function () {
215
215
  }
216
216
  var variable = (0, _findVariable.findVariable)({
217
217
  identifier: identifier,
218
- sourceCode: this.context.sourceCode
218
+ sourceCode: this.context.getSourceCode()
219
219
  });
220
220
  if (!variable) {
221
221
  return false;
@@ -5,7 +5,7 @@ import { findVariable } from '@atlaskit/eslint-utils/find-variable';
5
5
  const isParameter = (context, identifier) => {
6
6
  var _findVariable;
7
7
  const definitions = (_findVariable = findVariable({
8
- sourceCode: context.sourceCode,
8
+ sourceCode: context.getSourceCode(),
9
9
  identifier: identifier
10
10
  })) === null || _findVariable === void 0 ? void 0 : _findVariable.defs;
11
11
  if (!definitions || !definitions.length) {
@@ -17,7 +17,7 @@ const isParameter = (context, identifier) => {
17
17
  const isIdentifierAllowed = (context, identifier) => {
18
18
  var _parent;
19
19
  const variable = findVariable({
20
- sourceCode: context.sourceCode,
20
+ sourceCode: context.getSourceCode(),
21
21
  identifier: identifier
22
22
  });
23
23
  if (!variable) {
@@ -64,7 +64,7 @@ function isPropertyValueAllowed(property, context) {
64
64
  return isIdentifierAllowed(context, property.value);
65
65
  } else if (property.value.type === 'CallExpression' && property.value.callee.type === 'Identifier') {
66
66
  const variable = findVariable({
67
- sourceCode: context.sourceCode,
67
+ sourceCode: context.getSourceCode(),
68
68
  identifier: property.value.callee
69
69
  });
70
70
  // Anything returned by getAllowedFunctionCalls should be used in css prop instead
@@ -78,7 +78,7 @@ function isPropertyValueAllowed(property, context) {
78
78
  } else if (property.value.type === 'MemberExpression' && property.value.object.type === 'Identifier') {
79
79
  var _findVariable2;
80
80
  const definitions = (_findVariable2 = findVariable({
81
- sourceCode: context.sourceCode,
81
+ sourceCode: context.getSourceCode(),
82
82
  identifier: property.value.object
83
83
  })) === null || _findVariable2 === void 0 ? void 0 : _findVariable2.defs;
84
84
  if (!definitions || !definitions.length) {
@@ -47,7 +47,7 @@ const schema = [{
47
47
  const isIdentifierImported = (identifier, context, functionAllowList, keysAllowList) => {
48
48
  const variable = findVariable({
49
49
  identifier: identifier,
50
- sourceCode: context.sourceCode
50
+ sourceCode: context.getSourceCode()
51
51
  });
52
52
  if (!variable) {
53
53
  return false;
@@ -51,7 +51,7 @@ export class Linter {
51
51
  }
52
52
  const variable = findVariable({
53
53
  identifier: value,
54
- sourceCode: this.context.sourceCode
54
+ sourceCode: this.context.getSourceCode()
55
55
  });
56
56
  if (!variable) {
57
57
  this.lintUnhandledIdentifier(value);
@@ -141,7 +141,7 @@ export class Linter {
141
141
  }
142
142
  const variable = findVariable({
143
143
  identifier,
144
- sourceCode: this.context.sourceCode
144
+ sourceCode: this.context.getSourceCode()
145
145
  });
146
146
  if (!variable) {
147
147
  return false;
@@ -180,7 +180,7 @@ export class Linter {
180
180
  }
181
181
  const variable = findVariable({
182
182
  identifier,
183
- sourceCode: this.context.sourceCode
183
+ sourceCode: this.context.getSourceCode()
184
184
  });
185
185
  if (!variable) {
186
186
  return false;
@@ -5,7 +5,7 @@ import { findVariable } from '@atlaskit/eslint-utils/find-variable';
5
5
  var isParameter = function isParameter(context, identifier) {
6
6
  var _findVariable;
7
7
  var definitions = (_findVariable = findVariable({
8
- sourceCode: context.sourceCode,
8
+ sourceCode: context.getSourceCode(),
9
9
  identifier: identifier
10
10
  })) === null || _findVariable === void 0 ? void 0 : _findVariable.defs;
11
11
  if (!definitions || !definitions.length) {
@@ -17,7 +17,7 @@ var isParameter = function isParameter(context, identifier) {
17
17
  var isIdentifierAllowed = function isIdentifierAllowed(context, identifier) {
18
18
  var _parent;
19
19
  var variable = findVariable({
20
- sourceCode: context.sourceCode,
20
+ sourceCode: context.getSourceCode(),
21
21
  identifier: identifier
22
22
  });
23
23
  if (!variable) {
@@ -64,7 +64,7 @@ function isPropertyValueAllowed(property, context) {
64
64
  return isIdentifierAllowed(context, property.value);
65
65
  } else if (property.value.type === 'CallExpression' && property.value.callee.type === 'Identifier') {
66
66
  var variable = findVariable({
67
- sourceCode: context.sourceCode,
67
+ sourceCode: context.getSourceCode(),
68
68
  identifier: property.value.callee
69
69
  });
70
70
  // Anything returned by getAllowedFunctionCalls should be used in css prop instead
@@ -78,7 +78,7 @@ function isPropertyValueAllowed(property, context) {
78
78
  } else if (property.value.type === 'MemberExpression' && property.value.object.type === 'Identifier') {
79
79
  var _findVariable2;
80
80
  var definitions = (_findVariable2 = findVariable({
81
- sourceCode: context.sourceCode,
81
+ sourceCode: context.getSourceCode(),
82
82
  identifier: property.value.object
83
83
  })) === null || _findVariable2 === void 0 ? void 0 : _findVariable2.defs;
84
84
  if (!definitions || !definitions.length) {
@@ -50,7 +50,7 @@ var schema = [{
50
50
  var isIdentifierImported = function isIdentifierImported(identifier, context, functionAllowList, keysAllowList) {
51
51
  var variable = findVariable({
52
52
  identifier: identifier,
53
- sourceCode: context.sourceCode
53
+ sourceCode: context.getSourceCode()
54
54
  });
55
55
  if (!variable) {
56
56
  return false;
@@ -64,7 +64,7 @@ export var Linter = /*#__PURE__*/function () {
64
64
  }
65
65
  var variable = findVariable({
66
66
  identifier: value,
67
- sourceCode: this.context.sourceCode
67
+ sourceCode: this.context.getSourceCode()
68
68
  });
69
69
  if (!variable) {
70
70
  this.lintUnhandledIdentifier(value);
@@ -165,7 +165,7 @@ export var Linter = /*#__PURE__*/function () {
165
165
  }
166
166
  var variable = findVariable({
167
167
  identifier: identifier,
168
- sourceCode: this.context.sourceCode
168
+ sourceCode: this.context.getSourceCode()
169
169
  });
170
170
  if (!variable) {
171
171
  return false;
@@ -208,7 +208,7 @@ export var Linter = /*#__PURE__*/function () {
208
208
  }
209
209
  var variable = findVariable({
210
210
  identifier: identifier,
211
- sourceCode: this.context.sourceCode
211
+ sourceCode: this.context.getSourceCode()
212
212
  });
213
213
  if (!variable) {
214
214
  return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-ui-styling-standard",
3
- "version": "0.16.5",
3
+ "version": "0.16.6",
4
4
  "author": "Atlassian Pty Ltd",
5
5
  "description": "The eslint plugin to enforce and educate on Atlassian's UI Styling Standard",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@ type IdentifierWithParent = Scope.Reference['identifier'] & Rule.NodeParentExten
14
14
 
15
15
  const isParameter = (context: Rule.RuleContext, identifier: Identifier): boolean => {
16
16
  const definitions = findVariable({
17
- sourceCode: context.sourceCode,
17
+ sourceCode: context.getSourceCode(),
18
18
  identifier: identifier,
19
19
  })?.defs;
20
20
  if (!definitions || !definitions.length) {
@@ -27,7 +27,7 @@ const isParameter = (context: Rule.RuleContext, identifier: Identifier): boolean
27
27
 
28
28
  const isIdentifierAllowed = (context: Rule.RuleContext, identifier: Identifier): boolean => {
29
29
  const variable = findVariable({
30
- sourceCode: context.sourceCode,
30
+ sourceCode: context.getSourceCode(),
31
31
  identifier: identifier,
32
32
  });
33
33
 
@@ -79,7 +79,7 @@ function isPropertyValueAllowed(property: ObjPropertyType, context: Rule.RuleCon
79
79
  property.value.callee.type === 'Identifier'
80
80
  ) {
81
81
  const variable = findVariable({
82
- sourceCode: context.sourceCode,
82
+ sourceCode: context.getSourceCode(),
83
83
  identifier: property.value.callee,
84
84
  });
85
85
  // Anything returned by getAllowedFunctionCalls should be used in css prop instead
@@ -98,7 +98,7 @@ function isPropertyValueAllowed(property: ObjPropertyType, context: Rule.RuleCon
98
98
  property.value.object.type === 'Identifier'
99
99
  ) {
100
100
  const definitions = findVariable({
101
- sourceCode: context.sourceCode,
101
+ sourceCode: context.getSourceCode(),
102
102
  identifier: property.value.object,
103
103
  })?.defs;
104
104
  if (!definitions || !definitions.length) {
@@ -58,7 +58,7 @@ const isIdentifierImported = (
58
58
  ): boolean => {
59
59
  const variable = findVariable({
60
60
  identifier: identifier,
61
- sourceCode: context.sourceCode,
61
+ sourceCode: context.getSourceCode(),
62
62
  });
63
63
  if (!variable) {
64
64
  return false;
@@ -81,7 +81,7 @@ export class Linter {
81
81
 
82
82
  const variable = findVariable({
83
83
  identifier: value,
84
- sourceCode: this.context.sourceCode,
84
+ sourceCode: this.context.getSourceCode(),
85
85
  });
86
86
  if (!variable) {
87
87
  this.lintUnhandledIdentifier(value);
@@ -170,7 +170,7 @@ export class Linter {
170
170
 
171
171
  const variable = findVariable({
172
172
  identifier,
173
- sourceCode: this.context.sourceCode,
173
+ sourceCode: this.context.getSourceCode(),
174
174
  });
175
175
  if (!variable) {
176
176
  return false;
@@ -211,7 +211,7 @@ export class Linter {
211
211
 
212
212
  const variable = findVariable({
213
213
  identifier,
214
- sourceCode: this.context.sourceCode,
214
+ sourceCode: this.context.getSourceCode(),
215
215
  });
216
216
  if (!variable) {
217
217
  return false;