@atlaskit/eslint-plugin-design-system 13.21.1 → 13.21.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 +28 -39
- package/dist/cjs/index.codegen.js +1 -1
- package/dist/es2019/index.codegen.js +1 -1
- package/dist/esm/index.codegen.js +1 -1
- package/dist/esm/rules/utils/create-rule.js +2 -1
- package/dist/types/index.codegen.d.ts +2 -2
- package/dist/types/rules/ensure-design-token-usage-preview/index.d.ts +2 -1
- package/dist/types/rules/use-tokens-typography/utils.d.ts +2 -34
- package/dist/types/rules/utils/create-rule.d.ts +3 -1
- package/dist/types-ts4.5/index.codegen.d.ts +2 -2
- package/dist/types-ts4.5/rules/ensure-design-token-usage-preview/index.d.ts +2 -1
- package/dist/types-ts4.5/rules/use-tokens-typography/utils.d.ts +2 -34
- package/dist/types-ts4.5/rules/utils/create-rule.d.ts +3 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 13.21.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 13.21.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`437668dfbdec9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/437668dfbdec9) -
|
|
14
|
+
Add explicit types to a number of DST components
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 13.21.1
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1282,7 +1296,6 @@
|
|
|
1282
1296
|
- [#86321](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86321)
|
|
1283
1297
|
[`b353b26e22b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b353b26e22b6) -
|
|
1284
1298
|
Improvements for `no-*-tagged-template-expression` rules:
|
|
1285
|
-
|
|
1286
1299
|
- Fixed a bug that could produce syntax errors when mixins were present in nested selectors.
|
|
1287
1300
|
- Disabled autofixing styled components usages with mixins in nested selectors, as there is no
|
|
1288
1301
|
general equivalent.
|
|
@@ -1326,7 +1339,6 @@
|
|
|
1326
1339
|
functions will no longer be required to end with "Styles".
|
|
1327
1340
|
|
|
1328
1341
|
[BREAKING] Some rule options have been changed:
|
|
1329
|
-
|
|
1330
1342
|
- `fixNamesOnly` and `autoFixNames` have been removed, as there is no longer an autofixer that
|
|
1331
1343
|
enforces variable names.
|
|
1332
1344
|
- If you use `fixNamesOnly: true`, we recommend switching to using `autoFix: false`.
|
|
@@ -1358,7 +1370,6 @@
|
|
|
1358
1370
|
- [#80662](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/80662)
|
|
1359
1371
|
[`4833299b00d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4833299b00d4) -
|
|
1360
1372
|
For `no-css-tagged-template-expression` and `no-styled-tagged-template-expression`:
|
|
1361
|
-
|
|
1362
1373
|
- When importing from Emotion, stop applying autofixer when the styles contain `!important`.
|
|
1363
1374
|
- When importing from any library, stop applying autofixer when a selector contains a tagged
|
|
1364
1375
|
template interpolation (previously only styled-components).
|
|
@@ -1543,7 +1554,6 @@
|
|
|
1543
1554
|
[`ec187f466e23`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ec187f466e23) -
|
|
1544
1555
|
Update `consistent-css-prop-usage` to incorporate some updates previously made to the
|
|
1545
1556
|
`@compiled/eslint-plugin` equivalent.
|
|
1546
|
-
|
|
1547
1557
|
1. Add autofixer to add the `css` function for the following scenario:
|
|
1548
1558
|
|
|
1549
1559
|
```
|
|
@@ -1555,25 +1565,20 @@
|
|
|
1555
1565
|
`{ height: makeTaller ? '5px' : '2px' }`), or if there are spread elements, template literals, and
|
|
1556
1566
|
other tricky-to-parse code. These continue to require fixing manually.
|
|
1557
1567
|
|
|
1558
|
-
(This rule would previously only autofix if the file was originally `<div css={{ ... }} />`)
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
end of existing style variables. For example, in
|
|
1573
|
-
`<div css={buttonComponent} />; const buttonComponent = css({ ... })`, `buttonComponent` will
|
|
1574
|
-
continue to be renamed to `buttonComponentStyles`. Autofixers that will be _disabled_ include
|
|
1575
|
-
hoisting the styles to the top-most scope, and adding the `css` function call around style
|
|
1576
|
-
objects.
|
|
1568
|
+
(This rule would previously only autofix if the file was originally `<div css={{ ... }} />`) 2.
|
|
1569
|
+
Add `import { css } from '@compiled/react'` (or `xcss`) automatically when fixing. The package
|
|
1570
|
+
from which to import the `css` function can be specified through the `importSource` option. 3. Add
|
|
1571
|
+
`excludeReactComponents` to exclude linting React components (i.e. components that start with
|
|
1572
|
+
uppercase). Sometimes it may not be desirable to have this rule apply to React components (e.g.
|
|
1573
|
+
`@atlaskit/button`), which could either use the Emotion or Compiled APIs when they expose a `css`
|
|
1574
|
+
prop. Passing a function from the wrong library can result in the styling erroneously not being
|
|
1575
|
+
applied. 4. Treat `{ ... } as const` statements the same way as `{ ... }` objects. 5. Add
|
|
1576
|
+
`fixNamesOnly` to disable all autofixers _except_ the autofixer that adds `styles` to the end of
|
|
1577
|
+
existing style variables. For example, in
|
|
1578
|
+
`<div css={buttonComponent} />; const buttonComponent = css({ ... })`, `buttonComponent` will
|
|
1579
|
+
continue to be renamed to `buttonComponentStyles`. Autofixers that will be _disabled_ include
|
|
1580
|
+
hoisting the styles to the top-most scope, and adding the `css` function call around style
|
|
1581
|
+
objects.
|
|
1577
1582
|
|
|
1578
1583
|
## 8.26.0
|
|
1579
1584
|
|
|
@@ -1584,7 +1589,6 @@
|
|
|
1584
1589
|
Add some ESLint rules from Compiled CSS-in-JS, and adapt them for the UI Styling Standard.
|
|
1585
1590
|
|
|
1586
1591
|
Rules added:
|
|
1587
|
-
|
|
1588
1592
|
- `no-empty-styled-expression`: ban `styled({})` usages
|
|
1589
1593
|
- `no-exported-css` and `no-exported-keyframes`: ban `css` and `keyframes` function calls that are
|
|
1590
1594
|
exported
|
|
@@ -1592,7 +1596,6 @@
|
|
|
1592
1596
|
not valid
|
|
1593
1597
|
|
|
1594
1598
|
Changes made:
|
|
1595
|
-
|
|
1596
1599
|
- Add them to monorepo, modify to use the existing utility functions
|
|
1597
1600
|
- Add support for CSS-in-JS libraries other than Compiled (styled-components, Emotion,
|
|
1598
1601
|
`@atlaskit/css`, etc.) and `xcss` where appropriate
|
|
@@ -1823,7 +1826,6 @@
|
|
|
1823
1826
|
[`0004d49c240`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0004d49c240) - Adds a
|
|
1824
1827
|
new argument `fallbackUsage` which replaces `shouldEnforceFallbacks`. This new argument is an enum
|
|
1825
1828
|
which represents the three possible states this rule can be configured with.
|
|
1826
|
-
|
|
1827
1829
|
- `forced`: Fallbacks must always been in use
|
|
1828
1830
|
- `none`: Fallbacks must never been in use. (Fixer will remove any value provided )
|
|
1829
1831
|
- `optional`: (new) Fallbacks are optional
|
|
@@ -2173,7 +2175,6 @@
|
|
|
2173
2175
|
This rule defaults to `error`.
|
|
2174
2176
|
|
|
2175
2177
|
To update to this version:
|
|
2176
|
-
|
|
2177
2178
|
- If you are using the `ensure-design-token-usage` rule, add the `domains` property with a value
|
|
2178
2179
|
of `['color']`:
|
|
2179
2180
|
|
|
@@ -2374,14 +2375,12 @@
|
|
|
2374
2375
|
- [#32576](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32576)
|
|
2375
2376
|
[`b910bbe6130`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b910bbe6130) - The
|
|
2376
2377
|
following rules are now included in the recommended preset as errors:
|
|
2377
|
-
|
|
2378
2378
|
- ensure-design-token-usage
|
|
2379
2379
|
- no-deprecated-apis
|
|
2380
2380
|
- no-deprecated-imports
|
|
2381
2381
|
- no-unsafe-design-token-usage
|
|
2382
2382
|
|
|
2383
2383
|
The following rules are now included in the recommended preset as warnings:
|
|
2384
|
-
|
|
2385
2384
|
- no-deprecated-design-token-usage
|
|
2386
2385
|
|
|
2387
2386
|
### Minor Changes
|
|
@@ -2878,7 +2877,6 @@
|
|
|
2878
2877
|
as hardcoded color usage. This affected Styled Components and Emotion CSS prop syntaxes.
|
|
2879
2878
|
|
|
2880
2879
|
These color types have been fixed:
|
|
2881
|
-
|
|
2882
2880
|
- rgb
|
|
2883
2881
|
- rgba
|
|
2884
2882
|
- hsl
|
|
@@ -2978,7 +2976,6 @@
|
|
|
2978
2976
|
This has now been split up into two separate rules:
|
|
2979
2977
|
|
|
2980
2978
|
`ensure-design-token-usage` now covers:
|
|
2981
|
-
|
|
2982
2979
|
- `legacyElevation` — warns about old usages of the elevation mixins or styles, which instead
|
|
2983
2980
|
should use the `card` or `overlay` tokens.
|
|
2984
2981
|
- `hardCodedColor` — warns about use of hard-coded colors such as `color: colors.B100`, which
|
|
@@ -2986,7 +2983,6 @@
|
|
|
2986
2983
|
codebases when first adopting tokens.
|
|
2987
2984
|
|
|
2988
2985
|
`no-unsafe-design-token-usage` (new) covers the remaining rules:
|
|
2989
|
-
|
|
2990
2986
|
- `directTokenUsage` — warns against using the CSS Custom Property name that is output in the
|
|
2991
2987
|
browser by the `token()` call. Eg. directly using `var(--ds-accent-subtleBlue)` is bad.
|
|
2992
2988
|
- `staticToken` — warns when tokens aren't used inline. Inlining the token usages helps with
|
|
@@ -3046,20 +3042,17 @@
|
|
|
3046
3042
|
- [#14319](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/14319)
|
|
3047
3043
|
[`b6a55ffa092`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b6a55ffa092) -
|
|
3048
3044
|
Introduces fixes for various edge-cases and false positives:
|
|
3049
|
-
|
|
3050
3045
|
- Objects that are not considered "style blocks" are now ignored. Style blocks are considered as
|
|
3051
3046
|
objects assigned to variables with names containing either "style", "css", or "theme" and type
|
|
3052
3047
|
annotations including "CSSProperties" or "CSSObject".
|
|
3053
3048
|
- Hexadecimal colors using the `0x` notation are now ignored
|
|
3054
3049
|
|
|
3055
3050
|
Increasing the linting surface-area:
|
|
3056
|
-
|
|
3057
3051
|
- Colors used in shorthand css property values will now be linted against. (ie
|
|
3058
3052
|
`border: solid 1px red`)
|
|
3059
3053
|
- Strings passed directly into JSX attributes (props) are now linted (ie `<Button color="red" />`)
|
|
3060
3054
|
|
|
3061
3055
|
General improvements:
|
|
3062
|
-
|
|
3063
3056
|
- Color names will now only match against "whole" words. Meaning strings that inadvertently
|
|
3064
3057
|
include color names like the "tan" in "standard" will no longer fail.
|
|
3065
3058
|
|
|
@@ -3136,11 +3129,9 @@
|
|
|
3136
3129
|
removes & renames tokens
|
|
3137
3130
|
|
|
3138
3131
|
Adds:
|
|
3139
|
-
|
|
3140
3132
|
- `color.backgroundSelect`
|
|
3141
3133
|
|
|
3142
3134
|
Renames:
|
|
3143
|
-
|
|
3144
3135
|
- `color.borderTextHighlighted` to `color.bordertextSelected`
|
|
3145
3136
|
- `elevation.base` to `evelation.backgroundDefault`
|
|
3146
3137
|
- `elevation.flatSecondary` to `elevation.backgroundSunken`
|
|
@@ -3151,11 +3142,9 @@
|
|
|
3151
3142
|
- `elevation.shadowOverlay` to `shadow.overlay`
|
|
3152
3143
|
|
|
3153
3144
|
Removes:
|
|
3154
|
-
|
|
3155
3145
|
- `elevation.boarderFlatPrimary`
|
|
3156
3146
|
|
|
3157
3147
|
Updates:
|
|
3158
|
-
|
|
3159
3148
|
- `elevation.shadowOverlay` value to `DN100`
|
|
3160
3149
|
- `color.textWarning` in light mode to `O800`
|
|
3161
3150
|
- `color.iconBorderWarning` in light mode to `O600`
|
|
@@ -20,7 +20,7 @@ var _index = require("./rules/index.codegen");
|
|
|
20
20
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
21
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
22
22
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
23
|
-
* @codegen <<SignedSource::
|
|
23
|
+
* @codegen <<SignedSource::095a43b3637f01bf6b70a07041528ef7>>
|
|
24
24
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
25
25
|
*/
|
|
26
26
|
// this uses require because not all node versions this package supports use the same import assertions/attributes
|
|
@@ -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::095a43b3637f01bf6b70a07041528ef7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -3,7 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
/**
|
|
5
5
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::095a43b3637f01bf6b70a07041528ef7>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -10,7 +10,7 @@ import { getCreateLintRule, getPathSafeName } from '@atlaskit/eslint-utils/creat
|
|
|
10
10
|
* @private
|
|
11
11
|
* @deprecated
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
var createRule = ESLintUtils.RuleCreator(function (name) {
|
|
14
14
|
return getRuleUrl(name);
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -19,6 +19,7 @@ export var createRule = ESLintUtils.RuleCreator(function (name) {
|
|
|
19
19
|
* there is a docs link to our ESLint plugin documentation page,
|
|
20
20
|
* as well as improving type support.
|
|
21
21
|
*/
|
|
22
|
+
export { createRule };
|
|
22
23
|
export var createLintRule = getCreateLintRule(getRuleUrl);
|
|
23
24
|
function getRuleUrl(ruleName) {
|
|
24
25
|
var name = getPathSafeName(ruleName);
|
|
@@ -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::095a43b3637f01bf6b70a07041528ef7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -10,6 +10,6 @@ declare const meta: {
|
|
|
10
10
|
version: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const plugin: ESLint.Plugin;
|
|
13
|
-
declare const configs:
|
|
13
|
+
declare const configs: ESLint.Plugin['configs'];
|
|
14
14
|
export { configs, meta, rules };
|
|
15
15
|
export default plugin;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
2
|
import { type CallExpression, type Directive, type EslintNode, type ImportDeclaration, type ModuleDeclaration, type Property, type Statement, type StringableASTNode } from 'eslint-codemod-utils';
|
|
3
|
+
import { typographyAdg3 as typographyTokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
4
|
export declare const typographyProperties: string[];
|
|
4
5
|
export declare const isTypographyProperty: (propertyName: string) => boolean;
|
|
5
6
|
export declare const isFontSize: (node: EslintNode) => node is CallExpression;
|
|
@@ -69,40 +70,7 @@ export type FontWeightMap = {
|
|
|
69
70
|
bold: string;
|
|
70
71
|
};
|
|
71
72
|
export declare const defaultFontWeight: string;
|
|
72
|
-
export declare const fontFamilyTokens:
|
|
73
|
-
value: string;
|
|
74
|
-
filePath: string;
|
|
75
|
-
isSource: boolean;
|
|
76
|
-
attributes: {
|
|
77
|
-
group: string;
|
|
78
|
-
state: string;
|
|
79
|
-
introduced: string;
|
|
80
|
-
description: string;
|
|
81
|
-
suggest?: string[];
|
|
82
|
-
deprecated?: string;
|
|
83
|
-
};
|
|
84
|
-
original: {
|
|
85
|
-
value: string | {
|
|
86
|
-
fontWeight: string;
|
|
87
|
-
fontSize: string;
|
|
88
|
-
lineHeight: string;
|
|
89
|
-
fontFamily: string;
|
|
90
|
-
fontStyle: string;
|
|
91
|
-
letterSpacing: string;
|
|
92
|
-
};
|
|
93
|
-
attributes: {
|
|
94
|
-
group: string;
|
|
95
|
-
state: string;
|
|
96
|
-
introduced: string;
|
|
97
|
-
description: string;
|
|
98
|
-
suggest?: string[];
|
|
99
|
-
deprecated?: string;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
name: string;
|
|
103
|
-
path: string[];
|
|
104
|
-
cleanName: string;
|
|
105
|
-
}[];
|
|
73
|
+
export declare const fontFamilyTokens: typeof typographyTokens;
|
|
106
74
|
export declare function findFontFamilyValueForToken(tokenName: string): string;
|
|
107
75
|
export declare function findFontFamilyTokenForValue(value: string): "font.family.brand.heading" | "font.family.brand.body" | "font.family.body" | "font.family.code" | undefined;
|
|
108
76
|
export declare function notUndefined<V>(value: V | undefined): value is V;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import type { Rule } from 'eslint';
|
|
3
|
+
import { type LintRule } from '@atlaskit/eslint-utils/create-rule';
|
|
2
4
|
/**
|
|
3
5
|
* We are moving to our own small abstraction to create a lint rule that we have the power
|
|
4
6
|
* to change and mold to our own needs.
|
|
@@ -14,4 +16,4 @@ export declare const createRule: <Options extends readonly unknown[], MessageIds
|
|
|
14
16
|
* there is a docs link to our ESLint plugin documentation page,
|
|
15
17
|
* as well as improving type support.
|
|
16
18
|
*/
|
|
17
|
-
export declare const createLintRule: (rule:
|
|
19
|
+
export declare const createLintRule: (rule: LintRule) => Rule.RuleModule;
|
|
@@ -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::095a43b3637f01bf6b70a07041528ef7>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { ESLint } from 'eslint';
|
|
@@ -10,6 +10,6 @@ declare const meta: {
|
|
|
10
10
|
version: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const plugin: ESLint.Plugin;
|
|
13
|
-
declare const configs:
|
|
13
|
+
declare const configs: ESLint.Plugin['configs'];
|
|
14
14
|
export { configs, meta, rules };
|
|
15
15
|
export default plugin;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Rule } from 'eslint';
|
|
2
2
|
import { type CallExpression, type Directive, type EslintNode, type ImportDeclaration, type ModuleDeclaration, type Property, type Statement, type StringableASTNode } from 'eslint-codemod-utils';
|
|
3
|
+
import { typographyAdg3 as typographyTokens } from '@atlaskit/tokens/tokens-raw';
|
|
3
4
|
export declare const typographyProperties: string[];
|
|
4
5
|
export declare const isTypographyProperty: (propertyName: string) => boolean;
|
|
5
6
|
export declare const isFontSize: (node: EslintNode) => node is CallExpression;
|
|
@@ -69,40 +70,7 @@ export type FontWeightMap = {
|
|
|
69
70
|
bold: string;
|
|
70
71
|
};
|
|
71
72
|
export declare const defaultFontWeight: string;
|
|
72
|
-
export declare const fontFamilyTokens:
|
|
73
|
-
value: string;
|
|
74
|
-
filePath: string;
|
|
75
|
-
isSource: boolean;
|
|
76
|
-
attributes: {
|
|
77
|
-
group: string;
|
|
78
|
-
state: string;
|
|
79
|
-
introduced: string;
|
|
80
|
-
description: string;
|
|
81
|
-
suggest?: string[];
|
|
82
|
-
deprecated?: string;
|
|
83
|
-
};
|
|
84
|
-
original: {
|
|
85
|
-
value: string | {
|
|
86
|
-
fontWeight: string;
|
|
87
|
-
fontSize: string;
|
|
88
|
-
lineHeight: string;
|
|
89
|
-
fontFamily: string;
|
|
90
|
-
fontStyle: string;
|
|
91
|
-
letterSpacing: string;
|
|
92
|
-
};
|
|
93
|
-
attributes: {
|
|
94
|
-
group: string;
|
|
95
|
-
state: string;
|
|
96
|
-
introduced: string;
|
|
97
|
-
description: string;
|
|
98
|
-
suggest?: string[];
|
|
99
|
-
deprecated?: string;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
name: string;
|
|
103
|
-
path: string[];
|
|
104
|
-
cleanName: string;
|
|
105
|
-
}[];
|
|
73
|
+
export declare const fontFamilyTokens: typeof typographyTokens;
|
|
106
74
|
export declare function findFontFamilyValueForToken(tokenName: string): string;
|
|
107
75
|
export declare function findFontFamilyTokenForValue(value: string): "font.family.brand.heading" | "font.family.brand.body" | "font.family.body" | "font.family.code" | undefined;
|
|
108
76
|
export declare function notUndefined<V>(value: V | undefined): value is V;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import type { Rule } from 'eslint';
|
|
3
|
+
import { type LintRule } from '@atlaskit/eslint-utils/create-rule';
|
|
2
4
|
/**
|
|
3
5
|
* We are moving to our own small abstraction to create a lint rule that we have the power
|
|
4
6
|
* to change and mold to our own needs.
|
|
@@ -14,4 +16,4 @@ export declare const createRule: <Options extends readonly unknown[], MessageIds
|
|
|
14
16
|
* there is a docs link to our ESLint plugin documentation page,
|
|
15
17
|
* as well as improving type support.
|
|
16
18
|
*/
|
|
17
|
-
export declare const createLintRule: (rule:
|
|
19
|
+
export declare const createLintRule: (rule: LintRule) => Rule.RuleModule;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-design-system",
|
|
3
3
|
"description": "The essential plugin for use with the Atlassian Design System.",
|
|
4
|
-
"version": "13.21.
|
|
4
|
+
"version": "13.21.3",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@atlaskit/eslint-utils": "^2.0.0",
|
|
42
|
-
"@atlaskit/icon": "^28.
|
|
43
|
-
"@atlaskit/icon-lab": "^5.
|
|
44
|
-
"@atlaskit/tokens": "^
|
|
42
|
+
"@atlaskit/icon": "^28.5.0",
|
|
43
|
+
"@atlaskit/icon-lab": "^5.10.0",
|
|
44
|
+
"@atlaskit/tokens": "^7.0.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@typescript-eslint/utils": "^7.1.0",
|
|
47
47
|
"ajv": "^6.12.6",
|