@atlaskit/eslint-plugin-design-system 13.44.2 → 14.0.0
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 +11 -0
- package/README.md +0 -1
- package/dist/cjs/presets/all-flat.codegen.js +1 -2
- package/dist/cjs/presets/all.codegen.js +1 -2
- package/dist/cjs/rules/ensure-icon-color/index.js +1 -1
- package/dist/cjs/rules/index.codegen.js +1 -3
- package/dist/cjs/rules/no-icon-spacing-prop/index.js +1 -1
- package/dist/es2019/presets/all-flat.codegen.js +1 -2
- package/dist/es2019/presets/all.codegen.js +1 -2
- package/dist/es2019/rules/ensure-icon-color/index.js +1 -1
- package/dist/es2019/rules/index.codegen.js +1 -3
- package/dist/es2019/rules/no-icon-spacing-prop/index.js +1 -1
- package/dist/esm/presets/all-flat.codegen.js +1 -2
- package/dist/esm/presets/all.codegen.js +1 -2
- package/dist/esm/rules/ensure-icon-color/index.js +1 -1
- package/dist/esm/rules/index.codegen.js +1 -3
- package/dist/esm/rules/no-icon-spacing-prop/index.js +1 -1
- package/dist/types/presets/all-flat.codegen.d.ts +1 -1
- package/dist/types/presets/all.codegen.d.ts +1 -1
- package/dist/types/rules/index.codegen.d.ts +1 -1
- package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +1 -1
- package/dist/types-ts4.5/presets/all.codegen.d.ts +1 -1
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cjs/rules/no-custom-icons/checks/has-prop.js +0 -12
- package/dist/cjs/rules/no-custom-icons/index.js +0 -79
- package/dist/es2019/rules/no-custom-icons/checks/has-prop.js +0 -4
- package/dist/es2019/rules/no-custom-icons/index.js +0 -73
- package/dist/esm/rules/no-custom-icons/checks/has-prop.js +0 -6
- package/dist/esm/rules/no-custom-icons/index.js +0 -73
- package/dist/types/rules/no-custom-icons/checks/has-prop.d.ts +0 -2
- package/dist/types/rules/no-custom-icons/index.d.ts +0 -3
- package/dist/types-ts4.5/rules/no-custom-icons/checks/has-prop.d.ts +0 -2
- package/dist/types-ts4.5/rules/no-custom-icons/index.d.ts +0 -3
- /package/dist/cjs/{rules/no-custom-icons/checks → common}/is-from-import-source.js +0 -0
- /package/dist/cjs/{rules/no-custom-icons/checks → common}/is-imported-jsx-element.js +0 -0
- /package/dist/es2019/{rules/no-custom-icons/checks → common}/is-from-import-source.js +0 -0
- /package/dist/es2019/{rules/no-custom-icons/checks → common}/is-imported-jsx-element.js +0 -0
- /package/dist/esm/{rules/no-custom-icons/checks → common}/is-from-import-source.js +0 -0
- /package/dist/esm/{rules/no-custom-icons/checks → common}/is-imported-jsx-element.js +0 -0
- /package/dist/types/{rules/no-custom-icons/checks → common}/is-from-import-source.d.ts +0 -0
- /package/dist/types/{rules/no-custom-icons/checks → common}/is-imported-jsx-element.d.ts +0 -0
- /package/dist/types-ts4.5/{rules/no-custom-icons/checks → common}/is-from-import-source.d.ts +0 -0
- /package/dist/types-ts4.5/{rules/no-custom-icons/checks → common}/is-imported-jsx-element.d.ts +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/eslint-plugin-design-system
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`b1e060ffdd070`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b1e060ffdd070) -
|
|
8
|
+
Remove no-custom-icons ESLint rule
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 13.44.2
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -61,7 +61,6 @@ module.exports = {
|
|
|
61
61
|
| <a href="./packages/design-system/eslint-plugin/src/rules/no-banned-imports/README.md">no-banned-imports</a> | Disallow importing banned modules. | Yes | | |
|
|
62
62
|
| <a href="./packages/design-system/eslint-plugin/src/rules/no-boolean-autofocus-on-modal-dialog/README.md">no-boolean-autofocus-on-modal-dialog</a> | Encourages makers to not use boolean values for `autoFocus` on Atlassian Design System's modal dialog component. | Yes | | |
|
|
63
63
|
| <a href="./packages/design-system/eslint-plugin/src/rules/no-css-tagged-template-expression/README.md">no-css-tagged-template-expression</a> | Disallows any `css` tagged template expressions that originate from Emotion, Styled Components or Compiled | | Yes | |
|
|
64
|
-
| <a href="./packages/design-system/eslint-plugin/src/rules/no-custom-icons/README.md">no-custom-icons</a> | Enforces custom glyph icons are used. | | | |
|
|
65
64
|
| <a href="./packages/design-system/eslint-plugin/src/rules/no-dark-theme-vr-tests/README.md">no-dark-theme-vr-tests</a> | Disallow using dark colorScheme in VR tests. | | Yes | |
|
|
66
65
|
| <a href="./packages/design-system/eslint-plugin/src/rules/no-deprecated-apis/README.md">no-deprecated-apis</a> | Disallow using deprecated APIs. | Yes | | |
|
|
67
66
|
| <a href="./packages/design-system/eslint-plugin/src/rules/no-deprecated-design-token-usage/README.md">no-deprecated-design-token-usage</a> | Disallow using deprecated design tokens. | Yes | Yes | |
|
|
@@ -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::1fe99d63747ac78f0ea9e747af54bc76>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -26,7 +26,6 @@ var rules = {
|
|
|
26
26
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
27
27
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
28
28
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
29
|
-
'@atlaskit/design-system/no-custom-icons': 'warn',
|
|
30
29
|
'@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
|
|
31
30
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
32
31
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -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::4a4e27095e18b4c1f42c12cbc9f4af5e>>
|
|
10
10
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
11
11
|
*/
|
|
12
12
|
|
|
@@ -25,7 +25,6 @@ var rules = {
|
|
|
25
25
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
26
26
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
27
27
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
28
|
-
'@atlaskit/design-system/no-custom-icons': 'warn',
|
|
29
28
|
'@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
|
|
30
29
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
31
30
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
8
|
-
var _isFromImportSource = require("
|
|
8
|
+
var _isFromImportSource = require("../../common/is-from-import-source");
|
|
9
9
|
var _createRule = require("../utils/create-rule");
|
|
10
10
|
var _errorBoundary = require("../utils/error-boundary");
|
|
11
11
|
/**
|
|
@@ -17,7 +17,6 @@ var _lozengeBadgeTagLabellingSystemMigration = _interopRequireDefault(require(".
|
|
|
17
17
|
var _noBannedImports = _interopRequireDefault(require("./no-banned-imports"));
|
|
18
18
|
var _noBooleanAutofocusOnModalDialog = _interopRequireDefault(require("./no-boolean-autofocus-on-modal-dialog"));
|
|
19
19
|
var _noCssTaggedTemplateExpression = _interopRequireDefault(require("./no-css-tagged-template-expression"));
|
|
20
|
-
var _noCustomIcons = _interopRequireDefault(require("./no-custom-icons"));
|
|
21
20
|
var _noDarkThemeVrTests = _interopRequireDefault(require("./no-dark-theme-vr-tests"));
|
|
22
21
|
var _noDeprecatedApis = _interopRequireDefault(require("./no-deprecated-apis"));
|
|
23
22
|
var _noDeprecatedDesignTokenUsage = _interopRequireDefault(require("./no-deprecated-design-token-usage"));
|
|
@@ -84,7 +83,7 @@ var _useTokensTypography = _interopRequireDefault(require("./use-tokens-typograp
|
|
|
84
83
|
var _useVisuallyHidden = _interopRequireDefault(require("./use-visually-hidden"));
|
|
85
84
|
/**
|
|
86
85
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
87
|
-
* @codegen <<SignedSource::
|
|
86
|
+
* @codegen <<SignedSource::9b32672dde773f9e75f0e548609ecb58>>
|
|
88
87
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
89
88
|
*/
|
|
90
89
|
|
|
@@ -101,7 +100,6 @@ var rules = exports.rules = {
|
|
|
101
100
|
'no-banned-imports': _noBannedImports.default,
|
|
102
101
|
'no-boolean-autofocus-on-modal-dialog': _noBooleanAutofocusOnModalDialog.default,
|
|
103
102
|
'no-css-tagged-template-expression': _noCssTaggedTemplateExpression.default,
|
|
104
|
-
'no-custom-icons': _noCustomIcons.default,
|
|
105
103
|
'no-dark-theme-vr-tests': _noDarkThemeVrTests.default,
|
|
106
104
|
'no-deprecated-apis': _noDeprecatedApis.default,
|
|
107
105
|
'no-deprecated-design-token-usage': _noDeprecatedDesignTokenUsage.default,
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _isFromImportSource = require("
|
|
7
|
+
var _isFromImportSource = require("../../common/is-from-import-source");
|
|
8
8
|
var _createRule = require("../utils/create-rule");
|
|
9
9
|
var _errorBoundary = require("../utils/error-boundary");
|
|
10
10
|
var _helpers = require("./helpers");
|
|
@@ -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::1fe99d63747ac78f0ea9e747af54bc76>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -20,7 +20,6 @@ const rules = {
|
|
|
20
20
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
21
21
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
22
22
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
23
|
-
'@atlaskit/design-system/no-custom-icons': 'warn',
|
|
24
23
|
'@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
|
|
25
24
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
26
25
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -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::4a4e27095e18b4c1f42c12cbc9f4af5e>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -19,7 +19,6 @@ const rules = {
|
|
|
19
19
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
20
20
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
21
21
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
22
|
-
'@atlaskit/design-system/no-custom-icons': 'warn',
|
|
23
22
|
'@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
|
|
24
23
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
25
24
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
-
import { createIsFromImportSourceFor } from '
|
|
2
|
+
import { createIsFromImportSourceFor } from '../../common/is-from-import-source';
|
|
3
3
|
import { createLintRule } from '../utils/create-rule';
|
|
4
4
|
import { errorBoundary } from '../utils/error-boundary';
|
|
5
5
|
|
|
@@ -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::9b32672dde773f9e75f0e548609ecb58>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -16,7 +16,6 @@ import lozengeBadgeTagLabellingSystemMigration from './lozenge-badge-tag-labelli
|
|
|
16
16
|
import noBannedImports from './no-banned-imports';
|
|
17
17
|
import noBooleanAutofocusOnModalDialog from './no-boolean-autofocus-on-modal-dialog';
|
|
18
18
|
import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
|
|
19
|
-
import noCustomIcons from './no-custom-icons';
|
|
20
19
|
import noDarkThemeVrTests from './no-dark-theme-vr-tests';
|
|
21
20
|
import noDeprecatedApis from './no-deprecated-apis';
|
|
22
21
|
import noDeprecatedDesignTokenUsage from './no-deprecated-design-token-usage';
|
|
@@ -94,7 +93,6 @@ export const rules = {
|
|
|
94
93
|
'no-banned-imports': noBannedImports,
|
|
95
94
|
'no-boolean-autofocus-on-modal-dialog': noBooleanAutofocusOnModalDialog,
|
|
96
95
|
'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
|
|
97
|
-
'no-custom-icons': noCustomIcons,
|
|
98
96
|
'no-dark-theme-vr-tests': noDarkThemeVrTests,
|
|
99
97
|
'no-deprecated-apis': noDeprecatedApis,
|
|
100
98
|
'no-deprecated-design-token-usage': noDeprecatedDesignTokenUsage,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createIsFromImportSourceFor } from '
|
|
1
|
+
import { createIsFromImportSourceFor } from '../../common/is-from-import-source';
|
|
2
2
|
import { createLintRule } from '../utils/create-rule';
|
|
3
3
|
import { errorBoundary } from '../utils/error-boundary';
|
|
4
4
|
import { CSSMAP_VARIABLE_NAME, getCssMapKey, getIconSize, getSpacingAttribute, getStaticAttributeValue, hasSpreadProps, SPACING_TO_PADDING, upsertCssMapImport, upsertCssMapVariable, upsertFlexImport, upsertTokenImport } from './helpers';
|
|
@@ -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::1fe99d63747ac78f0ea9e747af54bc76>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -20,7 +20,6 @@ var rules = {
|
|
|
20
20
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
21
21
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
22
22
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
23
|
-
'@atlaskit/design-system/no-custom-icons': 'warn',
|
|
24
23
|
'@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
|
|
25
24
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
26
25
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -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::4a4e27095e18b4c1f42c12cbc9f4af5e>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -19,7 +19,6 @@ var rules = {
|
|
|
19
19
|
'@atlaskit/design-system/no-banned-imports': 'error',
|
|
20
20
|
'@atlaskit/design-system/no-boolean-autofocus-on-modal-dialog': 'warn',
|
|
21
21
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
22
|
-
'@atlaskit/design-system/no-custom-icons': 'warn',
|
|
23
22
|
'@atlaskit/design-system/no-dark-theme-vr-tests': 'error',
|
|
24
23
|
'@atlaskit/design-system/no-deprecated-apis': 'error',
|
|
25
24
|
'@atlaskit/design-system/no-deprecated-design-token-usage': 'warn',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
-
import { createIsFromImportSourceFor } from '
|
|
2
|
+
import { createIsFromImportSourceFor } from '../../common/is-from-import-source';
|
|
3
3
|
import { createLintRule } from '../utils/create-rule';
|
|
4
4
|
import { errorBoundary } from '../utils/error-boundary';
|
|
5
5
|
|
|
@@ -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::9b32672dde773f9e75f0e548609ecb58>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -16,7 +16,6 @@ import lozengeBadgeTagLabellingSystemMigration from './lozenge-badge-tag-labelli
|
|
|
16
16
|
import noBannedImports from './no-banned-imports';
|
|
17
17
|
import noBooleanAutofocusOnModalDialog from './no-boolean-autofocus-on-modal-dialog';
|
|
18
18
|
import noCssTaggedTemplateExpression from './no-css-tagged-template-expression';
|
|
19
|
-
import noCustomIcons from './no-custom-icons';
|
|
20
19
|
import noDarkThemeVrTests from './no-dark-theme-vr-tests';
|
|
21
20
|
import noDeprecatedApis from './no-deprecated-apis';
|
|
22
21
|
import noDeprecatedDesignTokenUsage from './no-deprecated-design-token-usage';
|
|
@@ -94,7 +93,6 @@ export var rules = {
|
|
|
94
93
|
'no-banned-imports': noBannedImports,
|
|
95
94
|
'no-boolean-autofocus-on-modal-dialog': noBooleanAutofocusOnModalDialog,
|
|
96
95
|
'no-css-tagged-template-expression': noCssTaggedTemplateExpression,
|
|
97
|
-
'no-custom-icons': noCustomIcons,
|
|
98
96
|
'no-dark-theme-vr-tests': noDarkThemeVrTests,
|
|
99
97
|
'no-deprecated-apis': noDeprecatedApis,
|
|
100
98
|
'no-deprecated-design-token-usage': noDeprecatedDesignTokenUsage,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createIsFromImportSourceFor } from '
|
|
1
|
+
import { createIsFromImportSourceFor } from '../../common/is-from-import-source';
|
|
2
2
|
import { createLintRule } from '../utils/create-rule';
|
|
3
3
|
import { errorBoundary } from '../utils/error-boundary';
|
|
4
4
|
import { CSSMAP_VARIABLE_NAME, getCssMapKey, getIconSize, getSpacingAttribute, getStaticAttributeValue, hasSpreadProps, SPACING_TO_PADDING, upsertCssMapImport, upsertCssMapVariable, upsertFlexImport, upsertTokenImport } from './helpers';
|
|
@@ -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::1fe99d63747ac78f0ea9e747af54bc76>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system 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::4a4e27095e18b4c1f42c12cbc9f4af5e>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system 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::9b32672dde773f9e75f0e548609ecb58>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Rule } 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::1fe99d63747ac78f0ea9e747af54bc76>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system 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::4a4e27095e18b4c1f42c12cbc9f4af5e>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system 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::9b32672dde773f9e75f0e548609ecb58>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-design-system codegen
|
|
5
5
|
*/
|
|
6
6
|
import type { Rule } from 'eslint';
|
package/package.json
CHANGED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.hasProp = hasProp;
|
|
7
|
-
var _eslintCodemodUtils = require("eslint-codemod-utils");
|
|
8
|
-
function hasProp(node, propName) {
|
|
9
|
-
return (0, _eslintCodemodUtils.isNodeOfType)(node.openingElement, 'JSXOpeningElement') && node.openingElement.attributes.some(function (a) {
|
|
10
|
-
return a.type === 'JSXAttribute' && a.name.name === propName;
|
|
11
|
-
});
|
|
12
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _createRule = require("../utils/create-rule");
|
|
8
|
-
var _errorBoundary = require("../utils/error-boundary");
|
|
9
|
-
var _hasProp = require("./checks/has-prop");
|
|
10
|
-
var _isFromImportSource = require("./checks/is-from-import-source");
|
|
11
|
-
var rule = (0, _createRule.createLintRule)({
|
|
12
|
-
meta: {
|
|
13
|
-
name: 'no-custom-icons',
|
|
14
|
-
type: 'problem',
|
|
15
|
-
docs: {
|
|
16
|
-
description: 'Enforces custom glyph icons are used.',
|
|
17
|
-
recommended: false,
|
|
18
|
-
severity: 'warn'
|
|
19
|
-
},
|
|
20
|
-
schema: [{
|
|
21
|
-
type: 'object',
|
|
22
|
-
properties: {
|
|
23
|
-
centralLocation: {
|
|
24
|
-
type: 'string'
|
|
25
|
-
},
|
|
26
|
-
failSilently: {
|
|
27
|
-
type: 'boolean'
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
additionalProperties: false
|
|
31
|
-
}],
|
|
32
|
-
messages: {
|
|
33
|
-
noCustomIcons: "Custom icons/svgs from {{importSource}} are no longer supported. Migrate to an icon from '@atlaskit/(icon-labs|icon/core|icon/utility)'{{locationMessage}}.\n[Migration guide](https://hello.atlassian.net/wiki/spaces/DST/pages/3748692796/New+ADS+iconography+-+Code+migration+guide)."
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
create: function create(context) {
|
|
37
|
-
var _context$options$;
|
|
38
|
-
var isIconSvg = (0, _isFromImportSource.createIsFromImportSourceFor)('@atlaskit/icon/svg');
|
|
39
|
-
var isIconBase = (0, _isFromImportSource.createIsFromImportSourceFor)('@atlaskit/icon', '@atlaskit/icon/base');
|
|
40
|
-
|
|
41
|
-
// TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
|
|
42
|
-
var _ref = (_context$options$ = context.options[0]) !== null && _context$options$ !== void 0 ? _context$options$ : {},
|
|
43
|
-
_ref$centralLocation = _ref.centralLocation,
|
|
44
|
-
centralLocation = _ref$centralLocation === void 0 ? '' : _ref$centralLocation,
|
|
45
|
-
_ref$failSilently = _ref.failSilently,
|
|
46
|
-
failSilently = _ref$failSilently === void 0 ? false : _ref$failSilently;
|
|
47
|
-
function checkNode(node) {
|
|
48
|
-
isIconBase.importDeclarationHook(node);
|
|
49
|
-
isIconSvg.importDeclarationHook(node);
|
|
50
|
-
}
|
|
51
|
-
var locationMessage = centralLocation ? ", move the icon to '".concat(centralLocation, "', or, if it's a third party logo, migrate to a standard <svg> element with a `label`.") : '';
|
|
52
|
-
return (0, _errorBoundary.errorBoundary)({
|
|
53
|
-
JSXElement: function JSXElement(node) {
|
|
54
|
-
var isSvg = isIconSvg(node);
|
|
55
|
-
var isBase = isIconBase(node);
|
|
56
|
-
// Not an icon import
|
|
57
|
-
if (!isSvg && (!isBase || !(0, _hasProp.hasProp)(node, 'glyph'))) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
var importSource = '';
|
|
61
|
-
if (isSvg) {
|
|
62
|
-
importSource = isIconSvg.getImportSource(node);
|
|
63
|
-
} else if (isBase) {
|
|
64
|
-
importSource = isIconBase.getImportSource(node);
|
|
65
|
-
}
|
|
66
|
-
context.report({
|
|
67
|
-
node: node.openingElement,
|
|
68
|
-
messageId: 'noCustomIcons',
|
|
69
|
-
data: {
|
|
70
|
-
importSource: importSource,
|
|
71
|
-
locationMessage: locationMessage
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
},
|
|
75
|
-
ImportDeclaration: checkNode
|
|
76
|
-
}, failSilently);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
var _default = exports.default = rule;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createLintRule } from '../utils/create-rule';
|
|
2
|
-
import { errorBoundary } from '../utils/error-boundary';
|
|
3
|
-
import { hasProp } from './checks/has-prop';
|
|
4
|
-
import { createIsFromImportSourceFor } from './checks/is-from-import-source';
|
|
5
|
-
const rule = createLintRule({
|
|
6
|
-
meta: {
|
|
7
|
-
name: 'no-custom-icons',
|
|
8
|
-
type: 'problem',
|
|
9
|
-
docs: {
|
|
10
|
-
description: 'Enforces custom glyph icons are used.',
|
|
11
|
-
recommended: false,
|
|
12
|
-
severity: 'warn'
|
|
13
|
-
},
|
|
14
|
-
schema: [{
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
centralLocation: {
|
|
18
|
-
type: 'string'
|
|
19
|
-
},
|
|
20
|
-
failSilently: {
|
|
21
|
-
type: 'boolean'
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
additionalProperties: false
|
|
25
|
-
}],
|
|
26
|
-
messages: {
|
|
27
|
-
noCustomIcons: `Custom icons/svgs from {{importSource}} are no longer supported. Migrate to an icon from '@atlaskit/(icon-labs|icon/core|icon/utility)'{{locationMessage}}.
|
|
28
|
-
[Migration guide](https://hello.atlassian.net/wiki/spaces/DST/pages/3748692796/New+ADS+iconography+-+Code+migration+guide).`
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
create(context) {
|
|
32
|
-
var _context$options$;
|
|
33
|
-
const isIconSvg = createIsFromImportSourceFor('@atlaskit/icon/svg');
|
|
34
|
-
const isIconBase = createIsFromImportSourceFor('@atlaskit/icon', '@atlaskit/icon/base');
|
|
35
|
-
|
|
36
|
-
// TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
|
|
37
|
-
const {
|
|
38
|
-
centralLocation = '',
|
|
39
|
-
failSilently = false
|
|
40
|
-
} = (_context$options$ = context.options[0]) !== null && _context$options$ !== void 0 ? _context$options$ : {};
|
|
41
|
-
function checkNode(node) {
|
|
42
|
-
isIconBase.importDeclarationHook(node);
|
|
43
|
-
isIconSvg.importDeclarationHook(node);
|
|
44
|
-
}
|
|
45
|
-
const locationMessage = centralLocation ? `, move the icon to '${centralLocation}', or, if it's a third party logo, migrate to a standard <svg> element with a \`label\`.` : '';
|
|
46
|
-
return errorBoundary({
|
|
47
|
-
JSXElement(node) {
|
|
48
|
-
const isSvg = isIconSvg(node);
|
|
49
|
-
const isBase = isIconBase(node);
|
|
50
|
-
// Not an icon import
|
|
51
|
-
if (!isSvg && (!isBase || !hasProp(node, 'glyph'))) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
let importSource = '';
|
|
55
|
-
if (isSvg) {
|
|
56
|
-
importSource = isIconSvg.getImportSource(node);
|
|
57
|
-
} else if (isBase) {
|
|
58
|
-
importSource = isIconBase.getImportSource(node);
|
|
59
|
-
}
|
|
60
|
-
context.report({
|
|
61
|
-
node: node.openingElement,
|
|
62
|
-
messageId: 'noCustomIcons',
|
|
63
|
-
data: {
|
|
64
|
-
importSource,
|
|
65
|
-
locationMessage
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
ImportDeclaration: checkNode
|
|
70
|
-
}, failSilently);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
export default rule;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
-
export function hasProp(node, propName) {
|
|
3
|
-
return isNodeOfType(node.openingElement, 'JSXOpeningElement') && node.openingElement.attributes.some(function (a) {
|
|
4
|
-
return a.type === 'JSXAttribute' && a.name.name === propName;
|
|
5
|
-
});
|
|
6
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createLintRule } from '../utils/create-rule';
|
|
2
|
-
import { errorBoundary } from '../utils/error-boundary';
|
|
3
|
-
import { hasProp } from './checks/has-prop';
|
|
4
|
-
import { createIsFromImportSourceFor } from './checks/is-from-import-source';
|
|
5
|
-
var rule = createLintRule({
|
|
6
|
-
meta: {
|
|
7
|
-
name: 'no-custom-icons',
|
|
8
|
-
type: 'problem',
|
|
9
|
-
docs: {
|
|
10
|
-
description: 'Enforces custom glyph icons are used.',
|
|
11
|
-
recommended: false,
|
|
12
|
-
severity: 'warn'
|
|
13
|
-
},
|
|
14
|
-
schema: [{
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
centralLocation: {
|
|
18
|
-
type: 'string'
|
|
19
|
-
},
|
|
20
|
-
failSilently: {
|
|
21
|
-
type: 'boolean'
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
additionalProperties: false
|
|
25
|
-
}],
|
|
26
|
-
messages: {
|
|
27
|
-
noCustomIcons: "Custom icons/svgs from {{importSource}} are no longer supported. Migrate to an icon from '@atlaskit/(icon-labs|icon/core|icon/utility)'{{locationMessage}}.\n[Migration guide](https://hello.atlassian.net/wiki/spaces/DST/pages/3748692796/New+ADS+iconography+-+Code+migration+guide)."
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
create: function create(context) {
|
|
31
|
-
var _context$options$;
|
|
32
|
-
var isIconSvg = createIsFromImportSourceFor('@atlaskit/icon/svg');
|
|
33
|
-
var isIconBase = createIsFromImportSourceFor('@atlaskit/icon', '@atlaskit/icon/base');
|
|
34
|
-
|
|
35
|
-
// TODO: JFP-2823 - this type cast was added due to Jira's ESLint v9 migration
|
|
36
|
-
var _ref = (_context$options$ = context.options[0]) !== null && _context$options$ !== void 0 ? _context$options$ : {},
|
|
37
|
-
_ref$centralLocation = _ref.centralLocation,
|
|
38
|
-
centralLocation = _ref$centralLocation === void 0 ? '' : _ref$centralLocation,
|
|
39
|
-
_ref$failSilently = _ref.failSilently,
|
|
40
|
-
failSilently = _ref$failSilently === void 0 ? false : _ref$failSilently;
|
|
41
|
-
function checkNode(node) {
|
|
42
|
-
isIconBase.importDeclarationHook(node);
|
|
43
|
-
isIconSvg.importDeclarationHook(node);
|
|
44
|
-
}
|
|
45
|
-
var locationMessage = centralLocation ? ", move the icon to '".concat(centralLocation, "', or, if it's a third party logo, migrate to a standard <svg> element with a `label`.") : '';
|
|
46
|
-
return errorBoundary({
|
|
47
|
-
JSXElement: function JSXElement(node) {
|
|
48
|
-
var isSvg = isIconSvg(node);
|
|
49
|
-
var isBase = isIconBase(node);
|
|
50
|
-
// Not an icon import
|
|
51
|
-
if (!isSvg && (!isBase || !hasProp(node, 'glyph'))) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
var importSource = '';
|
|
55
|
-
if (isSvg) {
|
|
56
|
-
importSource = isIconSvg.getImportSource(node);
|
|
57
|
-
} else if (isBase) {
|
|
58
|
-
importSource = isIconBase.getImportSource(node);
|
|
59
|
-
}
|
|
60
|
-
context.report({
|
|
61
|
-
node: node.openingElement,
|
|
62
|
-
messageId: 'noCustomIcons',
|
|
63
|
-
data: {
|
|
64
|
-
importSource: importSource,
|
|
65
|
-
locationMessage: locationMessage
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
},
|
|
69
|
-
ImportDeclaration: checkNode
|
|
70
|
-
}, failSilently);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
export default rule;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/types-ts4.5/{rules/no-custom-icons/checks → common}/is-from-import-source.d.ts
RENAMED
|
File without changes
|
/package/dist/types-ts4.5/{rules/no-custom-icons/checks → common}/is-imported-jsx-element.d.ts
RENAMED
|
File without changes
|