@atlaskit/eslint-plugin-ui-styling-standard 0.2.1 → 0.4.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 +28 -0
- package/README.md +18 -5
- package/build/tsconfig.json +2 -4
- package/constellation/consistent-css-prop-usage/usage.mdx +5 -0
- package/constellation/index/overview.mdx +219 -0
- package/constellation/index/props.mdx +33 -0
- package/constellation/local-cx-xcss/usage.mdx +37 -0
- package/constellation/no-css-tagged-template-expression/usage.mdx +5 -0
- package/constellation/no-empty-styled-expression/usage.mdx +5 -0
- package/constellation/no-exported-css/usage.mdx +5 -0
- package/constellation/no-exported-keyframes/usage.mdx +5 -0
- package/constellation/no-invalid-css-map/usage.mdx +5 -0
- package/constellation/no-js-xcss/usage.mdx +23 -0
- package/constellation/no-keyframes-tagged-template-expression/usage.mdx +5 -0
- package/constellation/no-styled-tagged-template-expression/usage.mdx +5 -0
- package/constellation/no-suppress-xcss/usage.mdx +25 -0
- package/dist/cjs/index.codegen.js +26 -0
- package/dist/cjs/index.js +12 -12
- package/dist/cjs/presets/all.codegen.js +37 -0
- package/dist/cjs/presets/recommended.codegen.js +37 -0
- package/dist/cjs/rules/external-rules.js +143 -0
- package/dist/cjs/rules/index.codegen.js +16 -0
- package/dist/cjs/rules/local-cx-xcss/index.js +51 -0
- package/dist/cjs/rules/utils/create-rule.js +43 -0
- package/dist/cjs/rules/utils/is-supported-import.js +98 -0
- package/dist/es2019/index.codegen.js +12 -0
- package/dist/es2019/index.js +1 -12
- package/dist/es2019/presets/all.codegen.js +31 -0
- package/dist/es2019/presets/recommended.codegen.js +31 -0
- package/dist/es2019/rules/external-rules.js +138 -0
- package/dist/es2019/rules/index.codegen.js +9 -0
- package/dist/es2019/rules/local-cx-xcss/index.js +45 -0
- package/dist/es2019/rules/utils/create-rule.js +33 -0
- package/dist/es2019/rules/utils/is-supported-import.js +87 -0
- package/dist/esm/index.codegen.js +12 -0
- package/dist/esm/index.js +1 -12
- package/dist/esm/presets/all.codegen.js +31 -0
- package/dist/esm/presets/recommended.codegen.js +31 -0
- package/dist/esm/rules/external-rules.js +138 -0
- package/dist/esm/rules/index.codegen.js +9 -0
- package/dist/esm/rules/local-cx-xcss/index.js +45 -0
- package/dist/esm/rules/utils/create-rule.js +35 -0
- package/dist/esm/rules/utils/is-supported-import.js +90 -0
- package/dist/types/index.codegen.d.ts +55 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/presets/all.codegen.d.ts +32 -0
- package/dist/types/presets/recommended.codegen.d.ts +32 -0
- package/dist/types/rules/external-rules.d.ts +11 -0
- package/dist/types/rules/index.codegen.d.ts +4 -0
- package/dist/types/rules/local-cx-xcss/index.d.ts +3 -0
- package/dist/types/rules/utils/create-rule.d.ts +64 -0
- package/dist/types/rules/utils/is-supported-import.d.ts +34 -0
- package/dist/types-ts4.5/index.codegen.d.ts +55 -0
- package/dist/types-ts4.5/index.d.ts +1 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +32 -0
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +32 -0
- package/dist/types-ts4.5/rules/external-rules.d.ts +11 -0
- package/dist/types-ts4.5/rules/index.codegen.d.ts +4 -0
- package/dist/types-ts4.5/rules/local-cx-xcss/index.d.ts +3 -0
- package/dist/types-ts4.5/rules/utils/create-rule.d.ts +64 -0
- package/dist/types-ts4.5/rules/utils/is-supported-import.d.ts +34 -0
- package/package.json +21 -8
- package/scripts/codegen.tsx +439 -0
- package/src/index.codegen.tsx +14 -0
- package/src/index.tsx +1 -17
- package/src/presets/all.codegen.tsx +67 -0
- package/src/presets/recommended.codegen.tsx +67 -0
- package/src/rules/TEMPLATE.md +29 -0
- package/src/rules/__tests__/utils/_tester.tsx +40 -0
- package/src/rules/external-rules.tsx +175 -0
- package/src/rules/index.codegen.tsx +10 -0
- package/src/rules/local-cx-xcss/README.md +35 -0
- package/src/rules/local-cx-xcss/__tests__/rule.test.tsx +102 -0
- package/src/rules/local-cx-xcss/index.tsx +69 -0
- package/src/rules/utils/create-rule.tsx +80 -0
- package/src/rules/utils/is-supported-import.tsx +130 -0
- package/tsconfig.app.json +5 -1
- package/tsconfig.dev.json +5 -1
- package/tsconfig.json +7 -6
- package/dist/types/src/index.d.ts +0 -12
- package/dist/types-ts4.5/src/index.d.ts +0 -12
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type LintRuleMeta } from './utils/create-rule';
|
|
2
|
+
/** External rules must be scoped, have a display name, and external urls. */
|
|
3
|
+
export type ExternalRuleMeta = LintRuleMeta & {
|
|
4
|
+
isExternal: true;
|
|
5
|
+
name: `@${string}/${string}`;
|
|
6
|
+
displayName: string;
|
|
7
|
+
docs: {
|
|
8
|
+
externalUrl: `https://${string}`;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const externalRules: ExternalRuleMeta[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import type { Rule } from 'eslint';
|
|
3
|
+
/**
|
|
4
|
+
* We are moving to our own small abstraction to create a lint rule that we have the power
|
|
5
|
+
* to change and mold to our own needs.
|
|
6
|
+
*
|
|
7
|
+
* @see createLintRule
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener = import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>;
|
|
13
|
+
export interface LintRule extends Omit<Rule.RuleModule, 'meta'> {
|
|
14
|
+
/**
|
|
15
|
+
* Including this for backwards compat moving from the typescript-eslint util.
|
|
16
|
+
*/
|
|
17
|
+
name?: never;
|
|
18
|
+
meta: LintRuleMeta;
|
|
19
|
+
}
|
|
20
|
+
export interface LintRuleMeta extends Omit<Rule.RuleMetaData, 'docs'> {
|
|
21
|
+
/**
|
|
22
|
+
* Name of the rule.
|
|
23
|
+
* Must match the folder it is in exactly else build will throw.
|
|
24
|
+
* Add an exception in codegen.tsx for nested rules.
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
docs: {
|
|
28
|
+
/**
|
|
29
|
+
* Short description of what this rule does.
|
|
30
|
+
*/
|
|
31
|
+
description: string;
|
|
32
|
+
/**
|
|
33
|
+
* Specifies the URL at which the full documentation can be accessed.
|
|
34
|
+
*/
|
|
35
|
+
url?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* If this rule should be in the recommended preset or not.
|
|
38
|
+
* Set to `false` to exclude it from the recommended preset.
|
|
39
|
+
*/
|
|
40
|
+
recommended: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The severity level to be applied to this rule.
|
|
43
|
+
* When setting to `"error"` it will mean releasing a breaking change.
|
|
44
|
+
*/
|
|
45
|
+
severity: 'error' | 'warn';
|
|
46
|
+
/**
|
|
47
|
+
* This is configuration passed into the plugin to configure the rule.
|
|
48
|
+
*
|
|
49
|
+
* Eg. `{ excludeReactComponents: true }` would be passed into the plugin config
|
|
50
|
+
*/
|
|
51
|
+
pluginConfig?: Record<string, any>;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Tiny wrapped over the ESLint rule module type that ensures
|
|
56
|
+
* there is a docs link to our ESLint plugin documentation page,
|
|
57
|
+
* as well as improving type support.
|
|
58
|
+
*/
|
|
59
|
+
export declare const createLintRule: (rule: LintRule) => Rule.RuleModule;
|
|
60
|
+
export declare function getRuleUrl(ruleName: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* If it's a nested rule, ensure the url is clean and safe for urls, file paths, etc.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getPathSafeName(ruleName: string): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Rule, Scope } from 'eslint';
|
|
2
|
+
import type { CallExpression } from 'estree';
|
|
3
|
+
type Callee = CallExpression['callee'];
|
|
4
|
+
type Reference = Scope.Reference;
|
|
5
|
+
export declare const CSS_IN_JS_IMPORTS: {
|
|
6
|
+
readonly compiled: "@compiled/react";
|
|
7
|
+
readonly emotionReact: "@emotion/react";
|
|
8
|
+
readonly emotionCore: "@emotion/core";
|
|
9
|
+
readonly styledComponents: "styled-components";
|
|
10
|
+
readonly atlaskitCss: "@atlaskit/css";
|
|
11
|
+
readonly atlaskitPrimitives: "@atlaskit/primitives";
|
|
12
|
+
};
|
|
13
|
+
export type ImportSource = string;
|
|
14
|
+
export type SupportedNameChecker = (nodeToCheck: Callee, referencesInScope: Reference[], importSources: ImportSource[]) => boolean;
|
|
15
|
+
export declare const DEFAULT_IMPORT_SOURCES: ImportSource[];
|
|
16
|
+
/**
|
|
17
|
+
* Given the ESLint rule context, extract and parse the value of the importSources rule option.
|
|
18
|
+
* The importSources option is used to define additional libraries for which an ESLint rule
|
|
19
|
+
* should apply to.
|
|
20
|
+
*
|
|
21
|
+
* Note that `@compiled/react` and `@atlaskit/css` are always included in importSources, regardless
|
|
22
|
+
* of what importSources is configured to by the user.
|
|
23
|
+
*
|
|
24
|
+
* @param context The rule context.
|
|
25
|
+
* @returns An array of strings representing what CSS-in-JS packages that should be checked, based
|
|
26
|
+
* on the rule options configuration.
|
|
27
|
+
*/
|
|
28
|
+
export declare const getImportSources: (context: Rule.RuleContext) => ImportSource[];
|
|
29
|
+
export declare const isCss: SupportedNameChecker;
|
|
30
|
+
export declare const isCxFunction: SupportedNameChecker;
|
|
31
|
+
export declare const isCssMap: SupportedNameChecker;
|
|
32
|
+
export declare const isKeyframes: SupportedNameChecker;
|
|
33
|
+
export declare const isStyled: SupportedNameChecker;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export { default as rules } from './rules/index.codegen';
|
|
2
|
+
export declare const configs: {
|
|
3
|
+
all: {
|
|
4
|
+
plugins: string[];
|
|
5
|
+
rules: {
|
|
6
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
7
|
+
'@atlaskit/design-system/consistent-css-prop-usage': (string | {
|
|
8
|
+
excludeReactComponents: boolean;
|
|
9
|
+
})[];
|
|
10
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
11
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
12
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': string;
|
|
13
|
+
'@compiled/no-suppress-xcss': string;
|
|
14
|
+
'@compiled/no-js-xcss': string;
|
|
15
|
+
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
16
|
+
importSources: string[];
|
|
17
|
+
})[];
|
|
18
|
+
'@atlaskit/design-system/no-exported-css': (string | {
|
|
19
|
+
importSources: string[];
|
|
20
|
+
})[];
|
|
21
|
+
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
22
|
+
importSources: string[];
|
|
23
|
+
})[];
|
|
24
|
+
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
25
|
+
allowedFunctionCalls: string[][];
|
|
26
|
+
})[];
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
recommended: {
|
|
30
|
+
plugins: string[];
|
|
31
|
+
rules: {
|
|
32
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
33
|
+
'@atlaskit/design-system/consistent-css-prop-usage': (string | {
|
|
34
|
+
excludeReactComponents: boolean;
|
|
35
|
+
})[];
|
|
36
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
37
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
38
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': string;
|
|
39
|
+
'@compiled/no-suppress-xcss': string;
|
|
40
|
+
'@compiled/no-js-xcss': string;
|
|
41
|
+
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
42
|
+
importSources: string[];
|
|
43
|
+
})[];
|
|
44
|
+
'@atlaskit/design-system/no-exported-css': (string | {
|
|
45
|
+
importSources: string[];
|
|
46
|
+
})[];
|
|
47
|
+
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
48
|
+
importSources: string[];
|
|
49
|
+
})[];
|
|
50
|
+
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
51
|
+
allowedFunctionCalls: string[][];
|
|
52
|
+
})[];
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { configs, rules } from './index.codegen';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
* @codegen <<SignedSource::6b1418e07df6af9ad4cae4baf66739c1>>
|
|
4
|
+
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: {
|
|
7
|
+
plugins: string[];
|
|
8
|
+
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
10
|
+
'@atlaskit/design-system/consistent-css-prop-usage': (string | {
|
|
11
|
+
excludeReactComponents: boolean;
|
|
12
|
+
})[];
|
|
13
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
14
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
15
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': string;
|
|
16
|
+
'@compiled/no-suppress-xcss': string;
|
|
17
|
+
'@compiled/no-js-xcss': string;
|
|
18
|
+
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
19
|
+
importSources: string[];
|
|
20
|
+
})[];
|
|
21
|
+
'@atlaskit/design-system/no-exported-css': (string | {
|
|
22
|
+
importSources: string[];
|
|
23
|
+
})[];
|
|
24
|
+
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
25
|
+
importSources: string[];
|
|
26
|
+
})[];
|
|
27
|
+
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
28
|
+
allowedFunctionCalls: string[][];
|
|
29
|
+
})[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
* @codegen <<SignedSource::6b1418e07df6af9ad4cae4baf66739c1>>
|
|
4
|
+
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
|
+
*/
|
|
6
|
+
declare const _default: {
|
|
7
|
+
plugins: string[];
|
|
8
|
+
rules: {
|
|
9
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': string;
|
|
10
|
+
'@atlaskit/design-system/consistent-css-prop-usage': (string | {
|
|
11
|
+
excludeReactComponents: boolean;
|
|
12
|
+
})[];
|
|
13
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': string;
|
|
14
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': string;
|
|
15
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': string;
|
|
16
|
+
'@compiled/no-suppress-xcss': string;
|
|
17
|
+
'@compiled/no-js-xcss': string;
|
|
18
|
+
'@atlaskit/design-system/no-empty-styled-expression': (string | {
|
|
19
|
+
importSources: string[];
|
|
20
|
+
})[];
|
|
21
|
+
'@atlaskit/design-system/no-exported-css': (string | {
|
|
22
|
+
importSources: string[];
|
|
23
|
+
})[];
|
|
24
|
+
'@atlaskit/design-system/no-exported-keyframes': (string | {
|
|
25
|
+
importSources: string[];
|
|
26
|
+
})[];
|
|
27
|
+
'@atlaskit/design-system/no-invalid-css-map': (string | {
|
|
28
|
+
allowedFunctionCalls: string[][];
|
|
29
|
+
})[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type LintRuleMeta } from './utils/create-rule';
|
|
2
|
+
/** External rules must be scoped, have a display name, and external urls. */
|
|
3
|
+
export type ExternalRuleMeta = LintRuleMeta & {
|
|
4
|
+
isExternal: true;
|
|
5
|
+
name: `@${string}/${string}`;
|
|
6
|
+
displayName: string;
|
|
7
|
+
docs: {
|
|
8
|
+
externalUrl: `https://${string}`;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const externalRules: ExternalRuleMeta[];
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import type { Rule } from 'eslint';
|
|
3
|
+
/**
|
|
4
|
+
* We are moving to our own small abstraction to create a lint rule that we have the power
|
|
5
|
+
* to change and mold to our own needs.
|
|
6
|
+
*
|
|
7
|
+
* @see createLintRule
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
* @deprecated
|
|
11
|
+
*/
|
|
12
|
+
export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener = import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>;
|
|
13
|
+
export interface LintRule extends Omit<Rule.RuleModule, 'meta'> {
|
|
14
|
+
/**
|
|
15
|
+
* Including this for backwards compat moving from the typescript-eslint util.
|
|
16
|
+
*/
|
|
17
|
+
name?: never;
|
|
18
|
+
meta: LintRuleMeta;
|
|
19
|
+
}
|
|
20
|
+
export interface LintRuleMeta extends Omit<Rule.RuleMetaData, 'docs'> {
|
|
21
|
+
/**
|
|
22
|
+
* Name of the rule.
|
|
23
|
+
* Must match the folder it is in exactly else build will throw.
|
|
24
|
+
* Add an exception in codegen.tsx for nested rules.
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
docs: {
|
|
28
|
+
/**
|
|
29
|
+
* Short description of what this rule does.
|
|
30
|
+
*/
|
|
31
|
+
description: string;
|
|
32
|
+
/**
|
|
33
|
+
* Specifies the URL at which the full documentation can be accessed.
|
|
34
|
+
*/
|
|
35
|
+
url?: string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* If this rule should be in the recommended preset or not.
|
|
38
|
+
* Set to `false` to exclude it from the recommended preset.
|
|
39
|
+
*/
|
|
40
|
+
recommended: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* The severity level to be applied to this rule.
|
|
43
|
+
* When setting to `"error"` it will mean releasing a breaking change.
|
|
44
|
+
*/
|
|
45
|
+
severity: 'error' | 'warn';
|
|
46
|
+
/**
|
|
47
|
+
* This is configuration passed into the plugin to configure the rule.
|
|
48
|
+
*
|
|
49
|
+
* Eg. `{ excludeReactComponents: true }` would be passed into the plugin config
|
|
50
|
+
*/
|
|
51
|
+
pluginConfig?: Record<string, any>;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Tiny wrapped over the ESLint rule module type that ensures
|
|
56
|
+
* there is a docs link to our ESLint plugin documentation page,
|
|
57
|
+
* as well as improving type support.
|
|
58
|
+
*/
|
|
59
|
+
export declare const createLintRule: (rule: LintRule) => Rule.RuleModule;
|
|
60
|
+
export declare function getRuleUrl(ruleName: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* If it's a nested rule, ensure the url is clean and safe for urls, file paths, etc.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getPathSafeName(ruleName: string): string;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Rule, Scope } from 'eslint';
|
|
2
|
+
import type { CallExpression } from 'estree';
|
|
3
|
+
type Callee = CallExpression['callee'];
|
|
4
|
+
type Reference = Scope.Reference;
|
|
5
|
+
export declare const CSS_IN_JS_IMPORTS: {
|
|
6
|
+
readonly compiled: "@compiled/react";
|
|
7
|
+
readonly emotionReact: "@emotion/react";
|
|
8
|
+
readonly emotionCore: "@emotion/core";
|
|
9
|
+
readonly styledComponents: "styled-components";
|
|
10
|
+
readonly atlaskitCss: "@atlaskit/css";
|
|
11
|
+
readonly atlaskitPrimitives: "@atlaskit/primitives";
|
|
12
|
+
};
|
|
13
|
+
export type ImportSource = string;
|
|
14
|
+
export type SupportedNameChecker = (nodeToCheck: Callee, referencesInScope: Reference[], importSources: ImportSource[]) => boolean;
|
|
15
|
+
export declare const DEFAULT_IMPORT_SOURCES: ImportSource[];
|
|
16
|
+
/**
|
|
17
|
+
* Given the ESLint rule context, extract and parse the value of the importSources rule option.
|
|
18
|
+
* The importSources option is used to define additional libraries for which an ESLint rule
|
|
19
|
+
* should apply to.
|
|
20
|
+
*
|
|
21
|
+
* Note that `@compiled/react` and `@atlaskit/css` are always included in importSources, regardless
|
|
22
|
+
* of what importSources is configured to by the user.
|
|
23
|
+
*
|
|
24
|
+
* @param context The rule context.
|
|
25
|
+
* @returns An array of strings representing what CSS-in-JS packages that should be checked, based
|
|
26
|
+
* on the rule options configuration.
|
|
27
|
+
*/
|
|
28
|
+
export declare const getImportSources: (context: Rule.RuleContext) => ImportSource[];
|
|
29
|
+
export declare const isCss: SupportedNameChecker;
|
|
30
|
+
export declare const isCxFunction: SupportedNameChecker;
|
|
31
|
+
export declare const isCssMap: SupportedNameChecker;
|
|
32
|
+
export declare const isKeyframes: SupportedNameChecker;
|
|
33
|
+
export declare const isStyled: SupportedNameChecker;
|
|
34
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/eslint-plugin-ui-styling-standard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"author": "Atlassian Pty Ltd",
|
|
5
|
-
"description": "The
|
|
5
|
+
"description": "The eslint plugin to enforce and educate on Atlassian's UI Styling Standard",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"atlassian": {
|
|
8
8
|
"team": "Design System Team",
|
|
9
|
-
"inPublicMirror":
|
|
10
|
-
"releaseModel": "continuous"
|
|
9
|
+
"inPublicMirror": true,
|
|
10
|
+
"releaseModel": "continuous",
|
|
11
|
+
"website": {
|
|
12
|
+
"name": "UI Styling Standard",
|
|
13
|
+
"category": "Tooling"
|
|
14
|
+
}
|
|
11
15
|
},
|
|
12
16
|
"publishConfig": {
|
|
13
17
|
"registry": "https://registry.npmjs.org/"
|
|
14
18
|
},
|
|
15
|
-
"homepage": "https://
|
|
19
|
+
"homepage": "https://atlassian.design/components/eslint-plugin-ui-styling-standard",
|
|
16
20
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
17
21
|
"main": "dist/cjs/index.js",
|
|
18
22
|
"module": "dist/esm/index.js",
|
|
19
23
|
"module:es2019": "dist/es2019/index.js",
|
|
20
|
-
"types": "dist/types/
|
|
24
|
+
"types": "dist/types/index.d.ts",
|
|
21
25
|
"typesVersions": {
|
|
22
26
|
">=4.5 <4.9": {
|
|
23
27
|
"*": [
|
|
@@ -32,16 +36,25 @@
|
|
|
32
36
|
".": "./src/index.tsx"
|
|
33
37
|
},
|
|
34
38
|
"dependencies": {
|
|
35
|
-
"@babel/runtime": "^7.0.0"
|
|
39
|
+
"@babel/runtime": "^7.0.0",
|
|
40
|
+
"@typescript-eslint/utils": "^5.48.1"
|
|
36
41
|
},
|
|
37
42
|
"devDependencies": {
|
|
38
|
-
"@atlaskit/
|
|
43
|
+
"@atlaskit/ds-lib": "^2.2.0",
|
|
44
|
+
"@atlaskit/eslint-plugin-design-system": "^8.31.0",
|
|
39
45
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
46
|
+
"@atlassian/codegen": "*",
|
|
40
47
|
"@compiled/eslint-plugin": "^0.13.3",
|
|
41
48
|
"@types/eslint": "^8.4.5",
|
|
42
49
|
"eslint": "^7.7.0",
|
|
50
|
+
"lodash": "^4.17.21",
|
|
51
|
+
"outdent": "^0.5.0",
|
|
52
|
+
"prettier": "^2.8.0",
|
|
43
53
|
"tsconfig-paths": "^4.2.0",
|
|
44
54
|
"typescript": "~4.9.5"
|
|
45
55
|
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"codegen": "ts-node -r tsconfig-paths/register ./scripts/codegen.tsx"
|
|
58
|
+
},
|
|
46
59
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
47
60
|
}
|