@atlaskit/eslint-plugin-design-system 9.2.4 → 9.3.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 +17 -0
- package/README.md +1 -0
- package/constellation/index/usage.mdx +1 -0
- package/constellation/use-heading/usage.mdx +28 -0
- package/dist/cjs/ast-nodes/root.js +32 -0
- package/dist/cjs/presets/all.codegen.js +2 -1
- package/dist/cjs/rules/index.codegen.js +3 -1
- package/dist/cjs/rules/use-heading/config/index.js +15 -0
- package/dist/cjs/rules/use-heading/index.js +39 -0
- package/dist/cjs/rules/use-heading/transformers/common.js +19 -0
- package/dist/cjs/rules/use-heading/transformers/index.js +12 -0
- package/dist/cjs/rules/use-heading/transformers/native-elements.js +99 -0
- package/dist/cjs/rules/use-primitives/transformers/compiled-styled/index.js +1 -2
- package/dist/cjs/rules/use-primitives/transformers/emotion-css/index.js +1 -2
- package/dist/cjs/rules/use-primitives/utils/validate-styles.js +10 -3
- package/dist/cjs/rules/use-primitives-text/transformers/emphasis-elements.js +1 -2
- package/dist/cjs/rules/use-primitives-text/transformers/paragraph-elements.js +2 -3
- package/dist/cjs/rules/use-primitives-text/transformers/span-elements.js +1 -2
- package/dist/cjs/rules/use-primitives-text/transformers/strong-elements.js +1 -2
- package/dist/cjs/rules/use-tokens-space/transformers/style-property/index.js +1 -2
- package/dist/cjs/rules/utils/create-rule.js +4 -7
- package/dist/es2019/ast-nodes/root.js +34 -0
- package/dist/es2019/presets/all.codegen.js +2 -1
- package/dist/es2019/rules/index.codegen.js +3 -1
- package/dist/es2019/rules/use-heading/config/index.js +9 -0
- package/dist/es2019/rules/use-heading/index.js +33 -0
- package/dist/es2019/rules/use-heading/transformers/common.js +9 -0
- package/dist/es2019/rules/use-heading/transformers/index.js +1 -0
- package/dist/es2019/rules/use-heading/transformers/native-elements.js +89 -0
- package/dist/es2019/rules/use-primitives/transformers/compiled-styled/index.js +1 -2
- package/dist/es2019/rules/use-primitives/transformers/emotion-css/index.js +1 -2
- package/dist/es2019/rules/use-primitives/utils/validate-styles.js +10 -3
- package/dist/es2019/rules/use-primitives-text/transformers/emphasis-elements.js +1 -2
- package/dist/es2019/rules/use-primitives-text/transformers/paragraph-elements.js +2 -3
- package/dist/es2019/rules/use-primitives-text/transformers/span-elements.js +1 -2
- package/dist/es2019/rules/use-primitives-text/transformers/strong-elements.js +1 -2
- package/dist/es2019/rules/use-tokens-space/transformers/style-property/index.js +1 -2
- package/dist/es2019/rules/utils/create-rule.js +4 -6
- package/dist/esm/ast-nodes/root.js +32 -0
- package/dist/esm/presets/all.codegen.js +2 -1
- package/dist/esm/rules/index.codegen.js +3 -1
- package/dist/esm/rules/use-heading/config/index.js +9 -0
- package/dist/esm/rules/use-heading/index.js +33 -0
- package/dist/esm/rules/use-heading/transformers/common.js +9 -0
- package/dist/esm/rules/use-heading/transformers/index.js +1 -0
- package/dist/esm/rules/use-heading/transformers/native-elements.js +89 -0
- package/dist/esm/rules/use-primitives/transformers/compiled-styled/index.js +1 -2
- package/dist/esm/rules/use-primitives/transformers/emotion-css/index.js +1 -2
- package/dist/esm/rules/use-primitives/utils/validate-styles.js +10 -3
- package/dist/esm/rules/use-primitives-text/transformers/emphasis-elements.js +1 -2
- package/dist/esm/rules/use-primitives-text/transformers/paragraph-elements.js +2 -3
- package/dist/esm/rules/use-primitives-text/transformers/span-elements.js +1 -2
- package/dist/esm/rules/use-primitives-text/transformers/strong-elements.js +1 -2
- package/dist/esm/rules/use-tokens-space/transformers/style-property/index.js +1 -2
- package/dist/esm/rules/utils/create-rule.js +4 -6
- package/dist/types/ast-nodes/jsx-element.d.ts +2 -2
- package/dist/types/ast-nodes/root.d.ts +8 -0
- package/dist/types/index.codegen.d.ts +1 -0
- package/dist/types/presets/all.codegen.d.ts +2 -1
- package/dist/types/rules/ensure-design-token-usage/rule-meta.d.ts +1 -1
- package/dist/types/rules/index.codegen.d.ts +1 -0
- package/dist/types/rules/use-heading/config/index.d.ts +6 -0
- package/dist/types/rules/use-heading/index.d.ts +3 -0
- package/dist/types/rules/use-heading/transformers/common.d.ts +9 -0
- package/dist/types/rules/use-heading/transformers/index.d.ts +1 -0
- package/dist/types/rules/use-heading/transformers/native-elements.d.ts +18 -0
- package/dist/types/rules/utils/create-rule.d.ts +1 -37
- package/dist/types-ts4.5/ast-nodes/jsx-element.d.ts +2 -2
- package/dist/types-ts4.5/ast-nodes/root.d.ts +8 -0
- package/dist/types-ts4.5/index.codegen.d.ts +1 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +2 -1
- package/dist/types-ts4.5/rules/ensure-design-token-usage/rule-meta.d.ts +1 -1
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -0
- package/dist/types-ts4.5/rules/use-heading/config/index.d.ts +6 -0
- package/dist/types-ts4.5/rules/use-heading/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/use-heading/transformers/common.d.ts +9 -0
- package/dist/types-ts4.5/rules/use-heading/transformers/index.d.ts +1 -0
- package/dist/types-ts4.5/rules/use-heading/transformers/native-elements.d.ts +18 -0
- package/dist/types-ts4.5/rules/utils/create-rule.d.ts +1 -37
- package/package.json +2 -2
- package/dist/cjs/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.js +0 -37
- package/dist/cjs/rules/use-primitives/transformers/emotion-css/upsert-import-declaration.js +0 -37
- package/dist/cjs/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.js +0 -37
- package/dist/es2019/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.js +0 -30
- package/dist/es2019/rules/use-primitives/transformers/emotion-css/upsert-import-declaration.js +0 -30
- package/dist/es2019/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.js +0 -30
- package/dist/esm/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.js +0 -29
- package/dist/esm/rules/use-primitives/transformers/emotion-css/upsert-import-declaration.js +0 -29
- package/dist/esm/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.js +0 -29
- package/dist/types/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.d.ts +0 -14
- package/dist/types/rules/use-primitives/transformers/emotion-css/upsert-import-declaration.d.ts +0 -14
- package/dist/types/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.d.ts +0 -14
- package/dist/types-ts4.5/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.d.ts +0 -14
- package/dist/types-ts4.5/rules/use-primitives/transformers/emotion-css/upsert-import-declaration.d.ts +0 -14
- package/dist/types-ts4.5/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.d.ts +0 -14
package/dist/es2019/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as ast from '../../../../ast-nodes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Currently this is defined here because it's not very general purpose.
|
|
5
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
6
|
-
* and the other half would be in `Import`.
|
|
7
|
-
*
|
|
8
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
9
|
-
*
|
|
10
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
11
|
-
*/
|
|
12
|
-
export const upsertImportDeclaration = ({
|
|
13
|
-
module,
|
|
14
|
-
specifiers
|
|
15
|
-
}, context, fixer) => {
|
|
16
|
-
// Find any imports that match the packageName
|
|
17
|
-
const root = context.getSourceCode().ast.body;
|
|
18
|
-
const importDeclarations = ast.Root.findImportsByModule(root, module);
|
|
19
|
-
|
|
20
|
-
// The import doesn't exist yet, we can just insert a whole new one
|
|
21
|
-
if (importDeclarations.length === 0) {
|
|
22
|
-
return ast.Root.insertImport(root, {
|
|
23
|
-
module,
|
|
24
|
-
specifiers
|
|
25
|
-
}, fixer);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// The import exists so, modify the existing one
|
|
29
|
-
return ast.Import.insertNamedSpecifiers(importDeclarations[0], specifiers, fixer);
|
|
30
|
-
};
|
package/dist/es2019/rules/use-primitives/transformers/emotion-css/upsert-import-declaration.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as ast from '../../../../ast-nodes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Currently this is defined here because it's not very general purpose.
|
|
5
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
6
|
-
* and the other half would be in `Import`.
|
|
7
|
-
*
|
|
8
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
9
|
-
*
|
|
10
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
11
|
-
*/
|
|
12
|
-
export const upsertImportDeclaration = ({
|
|
13
|
-
module,
|
|
14
|
-
specifiers
|
|
15
|
-
}, context, fixer) => {
|
|
16
|
-
// Find any imports that match the packageName
|
|
17
|
-
const root = context.getSourceCode().ast.body;
|
|
18
|
-
const importDeclarations = ast.Root.findImportsByModule(root, module);
|
|
19
|
-
|
|
20
|
-
// The import doesn't exist yet, we can just insert a whole new one
|
|
21
|
-
if (importDeclarations.length === 0) {
|
|
22
|
-
return ast.Root.insertImport(root, {
|
|
23
|
-
module,
|
|
24
|
-
specifiers
|
|
25
|
-
}, fixer);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// The import exists so, modify the existing one
|
|
29
|
-
return ast.Import.insertNamedSpecifiers(importDeclarations[0], specifiers, fixer);
|
|
30
|
-
};
|
package/dist/es2019/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as ast from '../../../../ast-nodes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Currently this is defined here because it's not very general purpose.
|
|
5
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
6
|
-
* and the other half would be in `Import`.
|
|
7
|
-
*
|
|
8
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
9
|
-
*
|
|
10
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
11
|
-
*/
|
|
12
|
-
export const upsertImportDeclaration = ({
|
|
13
|
-
module,
|
|
14
|
-
specifiers
|
|
15
|
-
}, context, fixer) => {
|
|
16
|
-
// Find any imports that match the packageName
|
|
17
|
-
const root = context.getSourceCode().ast.body;
|
|
18
|
-
const importDeclarations = ast.Root.findImportsByModule(root, module);
|
|
19
|
-
|
|
20
|
-
// The import doesn't exist yet, we can just insert a whole new one
|
|
21
|
-
if (importDeclarations.length === 0) {
|
|
22
|
-
return ast.Root.insertImport(root, {
|
|
23
|
-
module,
|
|
24
|
-
specifiers
|
|
25
|
-
}, fixer);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// The import exists so, modify the existing one
|
|
29
|
-
return ast.Import.insertNamedSpecifiers(importDeclarations[0], specifiers, fixer);
|
|
30
|
-
};
|
package/dist/esm/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as ast from '../../../../ast-nodes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Currently this is defined here because it's not very general purpose.
|
|
5
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
6
|
-
* and the other half would be in `Import`.
|
|
7
|
-
*
|
|
8
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
9
|
-
*
|
|
10
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
11
|
-
*/
|
|
12
|
-
export var upsertImportDeclaration = function upsertImportDeclaration(_ref, context, fixer) {
|
|
13
|
-
var module = _ref.module,
|
|
14
|
-
specifiers = _ref.specifiers;
|
|
15
|
-
// Find any imports that match the packageName
|
|
16
|
-
var root = context.getSourceCode().ast.body;
|
|
17
|
-
var importDeclarations = ast.Root.findImportsByModule(root, module);
|
|
18
|
-
|
|
19
|
-
// The import doesn't exist yet, we can just insert a whole new one
|
|
20
|
-
if (importDeclarations.length === 0) {
|
|
21
|
-
return ast.Root.insertImport(root, {
|
|
22
|
-
module: module,
|
|
23
|
-
specifiers: specifiers
|
|
24
|
-
}, fixer);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// The import exists so, modify the existing one
|
|
28
|
-
return ast.Import.insertNamedSpecifiers(importDeclarations[0], specifiers, fixer);
|
|
29
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as ast from '../../../../ast-nodes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Currently this is defined here because it's not very general purpose.
|
|
5
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
6
|
-
* and the other half would be in `Import`.
|
|
7
|
-
*
|
|
8
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
9
|
-
*
|
|
10
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
11
|
-
*/
|
|
12
|
-
export var upsertImportDeclaration = function upsertImportDeclaration(_ref, context, fixer) {
|
|
13
|
-
var module = _ref.module,
|
|
14
|
-
specifiers = _ref.specifiers;
|
|
15
|
-
// Find any imports that match the packageName
|
|
16
|
-
var root = context.getSourceCode().ast.body;
|
|
17
|
-
var importDeclarations = ast.Root.findImportsByModule(root, module);
|
|
18
|
-
|
|
19
|
-
// The import doesn't exist yet, we can just insert a whole new one
|
|
20
|
-
if (importDeclarations.length === 0) {
|
|
21
|
-
return ast.Root.insertImport(root, {
|
|
22
|
-
module: module,
|
|
23
|
-
specifiers: specifiers
|
|
24
|
-
}, fixer);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// The import exists so, modify the existing one
|
|
28
|
-
return ast.Import.insertNamedSpecifiers(importDeclarations[0], specifiers, fixer);
|
|
29
|
-
};
|
package/dist/esm/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as ast from '../../../../ast-nodes';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Currently this is defined here because it's not very general purpose.
|
|
5
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
6
|
-
* and the other half would be in `Import`.
|
|
7
|
-
*
|
|
8
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
9
|
-
*
|
|
10
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
11
|
-
*/
|
|
12
|
-
export var upsertImportDeclaration = function upsertImportDeclaration(_ref, context, fixer) {
|
|
13
|
-
var module = _ref.module,
|
|
14
|
-
specifiers = _ref.specifiers;
|
|
15
|
-
// Find any imports that match the packageName
|
|
16
|
-
var root = context.getSourceCode().ast.body;
|
|
17
|
-
var importDeclarations = ast.Root.findImportsByModule(root, module);
|
|
18
|
-
|
|
19
|
-
// The import doesn't exist yet, we can just insert a whole new one
|
|
20
|
-
if (importDeclarations.length === 0) {
|
|
21
|
-
return ast.Root.insertImport(root, {
|
|
22
|
-
module: module,
|
|
23
|
-
specifiers: specifiers
|
|
24
|
-
}, fixer);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// The import exists so, modify the existing one
|
|
28
|
-
return ast.Import.insertNamedSpecifiers(importDeclarations[0], specifiers, fixer);
|
|
29
|
-
};
|
package/dist/types/rules/use-primitives/transformers/compiled-styled/upsert-import-declaration.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Rule } from 'eslint';
|
|
2
|
-
/**
|
|
3
|
-
* Currently this is defined here because it's not very general purpose.
|
|
4
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
5
|
-
* and the other half would be in `Import`.
|
|
6
|
-
*
|
|
7
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
8
|
-
*
|
|
9
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
10
|
-
*/
|
|
11
|
-
export declare const upsertImportDeclaration: ({ module, specifiers, }: {
|
|
12
|
-
module: string;
|
|
13
|
-
specifiers: string[];
|
|
14
|
-
}, context: Rule.RuleContext, fixer: Rule.RuleFixer) => Rule.Fix | undefined;
|
package/dist/types/rules/use-primitives/transformers/emotion-css/upsert-import-declaration.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Rule } from 'eslint';
|
|
2
|
-
/**
|
|
3
|
-
* Currently this is defined here because it's not very general purpose.
|
|
4
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
5
|
-
* and the other half would be in `Import`.
|
|
6
|
-
*
|
|
7
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
8
|
-
*
|
|
9
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
10
|
-
*/
|
|
11
|
-
export declare const upsertImportDeclaration: ({ module, specifiers, }: {
|
|
12
|
-
module: string;
|
|
13
|
-
specifiers: string[];
|
|
14
|
-
}, context: Rule.RuleContext, fixer: Rule.RuleFixer) => Rule.Fix | undefined;
|
package/dist/types/rules/use-tokens-space/transformers/style-property/upsert-import-declaration.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Rule } from 'eslint';
|
|
2
|
-
/**
|
|
3
|
-
* Currently this is defined here because it's not very general purpose.
|
|
4
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
5
|
-
* and the other half would be in `Import`.
|
|
6
|
-
*
|
|
7
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
8
|
-
*
|
|
9
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
10
|
-
*/
|
|
11
|
-
export declare const upsertImportDeclaration: ({ module, specifiers, }: {
|
|
12
|
-
module: string;
|
|
13
|
-
specifiers: string[];
|
|
14
|
-
}, context: Rule.RuleContext, fixer: Rule.RuleFixer) => Rule.Fix | undefined;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Rule } from 'eslint';
|
|
2
|
-
/**
|
|
3
|
-
* Currently this is defined here because it's not very general purpose.
|
|
4
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
5
|
-
* and the other half would be in `Import`.
|
|
6
|
-
*
|
|
7
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
8
|
-
*
|
|
9
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
10
|
-
*/
|
|
11
|
-
export declare const upsertImportDeclaration: ({ module, specifiers, }: {
|
|
12
|
-
module: string;
|
|
13
|
-
specifiers: string[];
|
|
14
|
-
}, context: Rule.RuleContext, fixer: Rule.RuleFixer) => Rule.Fix | undefined;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Rule } from 'eslint';
|
|
2
|
-
/**
|
|
3
|
-
* Currently this is defined here because it's not very general purpose.
|
|
4
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
5
|
-
* and the other half would be in `Import`.
|
|
6
|
-
*
|
|
7
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
8
|
-
*
|
|
9
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
10
|
-
*/
|
|
11
|
-
export declare const upsertImportDeclaration: ({ module, specifiers, }: {
|
|
12
|
-
module: string;
|
|
13
|
-
specifiers: string[];
|
|
14
|
-
}, context: Rule.RuleContext, fixer: Rule.RuleFixer) => Rule.Fix | undefined;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Rule } from 'eslint';
|
|
2
|
-
/**
|
|
3
|
-
* Currently this is defined here because it's not very general purpose.
|
|
4
|
-
* If we were to move this to `ast-nodes`, half the implementation would be in `Root`,
|
|
5
|
-
* and the other half would be in `Import`.
|
|
6
|
-
*
|
|
7
|
-
* TODO: Refactor and move to `ast-nodes`
|
|
8
|
-
*
|
|
9
|
-
* Note: It does not handle default imports, namespace imports, or aliased imports.
|
|
10
|
-
*/
|
|
11
|
-
export declare const upsertImportDeclaration: ({ module, specifiers, }: {
|
|
12
|
-
module: string;
|
|
13
|
-
specifiers: string[];
|
|
14
|
-
}, context: Rule.RuleContext, fixer: Rule.RuleFixer) => Rule.Fix | undefined;
|