@atlaskit/eslint-plugin-ui-styling-standard 0.18.4 → 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 +19 -0
- package/README.md +0 -2
- package/dist/cjs/presets/all.codegen.js +1 -7
- package/dist/cjs/presets/recommended.codegen.js +1 -7
- package/dist/cjs/rules/convert-props-syntax/index.js +5 -13
- package/dist/cjs/rules/external-rules.js +3 -29
- 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/presets/all.codegen.js +1 -7
- package/dist/es2019/presets/recommended.codegen.js +1 -7
- package/dist/es2019/rules/external-rules.js +3 -29
- package/dist/es2019/rules/no-unsafe-selectors/constants.js +1 -1
- package/dist/esm/presets/all.codegen.js +1 -7
- package/dist/esm/presets/recommended.codegen.js +1 -7
- package/dist/esm/rules/convert-props-syntax/index.js +5 -13
- package/dist/esm/rules/external-rules.js +3 -29
- 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/index.codegen.d.ts +0 -12
- package/dist/types/presets/all.codegen.d.ts +1 -7
- package/dist/types/presets/recommended.codegen.d.ts +1 -7
- package/dist/types/rules/external-rules.d.ts +3 -1
- package/dist/types/rules/no-unsafe-selectors/constants.d.ts +1 -1
- package/dist/types-ts4.5/index.codegen.d.ts +0 -12
- package/dist/types-ts4.5/presets/all.codegen.d.ts +1 -7
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +1 -7
- package/dist/types-ts4.5/rules/external-rules.d.ts +3 -1
- package/dist/types-ts4.5/rules/no-unsafe-selectors/constants.d.ts +2 -1
- package/package.json +7 -9
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::330ecd53e03bf78708580ddcfb206876>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
@@ -35,12 +35,6 @@ export default {
|
|
|
35
35
|
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
36
36
|
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
37
37
|
}],
|
|
38
|
-
'@atlaskit/design-system/no-exported-css': ['error', {
|
|
39
|
-
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
40
|
-
}],
|
|
41
|
-
'@atlaskit/design-system/no-exported-keyframes': ['error', {
|
|
42
|
-
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
43
|
-
}],
|
|
44
38
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
45
39
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
46
40
|
}]
|
|
@@ -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,8 @@
|
|
|
1
1
|
import { getRuleUrl } from './utils/create-rule';
|
|
2
2
|
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* External rules must be scoped, have a display name, and external urls.
|
|
5
|
+
*/
|
|
4
6
|
|
|
5
7
|
var importSources = ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components'];
|
|
6
8
|
export var externalRules = [{
|
|
@@ -95,34 +97,6 @@ export var externalRules = [{
|
|
|
95
97
|
importSources: importSources
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
}, {
|
|
99
|
-
name: '@atlaskit/design-system/no-exported-css',
|
|
100
|
-
displayName: 'no-exported-css',
|
|
101
|
-
isExternal: true,
|
|
102
|
-
docs: {
|
|
103
|
-
description: 'Forbid exporting `css` function calls. Exporting `css` function calls can result in unexpected behaviour at runtime, and is not statically analysable.',
|
|
104
|
-
url: getRuleUrl('no-exported-css'),
|
|
105
|
-
externalUrl: 'https://atlassian.design/components/eslint-plugin-design-system/no-exported-css/usage',
|
|
106
|
-
recommended: true,
|
|
107
|
-
severity: 'error',
|
|
108
|
-
pluginConfig: {
|
|
109
|
-
importSources: importSources
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}, {
|
|
113
|
-
name: '@atlaskit/design-system/no-exported-keyframes',
|
|
114
|
-
displayName: 'no-exported-keyframes',
|
|
115
|
-
isExternal: true,
|
|
116
|
-
docs: {
|
|
117
|
-
description: 'Forbid exporting `keyframes` function calls. Exporting `css` function calls can result in unexpected behaviour at runtime, and is not statically analysable.',
|
|
118
|
-
url: getRuleUrl('no-exported-keyframes'),
|
|
119
|
-
externalUrl: 'https://atlassian.design/components/eslint-plugin-design-system/no-exported-keyframes/usage',
|
|
120
|
-
recommended: true,
|
|
121
|
-
severity: 'error',
|
|
122
|
-
pluginConfig: {
|
|
123
|
-
importSources: importSources
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
100
|
}, {
|
|
127
101
|
name: '@atlaskit/design-system/no-invalid-css-map',
|
|
128
102
|
displayName: 'no-invalid-css-map',
|
|
@@ -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
|
});
|
|
@@ -32,12 +32,6 @@ export declare const configs: {
|
|
|
32
32
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
33
33
|
importSources: string[];
|
|
34
34
|
})[];
|
|
35
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
36
|
-
importSources: string[];
|
|
37
|
-
})[];
|
|
38
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
39
|
-
importSources: string[];
|
|
40
|
-
})[];
|
|
41
35
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
42
36
|
allowedFunctionCalls: string[][];
|
|
43
37
|
})[];
|
|
@@ -75,12 +69,6 @@ export declare const configs: {
|
|
|
75
69
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
76
70
|
importSources: string[];
|
|
77
71
|
})[];
|
|
78
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
79
|
-
importSources: string[];
|
|
80
|
-
})[];
|
|
81
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
82
|
-
importSources: string[];
|
|
83
|
-
})[];
|
|
84
72
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
85
73
|
allowedFunctionCalls: string[][];
|
|
86
74
|
})[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::330ecd53e03bf78708580ddcfb206876>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -35,12 +35,6 @@ declare const _default: {
|
|
|
35
35
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
36
36
|
importSources: string[];
|
|
37
37
|
})[];
|
|
38
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
39
|
-
importSources: string[];
|
|
40
|
-
})[];
|
|
41
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
42
|
-
importSources: string[];
|
|
43
|
-
})[];
|
|
44
38
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
45
39
|
allowedFunctionCalls: string[][];
|
|
46
40
|
})[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::330ecd53e03bf78708580ddcfb206876>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -35,12 +35,6 @@ declare const _default: {
|
|
|
35
35
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
36
36
|
importSources: string[];
|
|
37
37
|
})[];
|
|
38
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
39
|
-
importSources: string[];
|
|
40
|
-
})[];
|
|
41
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
42
|
-
importSources: string[];
|
|
43
|
-
})[];
|
|
44
38
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
45
39
|
allowedFunctionCalls: string[][];
|
|
46
40
|
})[];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { LintRuleMeta } from '@atlaskit/eslint-utils/create-rule';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* External rules must be scoped, have a display name, and external urls.
|
|
4
|
+
*/
|
|
3
5
|
export type ExternalRuleMeta = LintRuleMeta & {
|
|
4
6
|
isExternal: true;
|
|
5
7
|
name: `@${string}/${string}`;
|
|
@@ -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>;
|
|
@@ -32,12 +32,6 @@ export declare const configs: {
|
|
|
32
32
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
33
33
|
importSources: string[];
|
|
34
34
|
})[];
|
|
35
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
36
|
-
importSources: string[];
|
|
37
|
-
})[];
|
|
38
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
39
|
-
importSources: string[];
|
|
40
|
-
})[];
|
|
41
35
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
42
36
|
allowedFunctionCalls: string[][];
|
|
43
37
|
})[];
|
|
@@ -75,12 +69,6 @@ export declare const configs: {
|
|
|
75
69
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
76
70
|
importSources: string[];
|
|
77
71
|
})[];
|
|
78
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
79
|
-
importSources: string[];
|
|
80
|
-
})[];
|
|
81
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
82
|
-
importSources: string[];
|
|
83
|
-
})[];
|
|
84
72
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
85
73
|
allowedFunctionCalls: string[][];
|
|
86
74
|
})[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::330ecd53e03bf78708580ddcfb206876>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -35,12 +35,6 @@ declare const _default: {
|
|
|
35
35
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
36
36
|
importSources: string[];
|
|
37
37
|
})[];
|
|
38
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
39
|
-
importSources: string[];
|
|
40
|
-
})[];
|
|
41
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
42
|
-
importSources: string[];
|
|
43
|
-
})[];
|
|
44
38
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
45
39
|
allowedFunctionCalls: string[][];
|
|
46
40
|
})[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::330ecd53e03bf78708580ddcfb206876>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
declare const _default: {
|
|
@@ -35,12 +35,6 @@ declare const _default: {
|
|
|
35
35
|
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
36
36
|
importSources: string[];
|
|
37
37
|
})[];
|
|
38
|
-
'@atlaskit/design-system/no-exported-css': (string | {
|
|
39
|
-
importSources: string[];
|
|
40
|
-
})[];
|
|
41
|
-
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
42
|
-
importSources: string[];
|
|
43
|
-
})[];
|
|
44
38
|
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
45
39
|
allowedFunctionCalls: string[][];
|
|
46
40
|
})[];
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { LintRuleMeta } from '@atlaskit/eslint-utils/create-rule';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* External rules must be scoped, have a display name, and external urls.
|
|
4
|
+
*/
|
|
3
5
|
export type ExternalRuleMeta = LintRuleMeta & {
|
|
4
6
|
isExternal: true;
|
|
5
7
|
name: `@${string}/${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.
|
|
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
|
},
|