@atlaskit/eslint-plugin-design-system 8.23.1 → 8.23.2
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 +6 -0
- package/dist/cjs/ast-nodes/function-call.js +48 -0
- package/dist/cjs/ast-nodes/import.js +49 -0
- package/dist/cjs/ast-nodes/index.js +40 -0
- package/dist/cjs/ast-nodes/jsx-attribute.js +64 -0
- package/dist/cjs/ast-nodes/jsx-element.js +55 -0
- package/dist/cjs/ast-nodes/root.js +34 -0
- package/dist/cjs/rules/use-primitives/index.js +6 -76
- package/dist/cjs/rules/use-primitives/transformers/emotion-css/index.js +168 -0
- package/dist/cjs/rules/use-primitives/transformers/emotion-css/supported.js +52 -0
- package/dist/cjs/rules/use-primitives/utils/is-valid-css-properties-to-transform.js +3 -0
- package/dist/es2019/ast-nodes/function-call.js +42 -0
- package/dist/es2019/ast-nodes/import.js +42 -0
- package/dist/es2019/ast-nodes/index.js +5 -0
- package/dist/es2019/ast-nodes/jsx-attribute.js +59 -0
- package/dist/es2019/ast-nodes/jsx-element.js +50 -0
- package/dist/es2019/ast-nodes/root.js +28 -0
- package/dist/es2019/rules/use-primitives/index.js +9 -79
- package/dist/es2019/rules/use-primitives/transformers/emotion-css/index.js +159 -0
- package/dist/es2019/rules/use-primitives/transformers/emotion-css/supported.js +46 -0
- package/dist/es2019/rules/use-primitives/utils/is-valid-css-properties-to-transform.js +3 -0
- package/dist/esm/ast-nodes/function-call.js +42 -0
- package/dist/esm/ast-nodes/import.js +43 -0
- package/dist/esm/ast-nodes/index.js +5 -0
- package/dist/esm/ast-nodes/jsx-attribute.js +59 -0
- package/dist/esm/ast-nodes/jsx-element.js +50 -0
- package/dist/esm/ast-nodes/root.js +28 -0
- package/dist/esm/rules/use-primitives/index.js +9 -79
- package/dist/esm/rules/use-primitives/transformers/emotion-css/index.js +158 -0
- package/dist/esm/rules/use-primitives/transformers/emotion-css/supported.js +46 -0
- package/dist/esm/rules/use-primitives/utils/is-valid-css-properties-to-transform.js +3 -0
- package/dist/types/ast-nodes/function-call.d.ts +21 -0
- package/dist/types/ast-nodes/import.d.ts +16 -0
- package/dist/types/ast-nodes/index.d.ts +5 -0
- package/dist/types/ast-nodes/jsx-attribute.d.ts +26 -0
- package/dist/types/ast-nodes/jsx-element.d.ts +21 -0
- package/dist/types/ast-nodes/root.d.ts +19 -0
- package/dist/types/rules/use-primitives/transformers/emotion-css/index.d.ts +35 -0
- package/dist/types/rules/use-primitives/transformers/emotion-css/supported.d.ts +9 -0
- package/dist/types-ts4.5/ast-nodes/function-call.d.ts +21 -0
- package/dist/types-ts4.5/ast-nodes/import.d.ts +16 -0
- package/dist/types-ts4.5/ast-nodes/index.d.ts +5 -0
- package/dist/types-ts4.5/ast-nodes/jsx-attribute.d.ts +26 -0
- package/dist/types-ts4.5/ast-nodes/jsx-element.d.ts +21 -0
- package/dist/types-ts4.5/ast-nodes/root.d.ts +19 -0
- package/dist/types-ts4.5/rules/use-primitives/transformers/emotion-css/index.d.ts +35 -0
- package/dist/types-ts4.5/rules/use-primitives/transformers/emotion-css/supported.d.ts +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type { Rule } from 'eslint';
|
|
3
|
+
import { Directive, ImportDeclaration, insertImportDeclaration, ModuleDeclaration, Statement } from 'eslint-codemod-utils';
|
|
4
|
+
type ImportData = Parameters<typeof insertImportDeclaration>[1];
|
|
5
|
+
export declare const Root: {
|
|
6
|
+
/**
|
|
7
|
+
* Note: This can return multiple ImportDeclarations for cases like:
|
|
8
|
+
* ```
|
|
9
|
+
* import { Stack } from '@atlaskit/primitives'
|
|
10
|
+
* import type { StackProps } from '@atlaskit/primitives'
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
findImportsByModule(root: (Directive | Statement | ModuleDeclaration)[], name: string): ImportDeclaration[];
|
|
14
|
+
insertImport(root: (Directive | Statement | ModuleDeclaration)[], data: {
|
|
15
|
+
module: string;
|
|
16
|
+
specifiers: ImportData;
|
|
17
|
+
}, fixer: Rule.RuleFixer): Rule.Fix;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Rule } from 'eslint';
|
|
2
|
+
import { JSXElement } from 'eslint-codemod-utils';
|
|
3
|
+
import { RuleConfig } from '../../config';
|
|
4
|
+
interface MetaData {
|
|
5
|
+
context: Rule.RuleContext;
|
|
6
|
+
config: RuleConfig;
|
|
7
|
+
}
|
|
8
|
+
type FixFunction = (fixer: Rule.RuleFixer) => Rule.Fix[];
|
|
9
|
+
export declare const EmotionCSS: {
|
|
10
|
+
lint(node: Rule.Node, { context, config }: MetaData): void;
|
|
11
|
+
_check(node: Rule.Node, { context, config }: MetaData): boolean;
|
|
12
|
+
_fix(node: JSXElement, { context }: {
|
|
13
|
+
context: Rule.RuleContext;
|
|
14
|
+
}): FixFunction;
|
|
15
|
+
/**
|
|
16
|
+
* Check that every attribute in the JSXElement is something we support.
|
|
17
|
+
* We do this via a whitelist in `this.attributes`. The result is we exclude
|
|
18
|
+
* dangerous attrs like `id` and `style`.
|
|
19
|
+
*/
|
|
20
|
+
_containsOnlySupportedAttributes(node: JSXElement): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Currently this is defined here because it's not very general purpose.
|
|
23
|
+
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
24
|
+
* and the other half would be in `Import`.
|
|
25
|
+
*
|
|
26
|
+
* TODO: Refactor and move to `ast-nodes`
|
|
27
|
+
*
|
|
28
|
+
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
29
|
+
*/
|
|
30
|
+
_upsertImportDeclaration({ module, specifiers, }: {
|
|
31
|
+
module: string;
|
|
32
|
+
specifiers: string[];
|
|
33
|
+
}, context: Rule.RuleContext, fixer: Rule.RuleFixer): Rule.Fix | undefined;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
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": "8.23.
|
|
4
|
+
"version": "8.23.2",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|