@atlaskit/eslint-plugin-ui-styling-standard 0.19.0 → 0.19.1
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 +9 -0
- package/dist/cjs/rules/convert-props-syntax/index.js +5 -13
- package/dist/cjs/rules/no-array-arguments/index.js +3 -3
- package/dist/cjs/rules/no-dynamic-styles/index.js +3 -3
- package/dist/cjs/rules/no-global-styles/index.js +5 -13
- package/dist/cjs/rules/no-important-styles/index.js +3 -3
- package/dist/cjs/rules/no-imported-style-values/index.js +3 -3
- package/dist/cjs/rules/no-nested-selectors/index.js +1 -1
- package/dist/cjs/rules/no-styled/index.js +4 -20
- package/dist/cjs/rules/no-unsafe-selectors/constants.js +1 -1
- package/dist/cjs/rules/no-unsafe-selectors/index.js +2 -10
- package/dist/cjs/rules/no-unsafe-values/utils.js +3 -3
- package/dist/cjs/rules/use-compiled/index.js +2 -10
- package/dist/es2019/rules/no-unsafe-selectors/constants.js +1 -1
- package/dist/esm/rules/convert-props-syntax/index.js +5 -13
- package/dist/esm/rules/no-array-arguments/index.js +3 -3
- package/dist/esm/rules/no-dynamic-styles/index.js +3 -3
- package/dist/esm/rules/no-global-styles/index.js +5 -13
- package/dist/esm/rules/no-important-styles/index.js +3 -3
- package/dist/esm/rules/no-imported-style-values/index.js +3 -3
- package/dist/esm/rules/no-styled/index.js +4 -20
- package/dist/esm/rules/no-unsafe-selectors/constants.js +1 -1
- package/dist/esm/rules/no-unsafe-selectors/index.js +2 -10
- package/dist/esm/rules/no-unsafe-values/utils.js +3 -3
- package/dist/esm/rules/use-compiled/index.js +2 -10
- package/dist/types/rules/no-unsafe-selectors/constants.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-unsafe-selectors/constants.d.ts +2 -1
- package/package.json +7 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-ui-styling-standard
|
|
2
2
|
|
|
3
|
+
## 0.19.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#152862](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/152862)
|
|
8
|
+
[`8febdd40a9680`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8febdd40a9680) -
|
|
9
|
+
Added &::-webkit-details-marker CSS psuedo into the allowed set of psuedos in
|
|
10
|
+
@atlaskit/ui-styling-standard/no-unsafe-selectors rule
|
|
11
|
+
|
|
3
12
|
## 0.19.0
|
|
4
13
|
|
|
5
14
|
### Minor Changes
|
|
@@ -10,9 +10,9 @@ var _createRule = require("../utils/create-rule");
|
|
|
10
10
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
11
11
|
var _estraverse = _interopRequireDefault(require("estraverse"));
|
|
12
12
|
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
13
|
-
function _createForOfIteratorHelper(
|
|
14
|
-
function _unsupportedIterableToArray(
|
|
15
|
-
function _arrayLikeToArray(
|
|
13
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
16
|
/**
|
|
17
17
|
* Represents some information about single line that contains some props, e.g.
|
|
18
18
|
* the arrow function in
|
|
@@ -385,15 +385,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
385
385
|
},
|
|
386
386
|
create: function create(context) {
|
|
387
387
|
return {
|
|
388
|
-
CallExpression: function (
|
|
389
|
-
function CallExpression(_x) {
|
|
390
|
-
return _CallExpression.apply(this, arguments);
|
|
391
|
-
}
|
|
392
|
-
CallExpression.toString = function () {
|
|
393
|
-
return _CallExpression.toString();
|
|
394
|
-
};
|
|
395
|
-
return CallExpression;
|
|
396
|
-
}(function (node) {
|
|
388
|
+
CallExpression: function CallExpression(node) {
|
|
397
389
|
var _node$parent, _node$parent2;
|
|
398
390
|
var references = context.getScope().references;
|
|
399
391
|
|
|
@@ -419,7 +411,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
419
411
|
return;
|
|
420
412
|
}
|
|
421
413
|
lintArguments(context, node.arguments);
|
|
422
|
-
}
|
|
414
|
+
}
|
|
423
415
|
};
|
|
424
416
|
}
|
|
425
417
|
});
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.rule = exports.default = void 0;
|
|
7
7
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
8
8
|
var _createRule = require("../utils/create-rule");
|
|
9
|
-
function _createForOfIteratorHelper(
|
|
10
|
-
function _unsupportedIterableToArray(
|
|
11
|
-
function _arrayLikeToArray(
|
|
9
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
10
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
11
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
12
12
|
var schema = [{
|
|
13
13
|
type: 'object',
|
|
14
14
|
properties: {
|
|
@@ -8,9 +8,9 @@ exports.rule = exports.default = void 0;
|
|
|
8
8
|
var _esquery = _interopRequireDefault(require("esquery"));
|
|
9
9
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
10
10
|
var _createRule = require("../utils/create-rule");
|
|
11
|
-
function _createForOfIteratorHelper(
|
|
12
|
-
function _unsupportedIterableToArray(
|
|
13
|
-
function _arrayLikeToArray(
|
|
11
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
12
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
14
14
|
var schema = [{
|
|
15
15
|
type: 'object',
|
|
16
16
|
properties: {
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.rule = exports.default = void 0;
|
|
7
7
|
var _createRule = require("../utils/create-rule");
|
|
8
|
-
function _createForOfIteratorHelper(
|
|
9
|
-
function _unsupportedIterableToArray(
|
|
10
|
-
function _arrayLikeToArray(
|
|
8
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
9
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
11
11
|
var restrictedFileTypes = ['.css', '.less', '.sass', '.scss'];
|
|
12
12
|
var restrictedImports = {
|
|
13
13
|
'@emotion/core': ['Global'],
|
|
@@ -73,18 +73,10 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
return {
|
|
76
|
-
ImportDeclaration: function (
|
|
77
|
-
function ImportDeclaration(_x) {
|
|
78
|
-
return _ImportDeclaration.apply(this, arguments);
|
|
79
|
-
}
|
|
80
|
-
ImportDeclaration.toString = function () {
|
|
81
|
-
return _ImportDeclaration.toString();
|
|
82
|
-
};
|
|
83
|
-
return ImportDeclaration;
|
|
84
|
-
}(function (node) {
|
|
76
|
+
ImportDeclaration: function ImportDeclaration(node) {
|
|
85
77
|
checkFileType(node);
|
|
86
78
|
checkImports(node);
|
|
87
|
-
}
|
|
79
|
+
},
|
|
88
80
|
'JSXOpeningElement[name.name="style"]': function JSXOpeningElementNameNameStyle(node) {
|
|
89
81
|
context.report({
|
|
90
82
|
node: node,
|
|
@@ -9,9 +9,9 @@ var _esquery = _interopRequireDefault(require("esquery"));
|
|
|
9
9
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
10
10
|
var _schema = require("@atlaskit/eslint-utils/schema");
|
|
11
11
|
var _createRuleWithTypedConfig = require("../utils/create-rule-with-typed-config");
|
|
12
|
-
function _createForOfIteratorHelper(
|
|
13
|
-
function _unsupportedIterableToArray(
|
|
14
|
-
function _arrayLikeToArray(
|
|
12
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
13
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
14
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
15
15
|
var rule = exports.rule = (0, _createRuleWithTypedConfig.createLintRuleWithTypedConfig)({
|
|
16
16
|
meta: {
|
|
17
17
|
name: 'no-important-styles',
|
|
@@ -11,9 +11,9 @@ var _allowedFunctionCalls = require("@atlaskit/eslint-utils/allowed-function-cal
|
|
|
11
11
|
var _findVariable = require("@atlaskit/eslint-utils/find-variable");
|
|
12
12
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
13
13
|
var _createRule = require("../utils/create-rule");
|
|
14
|
-
function _createForOfIteratorHelper(
|
|
15
|
-
function _unsupportedIterableToArray(
|
|
16
|
-
function _arrayLikeToArray(
|
|
14
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
15
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
17
17
|
var schema = [{
|
|
18
18
|
type: 'object',
|
|
19
19
|
properties: {
|
|
@@ -12,7 +12,7 @@ var _walkStyleProperties = require("@atlaskit/eslint-utils/walk-style-properties
|
|
|
12
12
|
var _schema = require("@atlaskit/eslint-utils/schema");
|
|
13
13
|
var _createRuleWithTypedConfig = require("../utils/create-rule-with-typed-config");
|
|
14
14
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u &&
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
16
|
var getCssSelector = function getCssSelector(key) {
|
|
17
17
|
if (key.type === 'Literal' && typeof key.value === 'string') {
|
|
18
18
|
return key.value;
|
|
@@ -21,15 +21,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
21
21
|
},
|
|
22
22
|
create: function create(context) {
|
|
23
23
|
return {
|
|
24
|
-
CallExpression: function (
|
|
25
|
-
function CallExpression(_x) {
|
|
26
|
-
return _CallExpression.apply(this, arguments);
|
|
27
|
-
}
|
|
28
|
-
CallExpression.toString = function () {
|
|
29
|
-
return _CallExpression.toString();
|
|
30
|
-
};
|
|
31
|
-
return CallExpression;
|
|
32
|
-
}(function (node) {
|
|
24
|
+
CallExpression: function CallExpression(node) {
|
|
33
25
|
var references = context.getScope().references;
|
|
34
26
|
var importSources = (0, _isSupportedImport.getImportSources)(context);
|
|
35
27
|
if ((0, _isSupportedImport.isStyled)(node, references, importSources)) {
|
|
@@ -38,16 +30,8 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
38
30
|
messageId: 'no-styled'
|
|
39
31
|
});
|
|
40
32
|
}
|
|
41
|
-
}
|
|
42
|
-
MemberExpression: function (
|
|
43
|
-
function MemberExpression(_x2) {
|
|
44
|
-
return _MemberExpression.apply(this, arguments);
|
|
45
|
-
}
|
|
46
|
-
MemberExpression.toString = function () {
|
|
47
|
-
return _MemberExpression.toString();
|
|
48
|
-
};
|
|
49
|
-
return MemberExpression;
|
|
50
|
-
}(function (node) {
|
|
33
|
+
},
|
|
34
|
+
MemberExpression: function MemberExpression(node) {
|
|
51
35
|
var references = context.getScope().references;
|
|
52
36
|
var importSources = (0, _isSupportedImport.getImportSources)(context);
|
|
53
37
|
if (node.object.type === 'Identifier' && (0, _isSupportedImport.isStyled)(node.object, references, importSources)) {
|
|
@@ -60,7 +44,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
60
44
|
messageId: 'no-styled'
|
|
61
45
|
});
|
|
62
46
|
}
|
|
63
|
-
}
|
|
47
|
+
}
|
|
64
48
|
};
|
|
65
49
|
}
|
|
66
50
|
});
|
|
@@ -13,7 +13,7 @@ exports.legacyPseudoElements = exports.ignoredAtRules = exports.allowedPseudos =
|
|
|
13
13
|
* Exporting this so it isn't considered unused.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
var cssPseudos = ['&:active', '&:autofill', '&:blank', '&:checked', '&:default', '&:defined', '&:disabled', '&:empty', '&:enabled', '&:first', '&:focus', '&:focus-visible', '&:focus-within', '&:fullscreen', '&:hover', '&:in-range', '&:indeterminate', '&:invalid', '&:left', '&:link', '&:local-link', '&:optional', '&:out-of-range', '&:paused', '&:picture-in-picture', '&:placeholder-shown', '&:playing', '&:read-only', '&:read-write', '&:required', '&:right', '&:target', '&:user-invalid', '&:user-valid', '&:valid', '&:visited', '&::after', '&::backdrop', '&::before', '&::cue', '&::cue-region', '&::first-letter', '&::first-line', '&::grammar-error', '&::marker', '&::placeholder', '&::selection', '&::spelling-error', '&::target-text', '&::view-transition'];
|
|
16
|
+
var cssPseudos = ['&:active', '&:autofill', '&:blank', '&:checked', '&:default', '&:defined', '&:disabled', '&:empty', '&:enabled', '&:first', '&:focus', '&:focus-visible', '&:focus-within', '&:fullscreen', '&:hover', '&:in-range', '&:indeterminate', '&:invalid', '&:left', '&:link', '&:local-link', '&:optional', '&:out-of-range', '&:paused', '&:picture-in-picture', '&:placeholder-shown', '&:playing', '&:read-only', '&:read-write', '&:required', '&:right', '&:target', '&:user-invalid', '&:user-valid', '&:valid', '&:visited', '&::after', '&::backdrop', '&::before', '&::cue', '&::cue-region', '&::first-letter', '&::first-line', '&::grammar-error', '&::marker', '&::placeholder', '&::selection', '&::spelling-error', '&::target-text', '&::view-transition', '&::-webkit-details-marker'];
|
|
17
17
|
var allowedPseudos = exports.allowedPseudos = new Set(
|
|
18
18
|
/**
|
|
19
19
|
* The `&` is included above for type checking reasons,
|
|
@@ -84,15 +84,7 @@ var rule = (0, _createRuleWithTypedConfig.createLintRuleWithTypedConfig)({
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
},
|
|
87
|
-
CallExpression: function (
|
|
88
|
-
function CallExpression(_x) {
|
|
89
|
-
return _CallExpression.apply(this, arguments);
|
|
90
|
-
}
|
|
91
|
-
CallExpression.toString = function () {
|
|
92
|
-
return _CallExpression.toString();
|
|
93
|
-
};
|
|
94
|
-
return CallExpression;
|
|
95
|
-
}(function (node) {
|
|
87
|
+
CallExpression: function CallExpression(node) {
|
|
96
88
|
var _context$getScope = context.getScope(),
|
|
97
89
|
references = _context$getScope.references;
|
|
98
90
|
var isXcssCall = (0, _isSupportedImport.isXcss)(node, references, config.importSources);
|
|
@@ -154,7 +146,7 @@ var rule = (0, _createRuleWithTypedConfig.createLintRuleWithTypedConfig)({
|
|
|
154
146
|
});
|
|
155
147
|
}
|
|
156
148
|
});
|
|
157
|
-
}
|
|
149
|
+
}
|
|
158
150
|
};
|
|
159
151
|
}
|
|
160
152
|
});
|
|
@@ -10,9 +10,9 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
10
10
|
var _allowedFunctionCalls = require("@atlaskit/eslint-utils/allowed-function-calls");
|
|
11
11
|
var _findIdentifierNode = require("@atlaskit/eslint-utils/find-identifier-node");
|
|
12
12
|
var _findVariable = require("@atlaskit/eslint-utils/find-variable");
|
|
13
|
-
function _createForOfIteratorHelper(
|
|
14
|
-
function _unsupportedIterableToArray(
|
|
15
|
-
function _arrayLikeToArray(
|
|
13
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
14
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
15
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
16
16
|
function isReferenceToCssVar(variable) {
|
|
17
17
|
var definitions = variable.defs;
|
|
18
18
|
return definitions.every(function (definition) {
|
|
@@ -114,15 +114,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
114
114
|
})
|
|
115
115
|
});
|
|
116
116
|
},
|
|
117
|
-
ImportDeclaration: function (
|
|
118
|
-
function ImportDeclaration(_x) {
|
|
119
|
-
return _ImportDeclaration.apply(this, arguments);
|
|
120
|
-
}
|
|
121
|
-
ImportDeclaration.toString = function () {
|
|
122
|
-
return _ImportDeclaration.toString();
|
|
123
|
-
};
|
|
124
|
-
return ImportDeclaration;
|
|
125
|
-
}(function (node) {
|
|
117
|
+
ImportDeclaration: function ImportDeclaration(node) {
|
|
126
118
|
var importSource = node.source.value;
|
|
127
119
|
if (!isSupportedImportSource(importSource)) {
|
|
128
120
|
return;
|
|
@@ -168,7 +160,7 @@ var rule = exports.rule = (0, _createRule.createLintRule)({
|
|
|
168
160
|
}, fix);
|
|
169
161
|
})
|
|
170
162
|
});
|
|
171
|
-
}
|
|
163
|
+
}
|
|
172
164
|
};
|
|
173
165
|
}
|
|
174
166
|
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Exporting this so it isn't considered unused.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
const cssPseudos = ['&:active', '&:autofill', '&:blank', '&:checked', '&:default', '&:defined', '&:disabled', '&:empty', '&:enabled', '&:first', '&:focus', '&:focus-visible', '&:focus-within', '&:fullscreen', '&:hover', '&:in-range', '&:indeterminate', '&:invalid', '&:left', '&:link', '&:local-link', '&:optional', '&:out-of-range', '&:paused', '&:picture-in-picture', '&:placeholder-shown', '&:playing', '&:read-only', '&:read-write', '&:required', '&:right', '&:target', '&:user-invalid', '&:user-valid', '&:valid', '&:visited', '&::after', '&::backdrop', '&::before', '&::cue', '&::cue-region', '&::first-letter', '&::first-line', '&::grammar-error', '&::marker', '&::placeholder', '&::selection', '&::spelling-error', '&::target-text', '&::view-transition'];
|
|
10
|
+
const cssPseudos = ['&:active', '&:autofill', '&:blank', '&:checked', '&:default', '&:defined', '&:disabled', '&:empty', '&:enabled', '&:first', '&:focus', '&:focus-visible', '&:focus-within', '&:fullscreen', '&:hover', '&:in-range', '&:indeterminate', '&:invalid', '&:left', '&:link', '&:local-link', '&:optional', '&:out-of-range', '&:paused', '&:picture-in-picture', '&:placeholder-shown', '&:playing', '&:read-only', '&:read-write', '&:required', '&:right', '&:target', '&:user-invalid', '&:user-valid', '&:valid', '&:visited', '&::after', '&::backdrop', '&::before', '&::cue', '&::cue-region', '&::first-letter', '&::first-line', '&::grammar-error', '&::marker', '&::placeholder', '&::selection', '&::spelling-error', '&::target-text', '&::view-transition', '&::-webkit-details-marker'];
|
|
11
11
|
export const allowedPseudos = new Set(
|
|
12
12
|
/**
|
|
13
13
|
* The `&` is included above for type checking reasons,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(
|
|
2
|
-
function _unsupportedIterableToArray(
|
|
3
|
-
function _arrayLikeToArray(
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
4
|
import { analyze } from 'eslint-scope';
|
|
5
5
|
import { createLintRule } from '../utils/create-rule';
|
|
6
6
|
import { isStyledComponents, isEmotion } from '@atlaskit/eslint-utils/is-supported-import';
|
|
@@ -379,15 +379,7 @@ export var rule = createLintRule({
|
|
|
379
379
|
},
|
|
380
380
|
create: function create(context) {
|
|
381
381
|
return {
|
|
382
|
-
CallExpression: function (
|
|
383
|
-
function CallExpression(_x) {
|
|
384
|
-
return _CallExpression.apply(this, arguments);
|
|
385
|
-
}
|
|
386
|
-
CallExpression.toString = function () {
|
|
387
|
-
return _CallExpression.toString();
|
|
388
|
-
};
|
|
389
|
-
return CallExpression;
|
|
390
|
-
}(function (node) {
|
|
382
|
+
CallExpression: function CallExpression(node) {
|
|
391
383
|
var _node$parent, _node$parent2;
|
|
392
384
|
var references = context.getScope().references;
|
|
393
385
|
|
|
@@ -413,7 +405,7 @@ export var rule = createLintRule({
|
|
|
413
405
|
return;
|
|
414
406
|
}
|
|
415
407
|
lintArguments(context, node.arguments);
|
|
416
|
-
}
|
|
408
|
+
}
|
|
417
409
|
};
|
|
418
410
|
}
|
|
419
411
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(
|
|
2
|
-
function _unsupportedIterableToArray(
|
|
3
|
-
function _arrayLikeToArray(
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
4
|
import { getImportSources, hasStyleObjectArguments } from '@atlaskit/eslint-utils/is-supported-import';
|
|
5
5
|
import { createLintRule } from '../utils/create-rule';
|
|
6
6
|
var schema = [{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(
|
|
2
|
-
function _unsupportedIterableToArray(
|
|
3
|
-
function _arrayLikeToArray(
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
4
|
import esquery from 'esquery';
|
|
5
5
|
import { getImportSources, hasStyleObjectArguments } from '@atlaskit/eslint-utils/is-supported-import';
|
|
6
6
|
import { createLintRule } from '../utils/create-rule';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(
|
|
2
|
-
function _unsupportedIterableToArray(
|
|
3
|
-
function _arrayLikeToArray(
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
4
|
import { createLintRule } from '../utils/create-rule';
|
|
5
5
|
var restrictedFileTypes = ['.css', '.less', '.sass', '.scss'];
|
|
6
6
|
var restrictedImports = {
|
|
@@ -67,18 +67,10 @@ export var rule = createLintRule({
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
return {
|
|
70
|
-
ImportDeclaration: function (
|
|
71
|
-
function ImportDeclaration(_x) {
|
|
72
|
-
return _ImportDeclaration.apply(this, arguments);
|
|
73
|
-
}
|
|
74
|
-
ImportDeclaration.toString = function () {
|
|
75
|
-
return _ImportDeclaration.toString();
|
|
76
|
-
};
|
|
77
|
-
return ImportDeclaration;
|
|
78
|
-
}(function (node) {
|
|
70
|
+
ImportDeclaration: function ImportDeclaration(node) {
|
|
79
71
|
checkFileType(node);
|
|
80
72
|
checkImports(node);
|
|
81
|
-
}
|
|
73
|
+
},
|
|
82
74
|
'JSXOpeningElement[name.name="style"]': function JSXOpeningElementNameNameStyle(node) {
|
|
83
75
|
context.report({
|
|
84
76
|
node: node,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(
|
|
2
|
-
function _unsupportedIterableToArray(
|
|
3
|
-
function _arrayLikeToArray(
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
4
|
import esquery from 'esquery';
|
|
5
5
|
import { hasStyleObjectArguments } from '@atlaskit/eslint-utils/is-supported-import';
|
|
6
6
|
import { importSources } from '@atlaskit/eslint-utils/schema';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function _createForOfIteratorHelper(
|
|
2
|
-
function _unsupportedIterableToArray(
|
|
3
|
-
function _arrayLikeToArray(
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
4
|
import esquery from 'esquery';
|
|
5
5
|
import estraverse from 'estraverse';
|
|
6
6
|
import { getAllowedDynamicKeys, getAllowedFunctionCalls, isAllowListedVariable } from '@atlaskit/eslint-utils/allowed-function-calls';
|
|
@@ -15,15 +15,7 @@ export var rule = createLintRule({
|
|
|
15
15
|
},
|
|
16
16
|
create: function create(context) {
|
|
17
17
|
return {
|
|
18
|
-
CallExpression: function (
|
|
19
|
-
function CallExpression(_x) {
|
|
20
|
-
return _CallExpression.apply(this, arguments);
|
|
21
|
-
}
|
|
22
|
-
CallExpression.toString = function () {
|
|
23
|
-
return _CallExpression.toString();
|
|
24
|
-
};
|
|
25
|
-
return CallExpression;
|
|
26
|
-
}(function (node) {
|
|
18
|
+
CallExpression: function CallExpression(node) {
|
|
27
19
|
var references = context.getScope().references;
|
|
28
20
|
var importSources = getImportSources(context);
|
|
29
21
|
if (isStyled(node, references, importSources)) {
|
|
@@ -32,16 +24,8 @@ export var rule = createLintRule({
|
|
|
32
24
|
messageId: 'no-styled'
|
|
33
25
|
});
|
|
34
26
|
}
|
|
35
|
-
}
|
|
36
|
-
MemberExpression: function (
|
|
37
|
-
function MemberExpression(_x2) {
|
|
38
|
-
return _MemberExpression.apply(this, arguments);
|
|
39
|
-
}
|
|
40
|
-
MemberExpression.toString = function () {
|
|
41
|
-
return _MemberExpression.toString();
|
|
42
|
-
};
|
|
43
|
-
return MemberExpression;
|
|
44
|
-
}(function (node) {
|
|
27
|
+
},
|
|
28
|
+
MemberExpression: function MemberExpression(node) {
|
|
45
29
|
var references = context.getScope().references;
|
|
46
30
|
var importSources = getImportSources(context);
|
|
47
31
|
if (node.object.type === 'Identifier' && isStyled(node.object, references, importSources)) {
|
|
@@ -54,7 +38,7 @@ export var rule = createLintRule({
|
|
|
54
38
|
messageId: 'no-styled'
|
|
55
39
|
});
|
|
56
40
|
}
|
|
57
|
-
}
|
|
41
|
+
}
|
|
58
42
|
};
|
|
59
43
|
}
|
|
60
44
|
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* Exporting this so it isn't considered unused.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
var cssPseudos = ['&:active', '&:autofill', '&:blank', '&:checked', '&:default', '&:defined', '&:disabled', '&:empty', '&:enabled', '&:first', '&:focus', '&:focus-visible', '&:focus-within', '&:fullscreen', '&:hover', '&:in-range', '&:indeterminate', '&:invalid', '&:left', '&:link', '&:local-link', '&:optional', '&:out-of-range', '&:paused', '&:picture-in-picture', '&:placeholder-shown', '&:playing', '&:read-only', '&:read-write', '&:required', '&:right', '&:target', '&:user-invalid', '&:user-valid', '&:valid', '&:visited', '&::after', '&::backdrop', '&::before', '&::cue', '&::cue-region', '&::first-letter', '&::first-line', '&::grammar-error', '&::marker', '&::placeholder', '&::selection', '&::spelling-error', '&::target-text', '&::view-transition'];
|
|
10
|
+
var cssPseudos = ['&:active', '&:autofill', '&:blank', '&:checked', '&:default', '&:defined', '&:disabled', '&:empty', '&:enabled', '&:first', '&:focus', '&:focus-visible', '&:focus-within', '&:fullscreen', '&:hover', '&:in-range', '&:indeterminate', '&:invalid', '&:left', '&:link', '&:local-link', '&:optional', '&:out-of-range', '&:paused', '&:picture-in-picture', '&:placeholder-shown', '&:playing', '&:read-only', '&:read-write', '&:required', '&:right', '&:target', '&:user-invalid', '&:user-valid', '&:valid', '&:visited', '&::after', '&::backdrop', '&::before', '&::cue', '&::cue-region', '&::first-letter', '&::first-line', '&::grammar-error', '&::marker', '&::placeholder', '&::selection', '&::spelling-error', '&::target-text', '&::view-transition', '&::-webkit-details-marker'];
|
|
11
11
|
export var allowedPseudos = new Set(
|
|
12
12
|
/**
|
|
13
13
|
* The `&` is included above for type checking reasons,
|
|
@@ -77,15 +77,7 @@ var rule = createLintRuleWithTypedConfig({
|
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
},
|
|
80
|
-
CallExpression: function (
|
|
81
|
-
function CallExpression(_x) {
|
|
82
|
-
return _CallExpression.apply(this, arguments);
|
|
83
|
-
}
|
|
84
|
-
CallExpression.toString = function () {
|
|
85
|
-
return _CallExpression.toString();
|
|
86
|
-
};
|
|
87
|
-
return CallExpression;
|
|
88
|
-
}(function (node) {
|
|
80
|
+
CallExpression: function CallExpression(node) {
|
|
89
81
|
var _context$getScope = context.getScope(),
|
|
90
82
|
references = _context$getScope.references;
|
|
91
83
|
var isXcssCall = isXcss(node, references, config.importSources);
|
|
@@ -147,7 +139,7 @@ var rule = createLintRuleWithTypedConfig({
|
|
|
147
139
|
});
|
|
148
140
|
}
|
|
149
141
|
});
|
|
150
|
-
}
|
|
142
|
+
}
|
|
151
143
|
};
|
|
152
144
|
}
|
|
153
145
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
function _createForOfIteratorHelper(
|
|
4
|
-
function _unsupportedIterableToArray(
|
|
5
|
-
function _arrayLikeToArray(
|
|
3
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
4
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
5
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
6
6
|
import { getAllowedDynamicKeys, getAllowedFunctionCalls, isAllowListedVariable } from '@atlaskit/eslint-utils/allowed-function-calls';
|
|
7
7
|
import { findIdentifierNode } from '@atlaskit/eslint-utils/find-identifier-node';
|
|
8
8
|
import { findVariable } from '@atlaskit/eslint-utils/find-variable';
|
|
@@ -107,15 +107,7 @@ export var rule = createLintRule({
|
|
|
107
107
|
})
|
|
108
108
|
});
|
|
109
109
|
},
|
|
110
|
-
ImportDeclaration: function (
|
|
111
|
-
function ImportDeclaration(_x) {
|
|
112
|
-
return _ImportDeclaration.apply(this, arguments);
|
|
113
|
-
}
|
|
114
|
-
ImportDeclaration.toString = function () {
|
|
115
|
-
return _ImportDeclaration.toString();
|
|
116
|
-
};
|
|
117
|
-
return ImportDeclaration;
|
|
118
|
-
}(function (node) {
|
|
110
|
+
ImportDeclaration: function ImportDeclaration(node) {
|
|
119
111
|
var importSource = node.source.value;
|
|
120
112
|
if (!isSupportedImportSource(importSource)) {
|
|
121
113
|
return;
|
|
@@ -161,7 +153,7 @@ export var rule = createLintRule({
|
|
|
161
153
|
}, fix);
|
|
162
154
|
})
|
|
163
155
|
});
|
|
164
|
-
}
|
|
156
|
+
}
|
|
165
157
|
};
|
|
166
158
|
}
|
|
167
159
|
});
|
|
@@ -13,7 +13,7 @@ type HasAllUnique<Tuple, Union, Seen = never> = Tuple extends readonly [infer He
|
|
|
13
13
|
* Exporting this so it isn't considered unused.
|
|
14
14
|
*/
|
|
15
15
|
export type _ = Validate<HasAllUnique<typeof cssPseudos, CSSPseudos>>;
|
|
16
|
-
declare const cssPseudos: readonly ["&:active", "&:autofill", "&:blank", "&:checked", "&:default", "&:defined", "&:disabled", "&:empty", "&:enabled", "&:first", "&:focus", "&:focus-visible", "&:focus-within", "&:fullscreen", "&:hover", "&:in-range", "&:indeterminate", "&:invalid", "&:left", "&:link", "&:local-link", "&:optional", "&:out-of-range", "&:paused", "&:picture-in-picture", "&:placeholder-shown", "&:playing", "&:read-only", "&:read-write", "&:required", "&:right", "&:target", "&:user-invalid", "&:user-valid", "&:valid", "&:visited", "&::after", "&::backdrop", "&::before", "&::cue", "&::cue-region", "&::first-letter", "&::first-line", "&::grammar-error", "&::marker", "&::placeholder", "&::selection", "&::spelling-error", "&::target-text", "&::view-transition"];
|
|
16
|
+
declare const cssPseudos: readonly ["&:active", "&:autofill", "&:blank", "&:checked", "&:default", "&:defined", "&:disabled", "&:empty", "&:enabled", "&:first", "&:focus", "&:focus-visible", "&:focus-within", "&:fullscreen", "&:hover", "&:in-range", "&:indeterminate", "&:invalid", "&:left", "&:link", "&:local-link", "&:optional", "&:out-of-range", "&:paused", "&:picture-in-picture", "&:placeholder-shown", "&:playing", "&:read-only", "&:read-write", "&:required", "&:right", "&:target", "&:user-invalid", "&:user-valid", "&:valid", "&:visited", "&::after", "&::backdrop", "&::before", "&::cue", "&::cue-region", "&::first-letter", "&::first-line", "&::grammar-error", "&::marker", "&::placeholder", "&::selection", "&::spelling-error", "&::target-text", "&::view-transition", "&::-webkit-details-marker"];
|
|
17
17
|
export declare const allowedPseudos: Set<string>;
|
|
18
18
|
export declare const legacyPseudoElements: Set<string>;
|
|
19
19
|
export declare const ignoredAtRules: Set<string>;
|
|
@@ -76,7 +76,8 @@ declare const cssPseudos: readonly [
|
|
|
76
76
|
"&::selection",
|
|
77
77
|
"&::spelling-error",
|
|
78
78
|
"&::target-text",
|
|
79
|
-
"&::view-transition"
|
|
79
|
+
"&::view-transition",
|
|
80
|
+
"&::-webkit-details-marker"
|
|
80
81
|
];
|
|
81
82
|
export declare const allowedPseudos: Set<string>;
|
|
82
83
|
export declare const legacyPseudoElements: Set<string>;
|
package/package.json
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-ui-styling-standard",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.1",
|
|
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",
|
|
7
7
|
"atlassian": {
|
|
8
8
|
"team": "Design System Team",
|
|
9
|
-
"inPublicMirror": true,
|
|
10
|
-
"releaseModel": "continuous",
|
|
11
9
|
"website": {
|
|
12
10
|
"name": "UI Styling Standard",
|
|
13
11
|
"category": "Tooling"
|
|
14
12
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
13
|
+
"toolingLabels": [
|
|
14
|
+
"linting"
|
|
17
15
|
]
|
|
18
16
|
},
|
|
19
17
|
"publishConfig": {
|
|
@@ -39,7 +37,7 @@
|
|
|
39
37
|
".": "./src/index.tsx"
|
|
40
38
|
},
|
|
41
39
|
"dependencies": {
|
|
42
|
-
"@atlaskit/eslint-utils": "^1.
|
|
40
|
+
"@atlaskit/eslint-utils": "^1.7.0",
|
|
43
41
|
"@babel/runtime": "^7.0.0",
|
|
44
42
|
"@typescript-eslint/utils": "^5.48.1",
|
|
45
43
|
"ajv": "^6.12.6",
|
|
@@ -53,14 +51,14 @@
|
|
|
53
51
|
},
|
|
54
52
|
"devDependencies": {
|
|
55
53
|
"@af/formatting": "*",
|
|
56
|
-
"@atlaskit/ds-lib": "^
|
|
57
|
-
"@atlaskit/eslint-plugin-design-system": "^10.
|
|
54
|
+
"@atlaskit/ds-lib": "^3.1.0",
|
|
55
|
+
"@atlaskit/eslint-plugin-design-system": "^10.22.0",
|
|
58
56
|
"@atlassian/codegen": "*",
|
|
59
57
|
"@atlassian/ts-loader": "*",
|
|
60
58
|
"@compiled/eslint-plugin": "^0.13.6",
|
|
61
59
|
"@types/eslint": "^8.56.6",
|
|
62
60
|
"@types/estraverse": "^5.1.7",
|
|
63
|
-
"eslint": "^8.
|
|
61
|
+
"eslint": "^8.57.0",
|
|
64
62
|
"lodash": "^4.17.21",
|
|
65
63
|
"typescript": "~5.4.2"
|
|
66
64
|
},
|