@atlaskit/eslint-plugin-ui-styling-standard 2.1.1 → 2.1.3
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 +16 -0
- package/README.md +19 -18
- package/dist/cjs/presets/all-flat.codegen.js +3 -2
- package/dist/cjs/presets/all.codegen.js +3 -2
- package/dist/cjs/presets/recommended-flat.codegen.js +3 -2
- package/dist/cjs/presets/recommended.codegen.js +3 -2
- package/dist/cjs/rules/external-rules.js +11 -0
- package/dist/cjs/rules/no-nested-selectors/index.js +3 -5
- package/dist/cjs/rules/no-unsafe-selectors/index.js +2 -4
- package/dist/cjs/rules/utils/parse-selector.js +31 -0
- package/dist/es2019/presets/all-flat.codegen.js +3 -2
- package/dist/es2019/presets/all.codegen.js +3 -2
- package/dist/es2019/presets/recommended-flat.codegen.js +3 -2
- package/dist/es2019/presets/recommended.codegen.js +3 -2
- package/dist/es2019/rules/external-rules.js +11 -0
- package/dist/es2019/rules/no-nested-selectors/index.js +3 -3
- package/dist/es2019/rules/no-unsafe-selectors/index.js +2 -3
- package/dist/es2019/rules/utils/parse-selector.js +24 -0
- package/dist/esm/presets/all-flat.codegen.js +3 -2
- package/dist/esm/presets/all.codegen.js +3 -2
- package/dist/esm/presets/recommended-flat.codegen.js +3 -2
- package/dist/esm/presets/recommended.codegen.js +3 -2
- package/dist/esm/rules/external-rules.js +11 -0
- package/dist/esm/rules/no-nested-selectors/index.js +3 -3
- package/dist/esm/rules/no-unsafe-selectors/index.js +2 -3
- package/dist/esm/rules/utils/parse-selector.js +24 -0
- package/dist/types/presets/all-flat.codegen.d.ts +1 -1
- package/dist/types/presets/all.codegen.d.ts +1 -1
- package/dist/types/presets/recommended-flat.codegen.d.ts +1 -1
- package/dist/types/presets/recommended.codegen.d.ts +1 -1
- package/dist/types/rules/no-unsafe-selectors/constants.d.ts +1 -1
- package/dist/types/rules/utils/create-rule-with-typed-config.d.ts +1 -1
- package/dist/types/rules/utils/parse-selector.d.ts +10 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-ui-styling-standard
|
|
2
2
|
|
|
3
|
+
## 2.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`153f1b982bd5c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/153f1b982bd5c) -
|
|
8
|
+
Improve selector parsing and style-import resolution performance
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 2.1.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`00f3166426df4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/00f3166426df4) -
|
|
16
|
+
add eslint rule for cssMapScope and ratcheting rule
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 2.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -42,29 +42,30 @@ module.exports = {
|
|
|
42
42
|
|
|
43
43
|
| Rule | Description | Recommended | Fixable | Suggestions |
|
|
44
44
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------- | ------- | ----------- |
|
|
45
|
-
| <a href="./
|
|
46
|
-
| <a href="./
|
|
47
|
-
| <a href="./
|
|
48
|
-
| <a href="./
|
|
49
|
-
| <a href="./
|
|
50
|
-
| <a href="./
|
|
51
|
-
| <a href="./
|
|
52
|
-
| <a href="./
|
|
53
|
-
| <a href="./
|
|
54
|
-
| <a href="./
|
|
55
|
-
| <a href="./
|
|
56
|
-
| <a href="./
|
|
57
|
-
| <a href="./
|
|
58
|
-
| <a href="./
|
|
59
|
-
| <a href="./
|
|
60
|
-
| <a href="./
|
|
61
|
-
| <a href="./
|
|
62
|
-
| <a href="./
|
|
45
|
+
| <a href="./src/rules/atlaskit-theme/README.md">atlaskit-theme</a> | Ban certain usages of `@atlaskit/theme` that `@compiled/react` does not understand | Yes | | |
|
|
46
|
+
| <a href="./src/rules/convert-props-syntax/README.md">convert-props-syntax</a> | Convert props syntax that is unsupported by styled-components@<4 or @emotion/styled to props syntax that is supported. This is useful when used in conjunction with `no-styled-tagged-template-expression`, as output from the latter may use props syntax unsupported by those libraries. | Yes | Yes | |
|
|
47
|
+
| <a href="./src/rules/enforce-style-prop/README.md">enforce-style-prop</a> | Disallows usage of static styles in the `style` attribute in components | Yes | | |
|
|
48
|
+
| <a href="./src/rules/local-cx-xcss/README.md">local-cx-xcss</a> | Ensures the cx() function, which is part of the XCSS API, is only used within the xcss prop. This aids tracking what styles are applied to a jsx element. | Yes | | |
|
|
49
|
+
| <a href="./src/rules/no-array-arguments/README.md">no-array-arguments</a> | Prevents usage of array arguments to style declaration functions | Yes | Yes | |
|
|
50
|
+
| <a href="./src/rules/no-classname-prop/README.md">no-classname-prop</a> | Disallows usage of the `className` prop in JSX | Yes | | |
|
|
51
|
+
| <a href="./src/rules/no-container-queries/README.md">no-container-queries</a> | Prevents usage of @container query within css styling | Yes | | |
|
|
52
|
+
| <a href="./src/rules/no-dynamic-styles/README.md">no-dynamic-styles</a> | Disallows use of dynamic styles in CSS-in-JS calls | Yes | | |
|
|
53
|
+
| <a href="./src/rules/no-exported-styles/README.md">no-exported-styles</a> | Disallows exports of css, keyframes, styled and xcss | Yes | | |
|
|
54
|
+
| <a href="./src/rules/no-global-styles/README.md">no-global-styles</a> | Prevents global styles through CSS-in-JS or CSS module imports | Yes | | |
|
|
55
|
+
| <a href="./src/rules/no-important-styles/README.md">no-important-styles</a> | Disallows important style declarations | Yes | | |
|
|
56
|
+
| <a href="./src/rules/no-imported-style-values/README.md">no-imported-style-values</a> | Disallows imports of style values | Yes | | |
|
|
57
|
+
| <a href="./src/rules/no-nested-selectors/README.md">no-nested-selectors</a> | Prevents usage of nested selectors within css styling | Yes | | |
|
|
58
|
+
| <a href="./src/rules/no-styled/README.md">no-styled</a> | Disallows usage of the `styled` imports | Yes | | |
|
|
59
|
+
| <a href="./src/rules/no-unsafe-selectors/README.md">no-unsafe-selectors</a> | Disallows use of nested styles in `css` functions. | Yes | Yes | Yes |
|
|
60
|
+
| <a href="./src/rules/no-unsafe-values/README.md">no-unsafe-values</a> | Disallows styles that are difficult/impossible to statically anaylze. | Yes | | |
|
|
61
|
+
| <a href="./src/rules/no-unused-cssmap-properties/README.md">no-unused-cssmap-properties</a> | Detects unused properties in cssMap style objects that are not exported. Helps maintain clean code by identifying style variants that are defined but never used. | Yes | | |
|
|
62
|
+
| <a href="./src/rules/use-compiled/README.md">use-compiled</a> | Ensures usage of `@compiled/react` or `@atlaskit/css` instead of other CSS-in-JS libraries | Yes | Yes | |
|
|
63
63
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/consistent-css-prop-usage/usage">@atlaskit/design-system/consistent-css-prop-usage</a> | Ensures consistency with `css` and `xcss` prop usages | Yes | Yes | |
|
|
64
64
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-css-tagged-template-expression/usage">@atlaskit/design-system/no-css-tagged-template-expression</a> | Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled | Yes | Yes | |
|
|
65
65
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-keyframes-tagged-template-expression/usage">@atlaskit/design-system/no-keyframes-tagged-template-expression</a> | Disallows any `keyframe` tagged template expressions that originate from Emotion, Styled Components or Compiled | Yes | Yes | |
|
|
66
66
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-styled-tagged-template-expression/usage">@atlaskit/design-system/no-styled-tagged-template-expression</a> | Disallows any `styled` tagged template expressions that originate from Emotion, Styled Components or Compiled | Yes | Yes | |
|
|
67
67
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-empty-styled-expression/usage">@atlaskit/design-system/no-empty-styled-expression</a> | Forbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX elements). | Yes | | |
|
|
68
68
|
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-invalid-css-map/usage">@atlaskit/design-system/no-invalid-css-map</a> | Checks the validity of a CSS map created through cssMap. This is intended to be used alongside TypeScript's type-checking. | Yes | | |
|
|
69
|
+
| <a href="https://atlassian.design/components/eslint-plugin-ui-styling-standard/no-css-map-scoped/usage">@atlaskit/design-system/no-css-map-scoped</a> | Disallows usage of the experimental `cssMapScoped` API from `@compiled/react`. This API is internal and is not part of the public Compiled CSS-in-JS interface. | Yes | | |
|
|
69
70
|
|
|
70
71
|
<!-- END_RULE_TABLE_CODEGEN -->
|
|
@@ -9,7 +9,7 @@ var atlaskitDesignSystemPlugin = _interopRequireWildcard(require("@atlaskit/esli
|
|
|
9
9
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
10
|
/**
|
|
11
11
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
12
|
-
* @codegen <<SignedSource::
|
|
12
|
+
* @codegen <<SignedSource::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
13
13
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
14
14
|
*/
|
|
15
15
|
|
|
@@ -49,7 +49,8 @@ var config = {
|
|
|
49
49
|
}],
|
|
50
50
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
51
51
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
52
|
-
}]
|
|
52
|
+
}],
|
|
53
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
var _default = exports.default = config;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -43,7 +43,8 @@ var config = {
|
|
|
43
43
|
}],
|
|
44
44
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
45
45
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
46
|
-
}]
|
|
46
|
+
}],
|
|
47
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
var _default = exports.default = config;
|
|
@@ -9,7 +9,7 @@ var atlaskitDesignSystemPlugin = _interopRequireWildcard(require("@atlaskit/esli
|
|
|
9
9
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
10
|
/**
|
|
11
11
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
12
|
-
* @codegen <<SignedSource::
|
|
12
|
+
* @codegen <<SignedSource::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
13
13
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
14
14
|
*/
|
|
15
15
|
|
|
@@ -49,7 +49,8 @@ var config = {
|
|
|
49
49
|
}],
|
|
50
50
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
51
51
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
52
|
-
}]
|
|
52
|
+
}],
|
|
53
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
53
54
|
}
|
|
54
55
|
};
|
|
55
56
|
var _default = exports.default = config;
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
9
|
-
* @codegen <<SignedSource::
|
|
9
|
+
* @codegen <<SignedSource::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -43,7 +43,8 @@ var config = {
|
|
|
43
43
|
}],
|
|
44
44
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
45
45
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
46
|
-
}]
|
|
46
|
+
}],
|
|
47
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
var _default = exports.default = config;
|
|
@@ -94,4 +94,15 @@ var externalRules = exports.externalRules = [{
|
|
|
94
94
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
+
}, {
|
|
98
|
+
name: '@atlaskit/design-system/no-css-map-scoped',
|
|
99
|
+
displayName: 'no-css-map-scoped',
|
|
100
|
+
isExternal: true,
|
|
101
|
+
docs: {
|
|
102
|
+
description: 'Disallows usage of the experimental `cssMapScoped` API from `@compiled/react`. This API is internal and is not part of the public Compiled CSS-in-JS interface.',
|
|
103
|
+
url: (0, _getRuleUrl.getRuleUrl)('no-css-map-scoped'),
|
|
104
|
+
externalUrl: 'https://atlassian.design/components/eslint-plugin-design-system/no-css-map-scoped/usage',
|
|
105
|
+
recommended: true,
|
|
106
|
+
severity: 'error'
|
|
107
|
+
}
|
|
97
108
|
}];
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
8
|
var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
|
|
10
|
-
var _postcssSelectorParser =
|
|
9
|
+
var _postcssSelectorParser = require("postcss-selector-parser");
|
|
11
10
|
var _contextCompat = require("@atlaskit/eslint-utils/context-compat");
|
|
12
11
|
var _schema = require("@atlaskit/eslint-utils/schema");
|
|
13
12
|
var _walkStyleProperties = require("@atlaskit/eslint-utils/walk-style-properties");
|
|
14
13
|
var _createRuleWithTypedConfig = require("../utils/create-rule-with-typed-config");
|
|
15
|
-
|
|
14
|
+
var _parseSelector = require("../utils/parse-selector");
|
|
16
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; }
|
|
17
16
|
var getCssSelector = function getCssSelector(key) {
|
|
18
17
|
if (key.type === 'Literal' && typeof key.value === 'string') {
|
|
@@ -40,7 +39,6 @@ function isAllowedSelector(selector) {
|
|
|
40
39
|
var isTailAllowed = tail.every(_postcssSelectorParser.isPseudo);
|
|
41
40
|
return isHeadAllowed && isTailAllowed;
|
|
42
41
|
}
|
|
43
|
-
var cssSelectorProcessor = (0, _postcssSelectorParser.default)();
|
|
44
42
|
var rule = (0, _createRuleWithTypedConfig.createLintRuleWithTypedConfig)({
|
|
45
43
|
meta: {
|
|
46
44
|
name: 'no-nested-selectors',
|
|
@@ -83,7 +81,7 @@ var rule = (0, _createRuleWithTypedConfig.createLintRuleWithTypedConfig)({
|
|
|
83
81
|
return;
|
|
84
82
|
}
|
|
85
83
|
try {
|
|
86
|
-
var selectorList =
|
|
84
|
+
var selectorList = (0, _parseSelector.parseSelector)(context, selectorText);
|
|
87
85
|
if (!selectorList.nodes.every(isAllowedSelector)) {
|
|
88
86
|
context.report({
|
|
89
87
|
messageId: 'no-nested-selectors',
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.default = void 0;
|
|
8
|
-
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
|
9
7
|
var _contextCompat = require("@atlaskit/eslint-utils/context-compat");
|
|
10
8
|
var _isSupportedImport = require("@atlaskit/eslint-utils/is-supported-import");
|
|
11
9
|
var _schema = require("@atlaskit/eslint-utils/schema");
|
|
12
10
|
var _walkStyleProperties = require("@atlaskit/eslint-utils/walk-style-properties");
|
|
13
11
|
var _createRuleWithTypedConfig = require("../utils/create-rule-with-typed-config");
|
|
12
|
+
var _parseSelector = require("../utils/parse-selector");
|
|
14
13
|
var _lintSelector = require("./lint-selector");
|
|
15
14
|
var _walkCssMap = require("./walk-css-map");
|
|
16
15
|
var ignoredAtRules = new Set(['@container',
|
|
@@ -18,7 +17,6 @@ var ignoredAtRules = new Set(['@container',
|
|
|
18
17
|
'@media',
|
|
19
18
|
// ignored because it's covered by `no-nested-styles`
|
|
20
19
|
'@supports', '@property', '@starting-style']);
|
|
21
|
-
var cssSelectorProcessor = (0, _postcssSelectorParser.default)();
|
|
22
20
|
var rule = (0, _createRuleWithTypedConfig.createLintRuleWithTypedConfig)({
|
|
23
21
|
meta: {
|
|
24
22
|
name: 'no-unsafe-selectors',
|
|
@@ -131,7 +129,7 @@ var rule = (0, _createRuleWithTypedConfig.createLintRuleWithTypedConfig)({
|
|
|
131
129
|
return;
|
|
132
130
|
}
|
|
133
131
|
try {
|
|
134
|
-
var selectorList =
|
|
132
|
+
var selectorList = (0, _parseSelector.parseSelector)(context, selectorText);
|
|
135
133
|
selectorList.nodes.forEach(function (selector) {
|
|
136
134
|
return (0, _lintSelector.lintSelector)({
|
|
137
135
|
context: context,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.parseSelector = parseSelector;
|
|
8
|
+
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
|
9
|
+
var _contextCompat = require("@atlaskit/eslint-utils/context-compat");
|
|
10
|
+
var cssSelectorProcessor = (0, _postcssSelectorParser.default)();
|
|
11
|
+
var selectorCache = new WeakMap();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Parse each selector once per linted source file. Return a clone so selector traversal state is
|
|
15
|
+
* not shared between rules.
|
|
16
|
+
*/
|
|
17
|
+
function parseSelector(context, selectorText) {
|
|
18
|
+
var sourceCode = (0, _contextCompat.getSourceCode)(context);
|
|
19
|
+
var sourceFileCache = selectorCache.get(sourceCode);
|
|
20
|
+
if (!sourceFileCache) {
|
|
21
|
+
sourceFileCache = new Map();
|
|
22
|
+
selectorCache.set(sourceCode, sourceFileCache);
|
|
23
|
+
}
|
|
24
|
+
var cachedSelector = sourceFileCache.get(selectorText);
|
|
25
|
+
if (cachedSelector) {
|
|
26
|
+
return cachedSelector.clone();
|
|
27
|
+
}
|
|
28
|
+
var selector = cssSelectorProcessor.astSync(selectorText);
|
|
29
|
+
sourceFileCache.set(selectorText, selector);
|
|
30
|
+
return selector.clone();
|
|
31
|
+
}
|
|
@@ -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::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -41,7 +41,8 @@ const config = {
|
|
|
41
41
|
}],
|
|
42
42
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
43
43
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
44
|
-
}]
|
|
44
|
+
}],
|
|
45
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
export default config;
|
|
@@ -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::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -37,7 +37,8 @@ const config = {
|
|
|
37
37
|
}],
|
|
38
38
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
39
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}]
|
|
40
|
+
}],
|
|
41
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
export default config;
|
|
@@ -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::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -41,7 +41,8 @@ const config = {
|
|
|
41
41
|
}],
|
|
42
42
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
43
43
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
44
|
-
}]
|
|
44
|
+
}],
|
|
45
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
export default config;
|
|
@@ -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::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -37,7 +37,8 @@ const config = {
|
|
|
37
37
|
}],
|
|
38
38
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
39
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}]
|
|
40
|
+
}],
|
|
41
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
export default config;
|
|
@@ -89,4 +89,15 @@ export const externalRules = [{
|
|
|
89
89
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
}, {
|
|
93
|
+
name: '@atlaskit/design-system/no-css-map-scoped',
|
|
94
|
+
displayName: 'no-css-map-scoped',
|
|
95
|
+
isExternal: true,
|
|
96
|
+
docs: {
|
|
97
|
+
description: 'Disallows usage of the experimental `cssMapScoped` API from `@compiled/react`. This API is internal and is not part of the public Compiled CSS-in-JS interface.',
|
|
98
|
+
url: getRuleUrl('no-css-map-scoped'),
|
|
99
|
+
externalUrl: 'https://atlassian.design/components/eslint-plugin-design-system/no-css-map-scoped/usage',
|
|
100
|
+
recommended: true,
|
|
101
|
+
severity: 'error'
|
|
102
|
+
}
|
|
92
103
|
}];
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { isNesting, isPseudo } from 'postcss-selector-parser';
|
|
2
2
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
3
3
|
import { importSources } from '@atlaskit/eslint-utils/schema';
|
|
4
4
|
import { walkStyleProperties } from '@atlaskit/eslint-utils/walk-style-properties';
|
|
5
5
|
import { createLintRuleWithTypedConfig } from '../utils/create-rule-with-typed-config';
|
|
6
|
+
import { parseSelector } from '../utils/parse-selector';
|
|
6
7
|
const getCssSelector = key => {
|
|
7
8
|
if (key.type === 'Literal' && typeof key.value === 'string') {
|
|
8
9
|
return key.value;
|
|
@@ -25,7 +26,6 @@ function isAllowedSelector(selector) {
|
|
|
25
26
|
const isTailAllowed = tail.every(isPseudo);
|
|
26
27
|
return isHeadAllowed && isTailAllowed;
|
|
27
28
|
}
|
|
28
|
-
const cssSelectorProcessor = cssSelectorParser();
|
|
29
29
|
const rule = createLintRuleWithTypedConfig({
|
|
30
30
|
meta: {
|
|
31
31
|
name: 'no-nested-selectors',
|
|
@@ -71,7 +71,7 @@ const rule = createLintRuleWithTypedConfig({
|
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
73
|
try {
|
|
74
|
-
const selectorList =
|
|
74
|
+
const selectorList = parseSelector(context, selectorText);
|
|
75
75
|
if (!selectorList.nodes.every(isAllowedSelector)) {
|
|
76
76
|
context.report({
|
|
77
77
|
messageId: 'no-nested-selectors',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import cssSelectorParser from 'postcss-selector-parser';
|
|
2
1
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
3
2
|
import { isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
4
3
|
import { importSources } from '@atlaskit/eslint-utils/schema';
|
|
5
4
|
import { walkStyleProperties } from '@atlaskit/eslint-utils/walk-style-properties';
|
|
6
5
|
import { createLintRuleWithTypedConfig } from '../utils/create-rule-with-typed-config';
|
|
6
|
+
import { parseSelector } from '../utils/parse-selector';
|
|
7
7
|
import { lintSelector } from './lint-selector';
|
|
8
8
|
import { walkCssMap } from './walk-css-map';
|
|
9
9
|
const ignoredAtRules = new Set(['@container',
|
|
@@ -11,7 +11,6 @@ const ignoredAtRules = new Set(['@container',
|
|
|
11
11
|
'@media',
|
|
12
12
|
// ignored because it's covered by `no-nested-styles`
|
|
13
13
|
'@supports', '@property', '@starting-style']);
|
|
14
|
-
const cssSelectorProcessor = cssSelectorParser();
|
|
15
14
|
const rule = createLintRuleWithTypedConfig({
|
|
16
15
|
meta: {
|
|
17
16
|
name: 'no-unsafe-selectors',
|
|
@@ -128,7 +127,7 @@ const rule = createLintRuleWithTypedConfig({
|
|
|
128
127
|
return;
|
|
129
128
|
}
|
|
130
129
|
try {
|
|
131
|
-
const selectorList =
|
|
130
|
+
const selectorList = parseSelector(context, selectorText);
|
|
132
131
|
selectorList.nodes.forEach(selector => lintSelector({
|
|
133
132
|
context,
|
|
134
133
|
sourceNode: key,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import cssSelectorParser from 'postcss-selector-parser';
|
|
2
|
+
import { getSourceCode } from '@atlaskit/eslint-utils/context-compat';
|
|
3
|
+
const cssSelectorProcessor = cssSelectorParser();
|
|
4
|
+
const selectorCache = new WeakMap();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Parse each selector once per linted source file. Return a clone so selector traversal state is
|
|
8
|
+
* not shared between rules.
|
|
9
|
+
*/
|
|
10
|
+
export function parseSelector(context, selectorText) {
|
|
11
|
+
const sourceCode = getSourceCode(context);
|
|
12
|
+
let sourceFileCache = selectorCache.get(sourceCode);
|
|
13
|
+
if (!sourceFileCache) {
|
|
14
|
+
sourceFileCache = new Map();
|
|
15
|
+
selectorCache.set(sourceCode, sourceFileCache);
|
|
16
|
+
}
|
|
17
|
+
const cachedSelector = sourceFileCache.get(selectorText);
|
|
18
|
+
if (cachedSelector) {
|
|
19
|
+
return cachedSelector.clone();
|
|
20
|
+
}
|
|
21
|
+
const selector = cssSelectorProcessor.astSync(selectorText);
|
|
22
|
+
sourceFileCache.set(selectorText, selector);
|
|
23
|
+
return selector.clone();
|
|
24
|
+
}
|
|
@@ -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::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -41,7 +41,8 @@ var config = {
|
|
|
41
41
|
}],
|
|
42
42
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
43
43
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
44
|
-
}]
|
|
44
|
+
}],
|
|
45
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
export default config;
|
|
@@ -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::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -37,7 +37,8 @@ var config = {
|
|
|
37
37
|
}],
|
|
38
38
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
39
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}]
|
|
40
|
+
}],
|
|
41
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
export default config;
|
|
@@ -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::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -41,7 +41,8 @@ var config = {
|
|
|
41
41
|
}],
|
|
42
42
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
43
43
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
44
|
-
}]
|
|
44
|
+
}],
|
|
45
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
export default config;
|
|
@@ -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::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -37,7 +37,8 @@ var config = {
|
|
|
37
37
|
}],
|
|
38
38
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
39
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}]
|
|
40
|
+
}],
|
|
41
|
+
'@atlaskit/design-system/no-css-map-scoped': 'error'
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
export default config;
|
|
@@ -89,4 +89,15 @@ export var externalRules = [{
|
|
|
89
89
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
+
}, {
|
|
93
|
+
name: '@atlaskit/design-system/no-css-map-scoped',
|
|
94
|
+
displayName: 'no-css-map-scoped',
|
|
95
|
+
isExternal: true,
|
|
96
|
+
docs: {
|
|
97
|
+
description: 'Disallows usage of the experimental `cssMapScoped` API from `@compiled/react`. This API is internal and is not part of the public Compiled CSS-in-JS interface.',
|
|
98
|
+
url: getRuleUrl('no-css-map-scoped'),
|
|
99
|
+
externalUrl: 'https://atlassian.design/components/eslint-plugin-design-system/no-css-map-scoped/usage',
|
|
100
|
+
recommended: true,
|
|
101
|
+
severity: 'error'
|
|
102
|
+
}
|
|
92
103
|
}];
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _toArray from "@babel/runtime/helpers/toArray";
|
|
2
2
|
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; }
|
|
3
|
-
import
|
|
3
|
+
import { isNesting, isPseudo } from 'postcss-selector-parser';
|
|
4
4
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
5
5
|
import { importSources } from '@atlaskit/eslint-utils/schema';
|
|
6
6
|
import { walkStyleProperties } from '@atlaskit/eslint-utils/walk-style-properties';
|
|
7
7
|
import { createLintRuleWithTypedConfig } from '../utils/create-rule-with-typed-config';
|
|
8
|
+
import { parseSelector } from '../utils/parse-selector';
|
|
8
9
|
var getCssSelector = function getCssSelector(key) {
|
|
9
10
|
if (key.type === 'Literal' && typeof key.value === 'string') {
|
|
10
11
|
return key.value;
|
|
@@ -31,7 +32,6 @@ function isAllowedSelector(selector) {
|
|
|
31
32
|
var isTailAllowed = tail.every(isPseudo);
|
|
32
33
|
return isHeadAllowed && isTailAllowed;
|
|
33
34
|
}
|
|
34
|
-
var cssSelectorProcessor = cssSelectorParser();
|
|
35
35
|
var rule = createLintRuleWithTypedConfig({
|
|
36
36
|
meta: {
|
|
37
37
|
name: 'no-nested-selectors',
|
|
@@ -74,7 +74,7 @@ var rule = createLintRuleWithTypedConfig({
|
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
76
|
try {
|
|
77
|
-
var selectorList =
|
|
77
|
+
var selectorList = parseSelector(context, selectorText);
|
|
78
78
|
if (!selectorList.nodes.every(isAllowedSelector)) {
|
|
79
79
|
context.report({
|
|
80
80
|
messageId: 'no-nested-selectors',
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import cssSelectorParser from 'postcss-selector-parser';
|
|
2
1
|
import { getScope } from '@atlaskit/eslint-utils/context-compat';
|
|
3
2
|
import { isXcss } from '@atlaskit/eslint-utils/is-supported-import';
|
|
4
3
|
import { importSources } from '@atlaskit/eslint-utils/schema';
|
|
5
4
|
import { walkStyleProperties } from '@atlaskit/eslint-utils/walk-style-properties';
|
|
6
5
|
import { createLintRuleWithTypedConfig } from '../utils/create-rule-with-typed-config';
|
|
6
|
+
import { parseSelector } from '../utils/parse-selector';
|
|
7
7
|
import { lintSelector } from './lint-selector';
|
|
8
8
|
import { walkCssMap } from './walk-css-map';
|
|
9
9
|
var ignoredAtRules = new Set(['@container',
|
|
@@ -11,7 +11,6 @@ var ignoredAtRules = new Set(['@container',
|
|
|
11
11
|
'@media',
|
|
12
12
|
// ignored because it's covered by `no-nested-styles`
|
|
13
13
|
'@supports', '@property', '@starting-style']);
|
|
14
|
-
var cssSelectorProcessor = cssSelectorParser();
|
|
15
14
|
var rule = createLintRuleWithTypedConfig({
|
|
16
15
|
meta: {
|
|
17
16
|
name: 'no-unsafe-selectors',
|
|
@@ -124,7 +123,7 @@ var rule = createLintRuleWithTypedConfig({
|
|
|
124
123
|
return;
|
|
125
124
|
}
|
|
126
125
|
try {
|
|
127
|
-
var selectorList =
|
|
126
|
+
var selectorList = parseSelector(context, selectorText);
|
|
128
127
|
selectorList.nodes.forEach(function (selector) {
|
|
129
128
|
return lintSelector({
|
|
130
129
|
context: context,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import cssSelectorParser from 'postcss-selector-parser';
|
|
2
|
+
import { getSourceCode } from '@atlaskit/eslint-utils/context-compat';
|
|
3
|
+
var cssSelectorProcessor = cssSelectorParser();
|
|
4
|
+
var selectorCache = new WeakMap();
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Parse each selector once per linted source file. Return a clone so selector traversal state is
|
|
8
|
+
* not shared between rules.
|
|
9
|
+
*/
|
|
10
|
+
export function parseSelector(context, selectorText) {
|
|
11
|
+
var sourceCode = getSourceCode(context);
|
|
12
|
+
var sourceFileCache = selectorCache.get(sourceCode);
|
|
13
|
+
if (!sourceFileCache) {
|
|
14
|
+
sourceFileCache = new Map();
|
|
15
|
+
selectorCache.set(sourceCode, sourceFileCache);
|
|
16
|
+
}
|
|
17
|
+
var cachedSelector = sourceFileCache.get(selectorText);
|
|
18
|
+
if (cachedSelector) {
|
|
19
|
+
return cachedSelector.clone();
|
|
20
|
+
}
|
|
21
|
+
var selector = cssSelectorProcessor.astSync(selectorText);
|
|
22
|
+
sourceFileCache.set(selectorText, selector);
|
|
23
|
+
return selector.clone();
|
|
24
|
+
}
|
|
@@ -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::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Linter } from 'eslint';
|
|
@@ -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::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -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::8a252381063c65bbbd7bd21e6a7f99a7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Linter } from 'eslint';
|
|
@@ -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::7d9130538f9fe4e88eebb9a6eb22e553>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -13,6 +13,6 @@ 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 [
|
|
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', '&:popover-open', '&: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', '&:active:visited', '&:focus:not(:focus-visible)', '&:focus::after', '&:focus::before', '&:focus-visible::after', '&:focus-visible::before', '&:focus-within::after', '&:focus-within::before', '&:hover::after', '&:hover::before', '&:visited:active', '&:visited:hover', '&:visited:focus', '&:visited:focus-visible', '&:visited:focus-within'];
|
|
17
17
|
export declare const allowedPseudos: Set<string>;
|
|
18
18
|
export {};
|
|
@@ -14,5 +14,5 @@ export interface LintRuleMeta<Schema extends JSONSchema> extends Omit<BaseLintRu
|
|
|
14
14
|
schema: Schema;
|
|
15
15
|
}
|
|
16
16
|
export declare const createLintRuleWithTypedConfig: <Schema extends JSONSchema & {
|
|
17
|
-
type:
|
|
17
|
+
type: 'object';
|
|
18
18
|
}, Config = FromSchema<Schema>>(rule: LintRule<Schema, Config>) => Rule.RuleModule;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import cssSelectorParser from 'postcss-selector-parser';
|
|
3
|
+
declare const cssSelectorProcessor: ReturnType<typeof cssSelectorParser>;
|
|
4
|
+
type ParsedSelector = ReturnType<typeof cssSelectorProcessor.astSync>;
|
|
5
|
+
/**
|
|
6
|
+
* Parse each selector once per linted source file. Return a clone so selector traversal state is
|
|
7
|
+
* not shared between rules.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseSelector(context: Rule.RuleContext, selectorText: string): ParsedSelector;
|
|
10
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-ui-styling-standard",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
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",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"atlaskit:src": "src/index.tsx",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/eslint-plugin-design-system": "^16.
|
|
32
|
-
"@atlaskit/eslint-utils": "^3.
|
|
31
|
+
"@atlaskit/eslint-plugin-design-system": "^16.11.0",
|
|
32
|
+
"@atlaskit/eslint-utils": "^3.1.0",
|
|
33
33
|
"@babel/runtime": "^7.0.0",
|
|
34
34
|
"@typescript-eslint/utils": "^7.1.0",
|
|
35
35
|
"ajv": "^6.12.6",
|