@atlaskit/eslint-plugin-design-system 10.25.0 → 11.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +1 -1
  3. package/dist/cjs/rules/no-deprecated-imports/checks.js +201 -0
  4. package/dist/cjs/rules/no-deprecated-imports/constants.js +8 -0
  5. package/dist/cjs/rules/no-deprecated-imports/handlers/icon.js +204 -0
  6. package/dist/cjs/rules/no-deprecated-imports/index.js +25 -118
  7. package/dist/cjs/rules/use-tokens-typography/config/index.js +3 -1
  8. package/dist/cjs/rules/utils/create-no-tagged-template-expression-rule/index.js +3 -0
  9. package/dist/cjs/rules/utils/get-deprecated-config.js +9 -1
  10. package/dist/es2019/rules/no-deprecated-imports/checks.js +175 -0
  11. package/dist/es2019/rules/no-deprecated-imports/constants.js +2 -0
  12. package/dist/es2019/rules/no-deprecated-imports/handlers/icon.js +153 -0
  13. package/dist/es2019/rules/no-deprecated-imports/index.js +23 -103
  14. package/dist/es2019/rules/use-tokens-typography/config/index.js +3 -1
  15. package/dist/es2019/rules/utils/create-no-tagged-template-expression-rule/index.js +3 -0
  16. package/dist/es2019/rules/utils/get-deprecated-config.js +12 -1
  17. package/dist/esm/rules/no-deprecated-imports/checks.js +195 -0
  18. package/dist/esm/rules/no-deprecated-imports/constants.js +2 -0
  19. package/dist/esm/rules/no-deprecated-imports/handlers/icon.js +197 -0
  20. package/dist/esm/rules/no-deprecated-imports/index.js +23 -117
  21. package/dist/esm/rules/use-tokens-typography/config/index.js +3 -1
  22. package/dist/esm/rules/utils/create-no-tagged-template-expression-rule/index.js +3 -0
  23. package/dist/esm/rules/utils/get-deprecated-config.js +9 -1
  24. package/dist/types/index.codegen.d.ts +3 -9
  25. package/dist/types/rules/index.codegen.d.ts +1 -3
  26. package/dist/types/rules/no-deprecated-imports/checks.d.ts +11 -0
  27. package/dist/types/rules/no-deprecated-imports/constants.d.ts +2 -0
  28. package/dist/types/rules/no-deprecated-imports/handlers/icon.d.ts +38 -0
  29. package/dist/types/rules/no-deprecated-imports/index.d.ts +1 -7
  30. package/dist/types/rules/utils/types.d.ts +1 -0
  31. package/dist/types-ts4.5/index.codegen.d.ts +3 -15
  32. package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -5
  33. package/dist/types-ts4.5/rules/no-deprecated-imports/checks.d.ts +11 -0
  34. package/dist/types-ts4.5/rules/no-deprecated-imports/constants.d.ts +2 -0
  35. package/dist/types-ts4.5/rules/no-deprecated-imports/handlers/icon.d.ts +38 -0
  36. package/dist/types-ts4.5/rules/no-deprecated-imports/index.d.ts +1 -9
  37. package/dist/types-ts4.5/rules/utils/types.d.ts +1 -0
  38. package/package.json +3 -2
@@ -0,0 +1,38 @@
1
+ import type { Rule } from 'eslint';
2
+ import { type ExportNamedDeclaration, type ImportDeclaration, type JSXElement } from 'eslint-codemod-utils';
3
+ import { type DeprecatedImportConfigEntry } from '../../utils/types';
4
+ export type ImportIconDeprecationError = Rule.ReportDescriptor & {
5
+ node: ImportDeclaration;
6
+ };
7
+ export type ExportIconDeprecationError = Rule.ReportDescriptor & {
8
+ node: ExportNamedDeclaration;
9
+ };
10
+ export type ImportIconDeprecationErrorListAuto = {
11
+ [key: string]: ImportIconDeprecationError;
12
+ };
13
+ export type ExportIconDeprecationErrorListAuto = {
14
+ [key: string]: ExportIconDeprecationError;
15
+ };
16
+ type DeprecationIconHandler = (context: Rule.RuleContext) => {
17
+ createImportError: (args: {
18
+ node: ImportDeclaration;
19
+ importSource: string;
20
+ config: DeprecatedImportConfigEntry;
21
+ }) => void;
22
+ createExportError: (args: {
23
+ node: ExportNamedDeclaration;
24
+ importSource: string;
25
+ config: DeprecatedImportConfigEntry;
26
+ }) => void;
27
+ checkJSXElement: (node: JSXElement) => void;
28
+ checkIdentifier: (node: Rule.Node) => void;
29
+ throwErrors: () => void;
30
+ };
31
+ /**
32
+ * __Deprecation icon handler__
33
+ *
34
+ * A deprecation icon handler which is responsible for displaying an error for deprecated icons.
35
+ * It also includes a fixer to replace the deprecated icon with the new icon if a replacement exists.
36
+ */
37
+ export declare const getDeprecationIconHandler: DeprecationIconHandler;
38
+ export {};
@@ -24,12 +24,6 @@
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
25
  * THE SOFTWARE.
26
26
  */
27
- import { type TSESLint } from '@typescript-eslint/utils';
28
- import { type DeprecatedConfig } from '../utils/types';
29
27
  export declare const name = "no-deprecated-imports";
30
- export declare const importNameWithCustomMessageId = "importNameWithCustomMessage";
31
- export declare const pathWithCustomMessageId = "pathWithCustomMessage";
32
- declare const rule: TSESLint.RuleModule<string, [{
33
- deprecatedConfig: DeprecatedConfig;
34
- }], TSESLint.RuleListener>;
28
+ declare const rule: import("eslint").Rule.RuleModule;
35
29
  export default rule;
@@ -17,6 +17,7 @@ export type DeprecatedImportConfigEntry = {
17
17
  importName: string;
18
18
  message: string;
19
19
  }[];
20
+ unfixable?: boolean;
20
21
  };
21
22
  export declare const isDeprecatedImportConfig: (config: DeprecatedImportConfig | DeprecatedJSXAttributeConfig) => config is DeprecatedImportConfig;
22
23
  export declare const isDeprecatedJSXAttributeConfig: (config: DeprecatedImportConfig | DeprecatedJSXAttributeConfig) => config is DeprecatedJSXAttributeConfig;
@@ -19,11 +19,7 @@ export declare const plugin: {
19
19
  }
20
20
  ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
21
21
  'no-deprecated-design-token-usage': import("eslint").Rule.RuleModule;
22
- 'no-deprecated-imports': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<string, [
23
- {
24
- deprecatedConfig: import("./rules/utils/types").DeprecatedConfig;
25
- }
26
- ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
22
+ 'no-deprecated-imports': import("eslint").Rule.RuleModule;
27
23
  'no-direct-use-of-web-platform-drag-and-drop': import("eslint").Rule.RuleModule;
28
24
  'no-empty-styled-expression': import("eslint").Rule.RuleModule;
29
25
  'no-exported-css': import("eslint").Rule.RuleModule;
@@ -361,11 +357,7 @@ export declare const configs: {
361
357
  }
362
358
  ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
363
359
  'no-deprecated-design-token-usage': import("eslint").Rule.RuleModule;
364
- 'no-deprecated-imports': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<string, [
365
- {
366
- deprecatedConfig: import("./rules/utils/types").DeprecatedConfig;
367
- }
368
- ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
360
+ 'no-deprecated-imports': import("eslint").Rule.RuleModule;
369
361
  'no-direct-use-of-web-platform-drag-and-drop': import("eslint").Rule.RuleModule;
370
362
  'no-empty-styled-expression': import("eslint").Rule.RuleModule;
371
363
  'no-exported-css': import("eslint").Rule.RuleModule;
@@ -530,11 +522,7 @@ export declare const configs: {
530
522
  }
531
523
  ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
532
524
  'no-deprecated-design-token-usage': import("eslint").Rule.RuleModule;
533
- 'no-deprecated-imports': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<string, [
534
- {
535
- deprecatedConfig: import("./rules/utils/types").DeprecatedConfig;
536
- }
537
- ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
525
+ 'no-deprecated-imports': import("eslint").Rule.RuleModule;
538
526
  'no-direct-use-of-web-platform-drag-and-drop': import("eslint").Rule.RuleModule;
539
527
  'no-empty-styled-expression': import("eslint").Rule.RuleModule;
540
528
  'no-exported-css': import("eslint").Rule.RuleModule;
@@ -14,11 +14,7 @@ export declare const rules: {
14
14
  }
15
15
  ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
16
16
  'no-deprecated-design-token-usage': import("eslint").Rule.RuleModule;
17
- 'no-deprecated-imports': import("@typescript-eslint/utils/dist/ts-eslint").RuleModule<string, [
18
- {
19
- deprecatedConfig: import("./utils/types").DeprecatedConfig;
20
- }
21
- ], import("@typescript-eslint/utils/dist/ts-eslint").RuleListener>;
17
+ 'no-deprecated-imports': import("eslint").Rule.RuleModule;
22
18
  'no-direct-use-of-web-platform-drag-and-drop': import("eslint").Rule.RuleModule;
23
19
  'no-empty-styled-expression': import("eslint").Rule.RuleModule;
24
20
  'no-exported-css': import("eslint").Rule.RuleModule;
@@ -0,0 +1,11 @@
1
+ import type { Rule } from 'eslint';
2
+ import { type ExportNamedDeclaration, type ImportDeclaration } from 'eslint-codemod-utils';
3
+ type ReturnObject = {
4
+ checkImportNode: (node: ImportDeclaration & Rule.NodeParentExtension) => void;
5
+ checkExportNode: (node: ExportNamedDeclaration & Rule.NodeParentExtension) => void;
6
+ checkJSXElement: (node: Rule.Node) => void;
7
+ checkIdentifier: (node: Rule.Node) => void;
8
+ throwErrors: () => void;
9
+ };
10
+ export declare const createChecks: (context: Rule.RuleContext) => ReturnObject;
11
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const importNameWithCustomMessageId = "importNameWithCustomMessage";
2
+ export declare const pathWithCustomMessageId = "pathWithCustomMessage";
@@ -0,0 +1,38 @@
1
+ import type { Rule } from 'eslint';
2
+ import { type ExportNamedDeclaration, type ImportDeclaration, type JSXElement } from 'eslint-codemod-utils';
3
+ import { type DeprecatedImportConfigEntry } from '../../utils/types';
4
+ export type ImportIconDeprecationError = Rule.ReportDescriptor & {
5
+ node: ImportDeclaration;
6
+ };
7
+ export type ExportIconDeprecationError = Rule.ReportDescriptor & {
8
+ node: ExportNamedDeclaration;
9
+ };
10
+ export type ImportIconDeprecationErrorListAuto = {
11
+ [key: string]: ImportIconDeprecationError;
12
+ };
13
+ export type ExportIconDeprecationErrorListAuto = {
14
+ [key: string]: ExportIconDeprecationError;
15
+ };
16
+ type DeprecationIconHandler = (context: Rule.RuleContext) => {
17
+ createImportError: (args: {
18
+ node: ImportDeclaration;
19
+ importSource: string;
20
+ config: DeprecatedImportConfigEntry;
21
+ }) => void;
22
+ createExportError: (args: {
23
+ node: ExportNamedDeclaration;
24
+ importSource: string;
25
+ config: DeprecatedImportConfigEntry;
26
+ }) => void;
27
+ checkJSXElement: (node: JSXElement) => void;
28
+ checkIdentifier: (node: Rule.Node) => void;
29
+ throwErrors: () => void;
30
+ };
31
+ /**
32
+ * __Deprecation icon handler__
33
+ *
34
+ * A deprecation icon handler which is responsible for displaying an error for deprecated icons.
35
+ * It also includes a fixer to replace the deprecated icon with the new icon if a replacement exists.
36
+ */
37
+ export declare const getDeprecationIconHandler: DeprecationIconHandler;
38
+ export {};
@@ -24,14 +24,6 @@
24
24
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
25
  * THE SOFTWARE.
26
26
  */
27
- import { type TSESLint } from '@typescript-eslint/utils';
28
- import { type DeprecatedConfig } from '../utils/types';
29
27
  export declare const name = "no-deprecated-imports";
30
- export declare const importNameWithCustomMessageId = "importNameWithCustomMessage";
31
- export declare const pathWithCustomMessageId = "pathWithCustomMessage";
32
- declare const rule: TSESLint.RuleModule<string, [
33
- {
34
- deprecatedConfig: DeprecatedConfig;
35
- }
36
- ], TSESLint.RuleListener>;
28
+ declare const rule: import("eslint").Rule.RuleModule;
37
29
  export default rule;
@@ -17,6 +17,7 @@ export type DeprecatedImportConfigEntry = {
17
17
  importName: string;
18
18
  message: string;
19
19
  }[];
20
+ unfixable?: boolean;
20
21
  };
21
22
  export declare const isDeprecatedImportConfig: (config: DeprecatedImportConfig | DeprecatedJSXAttributeConfig) => config is DeprecatedImportConfig;
22
23
  export declare const isDeprecatedJSXAttributeConfig: (config: DeprecatedImportConfig | DeprecatedJSXAttributeConfig) => config is DeprecatedJSXAttributeConfig;
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": "10.25.0",
4
+ "version": "11.0.0",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -44,7 +44,8 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@atlaskit/eslint-utils": "^1.7.0",
47
- "@atlaskit/icon": "^22.24.0",
47
+ "@atlaskit/icon": "^22.26.0",
48
+ "@atlaskit/icon-lab": "^1.2.0",
48
49
  "@atlaskit/tokens": "*",
49
50
  "@babel/runtime": "^7.0.0",
50
51
  "@typescript-eslint/utils": "^5.48.1",