@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.
- package/CHANGELOG.md +22 -0
- package/README.md +1 -1
- package/dist/cjs/rules/no-deprecated-imports/checks.js +201 -0
- package/dist/cjs/rules/no-deprecated-imports/constants.js +8 -0
- package/dist/cjs/rules/no-deprecated-imports/handlers/icon.js +204 -0
- package/dist/cjs/rules/no-deprecated-imports/index.js +25 -118
- package/dist/cjs/rules/use-tokens-typography/config/index.js +3 -1
- package/dist/cjs/rules/utils/create-no-tagged-template-expression-rule/index.js +3 -0
- package/dist/cjs/rules/utils/get-deprecated-config.js +9 -1
- package/dist/es2019/rules/no-deprecated-imports/checks.js +175 -0
- package/dist/es2019/rules/no-deprecated-imports/constants.js +2 -0
- package/dist/es2019/rules/no-deprecated-imports/handlers/icon.js +153 -0
- package/dist/es2019/rules/no-deprecated-imports/index.js +23 -103
- package/dist/es2019/rules/use-tokens-typography/config/index.js +3 -1
- package/dist/es2019/rules/utils/create-no-tagged-template-expression-rule/index.js +3 -0
- package/dist/es2019/rules/utils/get-deprecated-config.js +12 -1
- package/dist/esm/rules/no-deprecated-imports/checks.js +195 -0
- package/dist/esm/rules/no-deprecated-imports/constants.js +2 -0
- package/dist/esm/rules/no-deprecated-imports/handlers/icon.js +197 -0
- package/dist/esm/rules/no-deprecated-imports/index.js +23 -117
- package/dist/esm/rules/use-tokens-typography/config/index.js +3 -1
- package/dist/esm/rules/utils/create-no-tagged-template-expression-rule/index.js +3 -0
- package/dist/esm/rules/utils/get-deprecated-config.js +9 -1
- package/dist/types/index.codegen.d.ts +3 -9
- package/dist/types/rules/index.codegen.d.ts +1 -3
- package/dist/types/rules/no-deprecated-imports/checks.d.ts +11 -0
- package/dist/types/rules/no-deprecated-imports/constants.d.ts +2 -0
- package/dist/types/rules/no-deprecated-imports/handlers/icon.d.ts +38 -0
- package/dist/types/rules/no-deprecated-imports/index.d.ts +1 -7
- package/dist/types/rules/utils/types.d.ts +1 -0
- package/dist/types-ts4.5/index.codegen.d.ts +3 -15
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -5
- package/dist/types-ts4.5/rules/no-deprecated-imports/checks.d.ts +11 -0
- package/dist/types-ts4.5/rules/no-deprecated-imports/constants.d.ts +2 -0
- package/dist/types-ts4.5/rules/no-deprecated-imports/handlers/icon.d.ts +38 -0
- package/dist/types-ts4.5/rules/no-deprecated-imports/index.d.ts +1 -9
- package/dist/types-ts4.5/rules/utils/types.d.ts +1 -0
- 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
|
-
|
|
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("
|
|
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("
|
|
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("
|
|
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("
|
|
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,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
|
-
|
|
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": "
|
|
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.
|
|
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",
|