@atlaskit/eslint-plugin-design-system 10.12.1 → 10.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cjs/rules/use-heading/config/index.js +1 -0
- package/dist/cjs/rules/use-heading/index.js +3 -2
- package/dist/cjs/rules/use-latest-xcss-syntax-typography/config/index.js +12 -0
- package/dist/cjs/rules/use-latest-xcss-syntax-typography/index.js +5 -2
- package/dist/cjs/rules/use-primitives-text/config/index.js +1 -0
- package/dist/cjs/rules/use-primitives-text/index.js +3 -2
- package/dist/cjs/rules/use-tokens-typography/config/index.js +3 -0
- package/dist/es2019/rules/use-heading/config/index.js +1 -0
- package/dist/es2019/rules/use-heading/index.js +3 -2
- package/dist/es2019/rules/use-latest-xcss-syntax-typography/config/index.js +6 -0
- package/dist/es2019/rules/use-latest-xcss-syntax-typography/index.js +5 -2
- package/dist/es2019/rules/use-primitives-text/config/index.js +1 -0
- package/dist/es2019/rules/use-primitives-text/index.js +3 -2
- package/dist/es2019/rules/use-tokens-typography/config/index.js +3 -0
- package/dist/esm/rules/use-heading/config/index.js +1 -0
- package/dist/esm/rules/use-heading/index.js +3 -2
- package/dist/esm/rules/use-latest-xcss-syntax-typography/config/index.js +6 -0
- package/dist/esm/rules/use-latest-xcss-syntax-typography/index.js +5 -2
- package/dist/esm/rules/use-primitives-text/config/index.js +1 -0
- package/dist/esm/rules/use-primitives-text/index.js +3 -2
- package/dist/esm/rules/use-tokens-typography/config/index.js +3 -0
- package/dist/types/rules/use-heading/config/index.d.ts +1 -0
- package/dist/types/rules/use-latest-xcss-syntax-typography/config/index.d.ts +4 -0
- package/dist/types/rules/use-primitives-text/config/index.d.ts +1 -0
- package/dist/types-ts4.5/rules/use-heading/config/index.d.ts +1 -0
- package/dist/types-ts4.5/rules/use-latest-xcss-syntax-typography/config/index.d.ts +4 -0
- package/dist/types-ts4.5/rules/use-primitives-text/config/index.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 10.12.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#124172](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124172)
|
|
8
|
+
[`19b2005de7c1b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/19b2005de7c1b) -
|
|
9
|
+
Wrap use-heading, use-primitives-text and use-latest-xcss-syntax-typography with an error boudary
|
|
10
|
+
to stop it breaking issue-automat CI.
|
|
11
|
+
|
|
3
12
|
## 10.12.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _createRule = require("../utils/create-rule");
|
|
8
|
+
var _errorBoundary = require("../utils/error-boundary");
|
|
8
9
|
var _config = require("./config");
|
|
9
10
|
var _transformers = require("./transformers");
|
|
10
11
|
var docsUrl = 'https://atlassian.design/components/heading';
|
|
@@ -25,7 +26,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
25
26
|
},
|
|
26
27
|
create: function create(context) {
|
|
27
28
|
var config = (0, _config.getConfig)(context.options[0]);
|
|
28
|
-
return {
|
|
29
|
+
return (0, _errorBoundary.errorBoundary)({
|
|
29
30
|
// transforms <h1>...</h1> usages
|
|
30
31
|
'JSXElement[openingElement.name.name=/^h[0-6]$/]': function JSXElementOpeningElementNameNameH06$(node) {
|
|
31
32
|
return _transformers.NativeElements.lint(node, {
|
|
@@ -33,7 +34,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
33
34
|
config: config
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
};
|
|
37
|
+
}, config);
|
|
37
38
|
}
|
|
38
39
|
});
|
|
39
40
|
var _default = exports.default = rule;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getConfig = void 0;
|
|
7
|
+
var defaults = {
|
|
8
|
+
failSilently: false
|
|
9
|
+
};
|
|
10
|
+
var getConfig = exports.getConfig = function getConfig(overrides) {
|
|
11
|
+
return Object.assign({}, defaults, overrides);
|
|
12
|
+
};
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.error = exports.default = void 0;
|
|
7
7
|
var _createRule = require("../utils/create-rule");
|
|
8
|
+
var _errorBoundary = require("../utils/error-boundary");
|
|
9
|
+
var _config = require("./config");
|
|
8
10
|
var _linters = require("./linters");
|
|
9
11
|
var error = exports.error = "Don't set fontSize, lineHeight, fontWeight properties on xcss. They are unsafe as they allow invalid combinations of typography tokens. There is ongoing work to make this a TypeScript error. Once that happens, you will have to delete/refactor anyway.";
|
|
10
12
|
var rule = (0, _createRule.createLintRule)({
|
|
@@ -23,7 +25,8 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
23
25
|
}
|
|
24
26
|
},
|
|
25
27
|
create: function create(context) {
|
|
26
|
-
|
|
28
|
+
var config = (0, _config.getConfig)(context.options[0]);
|
|
29
|
+
return (0, _errorBoundary.errorBoundary)({
|
|
27
30
|
'CallExpression[callee.name="xcss"] ObjectExpression > Property > Identifier[name=/(fontSize|lineHeight|fontWeight)/]': function CallExpressionCalleeNameXcssObjectExpressionPropertyIdentifierNameFontSizeLineHeightFontWeight(node) {
|
|
28
31
|
return _linters.BannedProperty.lint(node, {
|
|
29
32
|
context: context
|
|
@@ -34,7 +37,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
34
37
|
context: context
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
|
-
};
|
|
40
|
+
}, config);
|
|
38
41
|
}
|
|
39
42
|
});
|
|
40
43
|
var _default = exports.default = rule;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getConfig = void 0;
|
|
7
7
|
var defaults = {
|
|
8
|
+
failSilently: false,
|
|
8
9
|
patterns: ['paragraph-elements', 'span-elements', 'strong-elements', 'emphasis-elements'],
|
|
9
10
|
inheritColor: false,
|
|
10
11
|
enableUnsafeAutofix: false
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _createRule = require("../utils/create-rule");
|
|
8
|
+
var _errorBoundary = require("../utils/error-boundary");
|
|
8
9
|
var _config = require("./config");
|
|
9
10
|
var _transformers = require("./transformers");
|
|
10
11
|
var textDocsUrl = 'https://atlassian.design/components/primitives/text';
|
|
@@ -26,7 +27,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
26
27
|
},
|
|
27
28
|
create: function create(context) {
|
|
28
29
|
var config = (0, _config.getConfig)(context.options[0]);
|
|
29
|
-
return {
|
|
30
|
+
return (0, _errorBoundary.errorBoundary)({
|
|
30
31
|
'JSXElement[openingElement.name.name=span]': function JSXElementOpeningElementNameNameSpan(node) {
|
|
31
32
|
return _transformers.SpanElements.lint(node, {
|
|
32
33
|
context: context,
|
|
@@ -51,7 +52,7 @@ var rule = (0, _createRule.createLintRule)({
|
|
|
51
52
|
config: config
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
|
-
};
|
|
55
|
+
}, config);
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
58
|
var _default = exports.default = rule;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import { errorBoundary } from '../utils/error-boundary';
|
|
2
3
|
import { getConfig } from './config';
|
|
3
4
|
import { NativeElements } from './transformers';
|
|
4
5
|
const docsUrl = 'https://atlassian.design/components/heading';
|
|
@@ -19,7 +20,7 @@ const rule = createLintRule({
|
|
|
19
20
|
},
|
|
20
21
|
create(context) {
|
|
21
22
|
const config = getConfig(context.options[0]);
|
|
22
|
-
return {
|
|
23
|
+
return errorBoundary({
|
|
23
24
|
// transforms <h1>...</h1> usages
|
|
24
25
|
'JSXElement[openingElement.name.name=/^h[0-6]$/]': node => {
|
|
25
26
|
return NativeElements.lint(node, {
|
|
@@ -27,7 +28,7 @@ const rule = createLintRule({
|
|
|
27
28
|
config
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
|
-
};
|
|
31
|
+
}, config);
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
export default rule;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import { errorBoundary } from '../utils/error-boundary';
|
|
3
|
+
import { getConfig } from './config';
|
|
2
4
|
import { BannedProperty } from './linters';
|
|
3
5
|
export const error = `Don't set fontSize, lineHeight, fontWeight properties on xcss. They are unsafe as they allow invalid combinations of typography tokens. There is ongoing work to make this a TypeScript error. Once that happens, you will have to delete/refactor anyway.`;
|
|
4
6
|
const rule = createLintRule({
|
|
@@ -17,14 +19,15 @@ const rule = createLintRule({
|
|
|
17
19
|
}
|
|
18
20
|
},
|
|
19
21
|
create(context) {
|
|
20
|
-
|
|
22
|
+
const config = getConfig(context.options[0]);
|
|
23
|
+
return errorBoundary({
|
|
21
24
|
'CallExpression[callee.name="xcss"] ObjectExpression > Property > Identifier[name=/(fontSize|lineHeight|fontWeight)/]': node => BannedProperty.lint(node, {
|
|
22
25
|
context
|
|
23
26
|
}),
|
|
24
27
|
'CallExpression[callee.name="xcss"] ObjectExpression > Property > Literal[value=/(fontSize|lineHeight|fontWeight)/]': node => BannedProperty.lint(node, {
|
|
25
28
|
context
|
|
26
29
|
})
|
|
27
|
-
};
|
|
30
|
+
}, config);
|
|
28
31
|
}
|
|
29
32
|
});
|
|
30
33
|
export default rule;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import { errorBoundary } from '../utils/error-boundary';
|
|
2
3
|
import { getConfig } from './config';
|
|
3
4
|
import { EmphasisElements, ParagraphElements, SpanElements, StrongElements } from './transformers';
|
|
4
5
|
const textDocsUrl = 'https://atlassian.design/components/primitives/text';
|
|
@@ -20,7 +21,7 @@ const rule = createLintRule({
|
|
|
20
21
|
},
|
|
21
22
|
create(context) {
|
|
22
23
|
const config = getConfig(context.options[0]);
|
|
23
|
-
return {
|
|
24
|
+
return errorBoundary({
|
|
24
25
|
'JSXElement[openingElement.name.name=span]': node => {
|
|
25
26
|
return SpanElements.lint(node, {
|
|
26
27
|
context,
|
|
@@ -45,7 +46,7 @@ const rule = createLintRule({
|
|
|
45
46
|
config
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
};
|
|
49
|
+
}, config);
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
export default rule;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import { errorBoundary } from '../utils/error-boundary';
|
|
2
3
|
import { getConfig } from './config';
|
|
3
4
|
import { NativeElements } from './transformers';
|
|
4
5
|
var docsUrl = 'https://atlassian.design/components/heading';
|
|
@@ -19,7 +20,7 @@ var rule = createLintRule({
|
|
|
19
20
|
},
|
|
20
21
|
create: function create(context) {
|
|
21
22
|
var config = getConfig(context.options[0]);
|
|
22
|
-
return {
|
|
23
|
+
return errorBoundary({
|
|
23
24
|
// transforms <h1>...</h1> usages
|
|
24
25
|
'JSXElement[openingElement.name.name=/^h[0-6]$/]': function JSXElementOpeningElementNameNameH06$(node) {
|
|
25
26
|
return NativeElements.lint(node, {
|
|
@@ -27,7 +28,7 @@ var rule = createLintRule({
|
|
|
27
28
|
config: config
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
|
-
};
|
|
31
|
+
}, config);
|
|
31
32
|
}
|
|
32
33
|
});
|
|
33
34
|
export default rule;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import { errorBoundary } from '../utils/error-boundary';
|
|
3
|
+
import { getConfig } from './config';
|
|
2
4
|
import { BannedProperty } from './linters';
|
|
3
5
|
export var error = "Don't set fontSize, lineHeight, fontWeight properties on xcss. They are unsafe as they allow invalid combinations of typography tokens. There is ongoing work to make this a TypeScript error. Once that happens, you will have to delete/refactor anyway.";
|
|
4
6
|
var rule = createLintRule({
|
|
@@ -17,7 +19,8 @@ var rule = createLintRule({
|
|
|
17
19
|
}
|
|
18
20
|
},
|
|
19
21
|
create: function create(context) {
|
|
20
|
-
|
|
22
|
+
var config = getConfig(context.options[0]);
|
|
23
|
+
return errorBoundary({
|
|
21
24
|
'CallExpression[callee.name="xcss"] ObjectExpression > Property > Identifier[name=/(fontSize|lineHeight|fontWeight)/]': function CallExpressionCalleeNameXcssObjectExpressionPropertyIdentifierNameFontSizeLineHeightFontWeight(node) {
|
|
22
25
|
return BannedProperty.lint(node, {
|
|
23
26
|
context: context
|
|
@@ -28,7 +31,7 @@ var rule = createLintRule({
|
|
|
28
31
|
context: context
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
|
-
};
|
|
34
|
+
}, config);
|
|
32
35
|
}
|
|
33
36
|
});
|
|
34
37
|
export default rule;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import { errorBoundary } from '../utils/error-boundary';
|
|
2
3
|
import { getConfig } from './config';
|
|
3
4
|
import { EmphasisElements, ParagraphElements, SpanElements, StrongElements } from './transformers';
|
|
4
5
|
var textDocsUrl = 'https://atlassian.design/components/primitives/text';
|
|
@@ -20,7 +21,7 @@ var rule = createLintRule({
|
|
|
20
21
|
},
|
|
21
22
|
create: function create(context) {
|
|
22
23
|
var config = getConfig(context.options[0]);
|
|
23
|
-
return {
|
|
24
|
+
return errorBoundary({
|
|
24
25
|
'JSXElement[openingElement.name.name=span]': function JSXElementOpeningElementNameNameSpan(node) {
|
|
25
26
|
return SpanElements.lint(node, {
|
|
26
27
|
context: context,
|
|
@@ -45,7 +46,7 @@ var rule = createLintRule({
|
|
|
45
46
|
config: config
|
|
46
47
|
});
|
|
47
48
|
}
|
|
48
|
-
};
|
|
49
|
+
}, config);
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
export default rule;
|
package/package.json
CHANGED