@atlaskit/eslint-plugin-design-system 10.12.1 → 10.12.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/rules/no-legacy-icons/checks.js +3 -4
  3. package/dist/cjs/rules/no-legacy-icons/helpers.js +22 -17
  4. package/dist/cjs/rules/use-heading/config/index.js +1 -0
  5. package/dist/cjs/rules/use-heading/index.js +3 -2
  6. package/dist/cjs/rules/use-latest-xcss-syntax-typography/config/index.js +12 -0
  7. package/dist/cjs/rules/use-latest-xcss-syntax-typography/index.js +5 -2
  8. package/dist/cjs/rules/use-primitives-text/config/index.js +1 -0
  9. package/dist/cjs/rules/use-primitives-text/index.js +3 -2
  10. package/dist/cjs/rules/use-tokens-typography/config/index.js +3 -0
  11. package/dist/es2019/rules/no-legacy-icons/checks.js +1 -2
  12. package/dist/es2019/rules/no-legacy-icons/helpers.js +13 -10
  13. package/dist/es2019/rules/use-heading/config/index.js +1 -0
  14. package/dist/es2019/rules/use-heading/index.js +3 -2
  15. package/dist/es2019/rules/use-latest-xcss-syntax-typography/config/index.js +6 -0
  16. package/dist/es2019/rules/use-latest-xcss-syntax-typography/index.js +5 -2
  17. package/dist/es2019/rules/use-primitives-text/config/index.js +1 -0
  18. package/dist/es2019/rules/use-primitives-text/index.js +3 -2
  19. package/dist/es2019/rules/use-tokens-typography/config/index.js +3 -0
  20. package/dist/esm/rules/no-legacy-icons/checks.js +1 -2
  21. package/dist/esm/rules/no-legacy-icons/helpers.js +21 -16
  22. package/dist/esm/rules/use-heading/config/index.js +1 -0
  23. package/dist/esm/rules/use-heading/index.js +3 -2
  24. package/dist/esm/rules/use-latest-xcss-syntax-typography/config/index.js +6 -0
  25. package/dist/esm/rules/use-latest-xcss-syntax-typography/index.js +5 -2
  26. package/dist/esm/rules/use-primitives-text/config/index.js +1 -0
  27. package/dist/esm/rules/use-primitives-text/index.js +3 -2
  28. package/dist/esm/rules/use-tokens-typography/config/index.js +3 -0
  29. package/dist/types/rules/no-legacy-icons/helpers.d.ts +5 -14
  30. package/dist/types/rules/use-heading/config/index.d.ts +1 -0
  31. package/dist/types/rules/use-latest-xcss-syntax-typography/config/index.d.ts +4 -0
  32. package/dist/types/rules/use-primitives-text/config/index.d.ts +1 -0
  33. package/dist/types-ts4.5/rules/no-legacy-icons/helpers.d.ts +10 -14
  34. package/dist/types-ts4.5/rules/use-heading/config/index.d.ts +1 -0
  35. package/dist/types-ts4.5/rules/use-latest-xcss-syntax-typography/config/index.d.ts +4 -0
  36. package/dist/types-ts4.5/rules/use-primitives-text/config/index.d.ts +1 -0
  37. package/package.json +2 -1
  38. package/dist/cjs/rules/no-legacy-icons/migration-map-temp.js +0 -4090
  39. package/dist/es2019/rules/no-legacy-icons/migration-map-temp.js +0 -4082
  40. package/dist/esm/rules/no-legacy-icons/migration-map-temp.js +0 -4084
  41. package/dist/types/rules/no-legacy-icons/migration-map-temp.d.ts +0 -22
  42. package/dist/types-ts4.5/rules/no-legacy-icons/migration-map-temp.d.ts +0 -27
@@ -1,6 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
2
  import { type JSXAttribute, type Node } from 'eslint-codemod-utils';
3
- import { type Size } from './migration-map-temp';
4
3
  export type iconMigrationError = Rule.ReportDescriptor;
5
4
  export type errorsListManual = {
6
5
  [loc: string]: {
@@ -15,24 +14,15 @@ export type errorsListAuto = {
15
14
  export type guidanceList = {
16
15
  [loc: string]: string;
17
16
  };
17
+ declare const sizes: readonly ["small", "medium", "large", "xlarge"];
18
+ export type Size = (typeof sizes)[number];
19
+ export declare const isSize: (size: any) => size is "small" | "medium" | "large" | "xlarge";
18
20
  /**
19
21
  * Returns the migration map object for a legacy icon or null if not found
20
22
  * @param iconPackage The name of the legacy icon package
21
23
  * @returns The migration map object for the legacy icon or null if not found
22
24
  */
23
- export declare const getMigrationMapObject: (iconPackage: string) => {
24
- sizeGuidance: {
25
- small: string;
26
- medium: string;
27
- large: string;
28
- xlarge: string;
29
- };
30
- newIcon?: {
31
- name: string;
32
- type: string;
33
- library: string;
34
- } | undefined;
35
- } | null;
25
+ export declare const getMigrationMapObject: (iconPackage: string) => any;
36
26
  /**
37
27
  * Checks if a new icon can be auto-migrated based on guidance from the migration map
38
28
  */
@@ -65,3 +55,4 @@ export declare const createHelpers: (context: Rule.RuleContext) => {
65
55
  getTokenCallValue: (value: any) => string | undefined;
66
56
  getConfigFlag: (key: string, defaultValue: boolean) => boolean;
67
57
  };
58
+ export {};
@@ -1,5 +1,6 @@
1
1
  type Pattern = 'native-elements';
2
2
  export interface RuleConfig {
3
+ failSilently: boolean;
3
4
  patterns: Pattern[];
4
5
  enableUnsafeAutofix: false;
5
6
  }
@@ -0,0 +1,4 @@
1
+ export interface RuleConfig {
2
+ failSilently: boolean;
3
+ }
4
+ export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
@@ -1,5 +1,6 @@
1
1
  type Pattern = 'paragraph-elements' | 'span-elements' | 'strong-elements' | 'emphasis-elements';
2
2
  export interface RuleConfig {
3
+ failSilently: boolean;
3
4
  patterns: Pattern[];
4
5
  inheritColor: boolean;
5
6
  enableUnsafeAutofix: boolean;
@@ -1,6 +1,5 @@
1
1
  import type { Rule } from 'eslint';
2
2
  import { type JSXAttribute, type Node } from 'eslint-codemod-utils';
3
- import { type Size } from './migration-map-temp';
4
3
  export type iconMigrationError = Rule.ReportDescriptor;
5
4
  export type errorsListManual = {
6
5
  [loc: string]: {
@@ -15,24 +14,20 @@ export type errorsListAuto = {
15
14
  export type guidanceList = {
16
15
  [loc: string]: string;
17
16
  };
17
+ declare const sizes: readonly [
18
+ "small",
19
+ "medium",
20
+ "large",
21
+ "xlarge"
22
+ ];
23
+ export type Size = (typeof sizes)[number];
24
+ export declare const isSize: (size: any) => size is "small" | "medium" | "large" | "xlarge";
18
25
  /**
19
26
  * Returns the migration map object for a legacy icon or null if not found
20
27
  * @param iconPackage The name of the legacy icon package
21
28
  * @returns The migration map object for the legacy icon or null if not found
22
29
  */
23
- export declare const getMigrationMapObject: (iconPackage: string) => {
24
- sizeGuidance: {
25
- small: string;
26
- medium: string;
27
- large: string;
28
- xlarge: string;
29
- };
30
- newIcon?: {
31
- name: string;
32
- type: string;
33
- library: string;
34
- } | undefined;
35
- } | null;
30
+ export declare const getMigrationMapObject: (iconPackage: string) => any;
36
31
  /**
37
32
  * Checks if a new icon can be auto-migrated based on guidance from the migration map
38
33
  */
@@ -65,3 +60,4 @@ export declare const createHelpers: (context: Rule.RuleContext) => {
65
60
  getTokenCallValue: (value: any) => string | undefined;
66
61
  getConfigFlag: (key: string, defaultValue: boolean) => boolean;
67
62
  };
63
+ export {};
@@ -1,5 +1,6 @@
1
1
  type Pattern = 'native-elements';
2
2
  export interface RuleConfig {
3
+ failSilently: boolean;
3
4
  patterns: Pattern[];
4
5
  enableUnsafeAutofix: false;
5
6
  }
@@ -0,0 +1,4 @@
1
+ export interface RuleConfig {
2
+ failSilently: boolean;
3
+ }
4
+ export declare const getConfig: (overrides: Partial<RuleConfig>) => RuleConfig;
@@ -1,5 +1,6 @@
1
1
  type Pattern = 'paragraph-elements' | 'span-elements' | 'strong-elements' | 'emphasis-elements';
2
2
  export interface RuleConfig {
3
+ failSilently: boolean;
3
4
  patterns: Pattern[];
4
5
  inheritColor: boolean;
5
6
  enableUnsafeAutofix: boolean;
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.12.1",
4
+ "version": "10.12.3",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
7
7
  "publishConfig": {
@@ -42,6 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "@atlaskit/eslint-utils": "^1.6.0",
45
+ "@atlaskit/icon": "^22.10.0",
45
46
  "@atlaskit/tokens": "*",
46
47
  "@babel/runtime": "^7.0.0",
47
48
  "@typescript-eslint/utils": "^5.48.1",