@atlaskit/eslint-plugin-ui-styling-standard 1.5.0 → 1.5.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 +7 -0
- package/dist/cjs/rules/no-unsafe-selectors/constants.js +49 -2
- package/dist/cjs/rules/no-unsafe-selectors/walk-css-map.js +10 -5
- package/dist/es2019/rules/no-unsafe-selectors/constants.js +48 -1
- package/dist/es2019/rules/no-unsafe-selectors/walk-css-map.js +10 -5
- package/dist/esm/rules/no-unsafe-selectors/constants.js +48 -1
- package/dist/esm/rules/no-unsafe-selectors/walk-css-map.js +10 -5
- package/dist/types/rules/no-array-arguments/index.d.ts +1 -1
- package/dist/types/rules/no-classname-prop/index.d.ts +1 -1
- package/dist/types/rules/no-container-queries/index.d.ts +1 -1
- package/dist/types/rules/no-dynamic-styles/index.d.ts +1 -1
- package/dist/types/rules/no-exported-styles/index.d.ts +1 -1
- package/dist/types/rules/no-global-styles/index.d.ts +1 -1
- package/dist/types/rules/no-important-styles/index.d.ts +1 -1
- package/dist/types/rules/no-nested-selectors/index.d.ts +1 -1
- package/dist/types/rules/no-styled/index.d.ts +1 -1
- package/dist/types/rules/no-unsafe-selectors/constants.d.ts +45 -0
- package/dist/types/rules/no-unsafe-values/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-array-arguments/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-classname-prop/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-container-queries/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-dynamic-styles/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-exported-styles/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-global-styles/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-important-styles/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-nested-selectors/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-styled/index.d.ts +1 -1
- package/dist/types-ts4.5/rules/no-unsafe-selectors/constants.d.ts +45 -0
- package/dist/types-ts4.5/rules/no-unsafe-values/index.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-ui-styling-standard
|
|
2
2
|
|
|
3
|
+
## 1.5.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`ceba2f0da51d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ceba2f0da51d4) -
|
|
8
|
+
Add @starting-style to ESLint ignoredAtRules to allow usage without eslint-disable comments
|
|
9
|
+
|
|
3
10
|
## 1.5.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.legacyPseudoElements = exports.ignoredAtRules = exports.allowedPseudos = void 0;
|
|
6
|
+
exports.legacyPseudoElements = exports.ignoredAtRules = exports.allowedPseudos = exports.allowedGroupedAtRules = void 0;
|
|
7
7
|
/**
|
|
8
8
|
* Validation approach from
|
|
9
9
|
* https://stackoverflow.com/a/71236280
|
|
@@ -27,4 +27,51 @@ var ignoredAtRules = exports.ignoredAtRules = new Set(['@container',
|
|
|
27
27
|
// ignored because it's covered by `no-container-queries`
|
|
28
28
|
'@media',
|
|
29
29
|
// ignored because it's covered by `no-nested-styles`
|
|
30
|
-
'@supports', '@property']);
|
|
30
|
+
'@supports', '@property', '@starting-style']);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* At-rules that are allowed to be used in "grouped" form within cssMap.
|
|
34
|
+
*
|
|
35
|
+
* "Grouped" refers to the legacy Compiled syntax where an at-rule key with no parameters
|
|
36
|
+
* (matching `/^@[A-z-]+$/`) contains nested variant keys, like:
|
|
37
|
+
*
|
|
38
|
+
* ```typescript
|
|
39
|
+
* // ❌ GROUPED (not allowed for @media):
|
|
40
|
+
* cssMap({
|
|
41
|
+
* variant: {
|
|
42
|
+
* '@media': { // at-rule key with no parameters
|
|
43
|
+
* '(min-width: 900px)': {}, // nested variants
|
|
44
|
+
* '(min-width: 1200px)': {},
|
|
45
|
+
* }
|
|
46
|
+
* }
|
|
47
|
+
* })
|
|
48
|
+
*
|
|
49
|
+
* // ✅ FLAT (preferred for @media):
|
|
50
|
+
* cssMap({
|
|
51
|
+
* variant: {
|
|
52
|
+
* '@media (min-width: 900px)': {}, // at-rule with parameters
|
|
53
|
+
* '@media (min-width: 1200px)': {},
|
|
54
|
+
* }
|
|
55
|
+
* })
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* However, some at-rules like `@starting-style` have no parameters and can only be
|
|
59
|
+
* written in the "grouped" form at the variant level:
|
|
60
|
+
*
|
|
61
|
+
* ```typescript
|
|
62
|
+
* // ✅ ALLOWED (only valid syntax for @starting-style):
|
|
63
|
+
* cssMap({
|
|
64
|
+
* fade: {
|
|
65
|
+
* '@starting-style': { // at-rule with no parameters
|
|
66
|
+
* opacity: 0, // styles to apply
|
|
67
|
+
* }
|
|
68
|
+
* }
|
|
69
|
+
* })
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* Note: This only applies to at-rules at the variant level. Nested at-rules inside
|
|
73
|
+
* other rulesets (e.g., `@starting-style` inside `@media (...)`) are handled by
|
|
74
|
+
* `walkStyleRuleset` and are not considered "grouped".
|
|
75
|
+
*/
|
|
76
|
+
var allowedGroupedAtRules = exports.allowedGroupedAtRules = new Set(['@starting-style' // Has no parameters, can only be written in grouped form
|
|
77
|
+
]);
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.walkCssMap = walkCssMap;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _contextCompat = require("@atlaskit/eslint-utils/context-compat");
|
|
10
|
+
var _constants = require("./constants");
|
|
10
11
|
/**
|
|
11
12
|
* This util is intentionally not in `@atlaskit/eslint-utils` at this time.
|
|
12
13
|
*
|
|
@@ -110,11 +111,15 @@ function walkCssMapAtRuleGrouping(_ref4) {
|
|
|
110
111
|
if (!atRule) {
|
|
111
112
|
return;
|
|
112
113
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
|
|
115
|
+
// Skip reporting if the at-rule is allowed to be grouped
|
|
116
|
+
if (!_constants.allowedGroupedAtRules.has(atRule)) {
|
|
117
|
+
visitor({
|
|
118
|
+
type: 'grouped-at-rules',
|
|
119
|
+
node: atRuleGrouping,
|
|
120
|
+
atRule: atRule
|
|
121
|
+
});
|
|
122
|
+
}
|
|
118
123
|
if (atRuleGrouping.value.type !== 'ObjectExpression') {
|
|
119
124
|
return;
|
|
120
125
|
}
|
|
@@ -19,4 +19,51 @@ export const ignoredAtRules = new Set(['@container',
|
|
|
19
19
|
// ignored because it's covered by `no-container-queries`
|
|
20
20
|
'@media',
|
|
21
21
|
// ignored because it's covered by `no-nested-styles`
|
|
22
|
-
'@supports', '@property']);
|
|
22
|
+
'@supports', '@property', '@starting-style']);
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* At-rules that are allowed to be used in "grouped" form within cssMap.
|
|
26
|
+
*
|
|
27
|
+
* "Grouped" refers to the legacy Compiled syntax where an at-rule key with no parameters
|
|
28
|
+
* (matching `/^@[A-z-]+$/`) contains nested variant keys, like:
|
|
29
|
+
*
|
|
30
|
+
* ```typescript
|
|
31
|
+
* // ❌ GROUPED (not allowed for @media):
|
|
32
|
+
* cssMap({
|
|
33
|
+
* variant: {
|
|
34
|
+
* '@media': { // at-rule key with no parameters
|
|
35
|
+
* '(min-width: 900px)': {}, // nested variants
|
|
36
|
+
* '(min-width: 1200px)': {},
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* })
|
|
40
|
+
*
|
|
41
|
+
* // ✅ FLAT (preferred for @media):
|
|
42
|
+
* cssMap({
|
|
43
|
+
* variant: {
|
|
44
|
+
* '@media (min-width: 900px)': {}, // at-rule with parameters
|
|
45
|
+
* '@media (min-width: 1200px)': {},
|
|
46
|
+
* }
|
|
47
|
+
* })
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* However, some at-rules like `@starting-style` have no parameters and can only be
|
|
51
|
+
* written in the "grouped" form at the variant level:
|
|
52
|
+
*
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // ✅ ALLOWED (only valid syntax for @starting-style):
|
|
55
|
+
* cssMap({
|
|
56
|
+
* fade: {
|
|
57
|
+
* '@starting-style': { // at-rule with no parameters
|
|
58
|
+
* opacity: 0, // styles to apply
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* Note: This only applies to at-rules at the variant level. Nested at-rules inside
|
|
65
|
+
* other rulesets (e.g., `@starting-style` inside `@media (...)`) are handled by
|
|
66
|
+
* `walkStyleRuleset` and are not considered "grouped".
|
|
67
|
+
*/
|
|
68
|
+
export const allowedGroupedAtRules = new Set(['@starting-style' // Has no parameters, can only be written in grouped form
|
|
69
|
+
]);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { getSourceCode } from '@atlaskit/eslint-utils/context-compat';
|
|
8
|
+
import { allowedGroupedAtRules } from './constants';
|
|
8
9
|
export function walkCssMap({
|
|
9
10
|
context,
|
|
10
11
|
importSources,
|
|
@@ -102,11 +103,15 @@ function walkCssMapAtRuleGrouping({
|
|
|
102
103
|
if (!atRule) {
|
|
103
104
|
return;
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
|
|
107
|
+
// Skip reporting if the at-rule is allowed to be grouped
|
|
108
|
+
if (!allowedGroupedAtRules.has(atRule)) {
|
|
109
|
+
visitor({
|
|
110
|
+
type: 'grouped-at-rules',
|
|
111
|
+
node: atRuleGrouping,
|
|
112
|
+
atRule
|
|
113
|
+
});
|
|
114
|
+
}
|
|
110
115
|
if (atRuleGrouping.value.type !== 'ObjectExpression') {
|
|
111
116
|
return;
|
|
112
117
|
}
|
|
@@ -21,4 +21,51 @@ export var ignoredAtRules = new Set(['@container',
|
|
|
21
21
|
// ignored because it's covered by `no-container-queries`
|
|
22
22
|
'@media',
|
|
23
23
|
// ignored because it's covered by `no-nested-styles`
|
|
24
|
-
'@supports', '@property']);
|
|
24
|
+
'@supports', '@property', '@starting-style']);
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* At-rules that are allowed to be used in "grouped" form within cssMap.
|
|
28
|
+
*
|
|
29
|
+
* "Grouped" refers to the legacy Compiled syntax where an at-rule key with no parameters
|
|
30
|
+
* (matching `/^@[A-z-]+$/`) contains nested variant keys, like:
|
|
31
|
+
*
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // ❌ GROUPED (not allowed for @media):
|
|
34
|
+
* cssMap({
|
|
35
|
+
* variant: {
|
|
36
|
+
* '@media': { // at-rule key with no parameters
|
|
37
|
+
* '(min-width: 900px)': {}, // nested variants
|
|
38
|
+
* '(min-width: 1200px)': {},
|
|
39
|
+
* }
|
|
40
|
+
* }
|
|
41
|
+
* })
|
|
42
|
+
*
|
|
43
|
+
* // ✅ FLAT (preferred for @media):
|
|
44
|
+
* cssMap({
|
|
45
|
+
* variant: {
|
|
46
|
+
* '@media (min-width: 900px)': {}, // at-rule with parameters
|
|
47
|
+
* '@media (min-width: 1200px)': {},
|
|
48
|
+
* }
|
|
49
|
+
* })
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* However, some at-rules like `@starting-style` have no parameters and can only be
|
|
53
|
+
* written in the "grouped" form at the variant level:
|
|
54
|
+
*
|
|
55
|
+
* ```typescript
|
|
56
|
+
* // ✅ ALLOWED (only valid syntax for @starting-style):
|
|
57
|
+
* cssMap({
|
|
58
|
+
* fade: {
|
|
59
|
+
* '@starting-style': { // at-rule with no parameters
|
|
60
|
+
* opacity: 0, // styles to apply
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* })
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* Note: This only applies to at-rules at the variant level. Nested at-rules inside
|
|
67
|
+
* other rulesets (e.g., `@starting-style` inside `@media (...)`) are handled by
|
|
68
|
+
* `walkStyleRuleset` and are not considered "grouped".
|
|
69
|
+
*/
|
|
70
|
+
export var allowedGroupedAtRules = new Set(['@starting-style' // Has no parameters, can only be written in grouped form
|
|
71
|
+
]);
|
|
@@ -6,6 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { getSourceCode } from '@atlaskit/eslint-utils/context-compat';
|
|
9
|
+
import { allowedGroupedAtRules } from './constants';
|
|
9
10
|
export function walkCssMap(_ref) {
|
|
10
11
|
var context = _ref.context,
|
|
11
12
|
importSources = _ref.importSources,
|
|
@@ -103,11 +104,15 @@ function walkCssMapAtRuleGrouping(_ref4) {
|
|
|
103
104
|
if (!atRule) {
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
107
|
+
|
|
108
|
+
// Skip reporting if the at-rule is allowed to be grouped
|
|
109
|
+
if (!allowedGroupedAtRules.has(atRule)) {
|
|
110
|
+
visitor({
|
|
111
|
+
type: 'grouped-at-rules',
|
|
112
|
+
node: atRuleGrouping,
|
|
113
|
+
atRule: atRule
|
|
114
|
+
});
|
|
115
|
+
}
|
|
111
116
|
if (atRuleGrouping.value.type !== 'ObjectExpression') {
|
|
112
117
|
return;
|
|
113
118
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -17,4 +17,49 @@ declare const cssPseudos: readonly ["&:active", "&:autofill", "&:blank", "&:chec
|
|
|
17
17
|
export declare const allowedPseudos: Set<string>;
|
|
18
18
|
export declare const legacyPseudoElements: Set<string>;
|
|
19
19
|
export declare const ignoredAtRules: Set<string>;
|
|
20
|
+
/**
|
|
21
|
+
* At-rules that are allowed to be used in "grouped" form within cssMap.
|
|
22
|
+
*
|
|
23
|
+
* "Grouped" refers to the legacy Compiled syntax where an at-rule key with no parameters
|
|
24
|
+
* (matching `/^@[A-z-]+$/`) contains nested variant keys, like:
|
|
25
|
+
*
|
|
26
|
+
* ```typescript
|
|
27
|
+
* // ❌ GROUPED (not allowed for @media):
|
|
28
|
+
* cssMap({
|
|
29
|
+
* variant: {
|
|
30
|
+
* '@media': { // at-rule key with no parameters
|
|
31
|
+
* '(min-width: 900px)': {}, // nested variants
|
|
32
|
+
* '(min-width: 1200px)': {},
|
|
33
|
+
* }
|
|
34
|
+
* }
|
|
35
|
+
* })
|
|
36
|
+
*
|
|
37
|
+
* // ✅ FLAT (preferred for @media):
|
|
38
|
+
* cssMap({
|
|
39
|
+
* variant: {
|
|
40
|
+
* '@media (min-width: 900px)': {}, // at-rule with parameters
|
|
41
|
+
* '@media (min-width: 1200px)': {},
|
|
42
|
+
* }
|
|
43
|
+
* })
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* However, some at-rules like `@starting-style` have no parameters and can only be
|
|
47
|
+
* written in the "grouped" form at the variant level:
|
|
48
|
+
*
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // ✅ ALLOWED (only valid syntax for @starting-style):
|
|
51
|
+
* cssMap({
|
|
52
|
+
* fade: {
|
|
53
|
+
* '@starting-style': { // at-rule with no parameters
|
|
54
|
+
* opacity: 0, // styles to apply
|
|
55
|
+
* }
|
|
56
|
+
* }
|
|
57
|
+
* })
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* Note: This only applies to at-rules at the variant level. Nested at-rules inside
|
|
61
|
+
* other rulesets (e.g., `@starting-style` inside `@media (...)`) are handled by
|
|
62
|
+
* `walkStyleRuleset` and are not considered "grouped".
|
|
63
|
+
*/
|
|
64
|
+
export declare const allowedGroupedAtRules: Set<string>;
|
|
20
65
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
|
@@ -82,4 +82,49 @@ declare const cssPseudos: readonly [
|
|
|
82
82
|
export declare const allowedPseudos: Set<string>;
|
|
83
83
|
export declare const legacyPseudoElements: Set<string>;
|
|
84
84
|
export declare const ignoredAtRules: Set<string>;
|
|
85
|
+
/**
|
|
86
|
+
* At-rules that are allowed to be used in "grouped" form within cssMap.
|
|
87
|
+
*
|
|
88
|
+
* "Grouped" refers to the legacy Compiled syntax where an at-rule key with no parameters
|
|
89
|
+
* (matching `/^@[A-z-]+$/`) contains nested variant keys, like:
|
|
90
|
+
*
|
|
91
|
+
* ```typescript
|
|
92
|
+
* // ❌ GROUPED (not allowed for @media):
|
|
93
|
+
* cssMap({
|
|
94
|
+
* variant: {
|
|
95
|
+
* '@media': { // at-rule key with no parameters
|
|
96
|
+
* '(min-width: 900px)': {}, // nested variants
|
|
97
|
+
* '(min-width: 1200px)': {},
|
|
98
|
+
* }
|
|
99
|
+
* }
|
|
100
|
+
* })
|
|
101
|
+
*
|
|
102
|
+
* // ✅ FLAT (preferred for @media):
|
|
103
|
+
* cssMap({
|
|
104
|
+
* variant: {
|
|
105
|
+
* '@media (min-width: 900px)': {}, // at-rule with parameters
|
|
106
|
+
* '@media (min-width: 1200px)': {},
|
|
107
|
+
* }
|
|
108
|
+
* })
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* However, some at-rules like `@starting-style` have no parameters and can only be
|
|
112
|
+
* written in the "grouped" form at the variant level:
|
|
113
|
+
*
|
|
114
|
+
* ```typescript
|
|
115
|
+
* // ✅ ALLOWED (only valid syntax for @starting-style):
|
|
116
|
+
* cssMap({
|
|
117
|
+
* fade: {
|
|
118
|
+
* '@starting-style': { // at-rule with no parameters
|
|
119
|
+
* opacity: 0, // styles to apply
|
|
120
|
+
* }
|
|
121
|
+
* }
|
|
122
|
+
* })
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* Note: This only applies to at-rules at the variant level. Nested at-rules inside
|
|
126
|
+
* other rulesets (e.g., `@starting-style` inside `@media (...)`) are handled by
|
|
127
|
+
* `walkStyleRuleset` and are not considered "grouped".
|
|
128
|
+
*/
|
|
129
|
+
export declare const allowedGroupedAtRules: Set<string>;
|
|
85
130
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const rule: import(
|
|
1
|
+
export declare const rule: import('eslint').Rule.RuleModule;
|
|
2
2
|
export default rule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-ui-styling-standard",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"atlaskit:src": "src/index.tsx",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@atlaskit/eslint-plugin-design-system": "^13.
|
|
39
|
+
"@atlaskit/eslint-plugin-design-system": "^13.40.0",
|
|
40
40
|
"@atlaskit/eslint-utils": "^2.0.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"@typescript-eslint/utils": "^7.1.0",
|