@atlaskit/eslint-plugin-ui-styling-standard 0.11.0 → 0.11.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 +12 -0
- package/README.md +2 -0
- package/constellation/index/overview.mdx +2 -0
- package/constellation/no-exported-styles/usage.mdx +87 -0
- package/constellation/no-imported-style-values/usage.mdx +146 -0
- package/dist/cjs/presets/all.codegen.js +3 -1
- package/dist/cjs/presets/recommended.codegen.js +3 -1
- package/dist/cjs/rules/index.codegen.js +5 -1
- package/dist/cjs/rules/no-exported-styles/index.js +39 -0
- package/dist/cjs/rules/no-imported-style-values/index.js +145 -0
- package/dist/es2019/presets/all.codegen.js +3 -1
- package/dist/es2019/presets/recommended.codegen.js +3 -1
- package/dist/es2019/rules/index.codegen.js +5 -1
- package/dist/es2019/rules/no-exported-styles/index.js +33 -0
- package/dist/es2019/rules/no-imported-style-values/index.js +125 -0
- package/dist/esm/presets/all.codegen.js +3 -1
- package/dist/esm/presets/recommended.codegen.js +3 -1
- package/dist/esm/rules/index.codegen.js +5 -1
- package/dist/esm/rules/no-exported-styles/index.js +33 -0
- package/dist/esm/rules/no-imported-style-values/index.js +138 -0
- package/dist/types/index.codegen.d.ts +4 -0
- package/dist/types/presets/all.codegen.d.ts +3 -1
- package/dist/types/presets/recommended.codegen.d.ts +3 -1
- package/dist/types/rules/index.codegen.d.ts +2 -0
- package/dist/types/rules/no-exported-styles/index.d.ts +2 -0
- package/dist/types/rules/no-imported-style-values/index.d.ts +3 -0
- package/dist/types-ts4.5/index.codegen.d.ts +4 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +3 -1
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +3 -1
- package/dist/types-ts4.5/rules/index.codegen.d.ts +2 -0
- package/dist/types-ts4.5/rules/no-exported-styles/index.d.ts +2 -0
- package/dist/types-ts4.5/rules/no-imported-style-values/index.d.ts +3 -0
- package/package.json +2 -2
- package/src/presets/all.codegen.tsx +3 -1
- package/src/presets/recommended.codegen.tsx +3 -1
- package/src/rules/index.codegen.tsx +5 -1
- package/src/rules/no-exported-styles/README.md +85 -0
- package/src/rules/no-exported-styles/__tests__/rule.test.tsx +225 -0
- package/src/rules/no-exported-styles/index.tsx +52 -0
- package/src/rules/no-imported-style-values/README.md +144 -0
- package/src/rules/no-imported-style-values/__tests__/rule.test.tsx +265 -0
- package/src/rules/no-imported-style-values/index.tsx +154 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
This rule disallows exports of `css`, `cssMap`, `keyframes`, `styled`, `xcss` styles.
|
|
2
|
+
|
|
3
|
+
Exporting style declarations from these libraries may result in unexpected errors when imported, because its value will be null at runtime. Additionally, co-locating style definitions with their usage is considered best practice in order to improve code readability and build performance.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Incorrect
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import { css } from '@compiled/react';
|
|
11
|
+
|
|
12
|
+
export const styles = css({});
|
|
13
|
+
|
|
14
|
+
export default css({});
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { keyframes } from '@compiled/react';
|
|
19
|
+
|
|
20
|
+
export const animation = keyframes({});
|
|
21
|
+
|
|
22
|
+
export default keyframes({});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Avoid exporting any style-like objects or values for consumption as well as these will violate our `no-imported-style-values` rule which blocks consumption of imported styles.
|
|
26
|
+
|
|
27
|
+
```js
|
|
28
|
+
export default {
|
|
29
|
+
color: 'red',
|
|
30
|
+
margin: '0px',
|
|
31
|
+
};
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { css } from '@compiled/react';
|
|
36
|
+
|
|
37
|
+
const color = css({
|
|
38
|
+
/* */
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const styles = {
|
|
42
|
+
primary: {
|
|
43
|
+
text: {
|
|
44
|
+
color,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default styles.primary.text.color;
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Correct
|
|
53
|
+
|
|
54
|
+
Co-locate your styles next to your components to improve code readability, linting, and build performance.
|
|
55
|
+
|
|
56
|
+
```js
|
|
57
|
+
import { css } from '@compiled/react';
|
|
58
|
+
|
|
59
|
+
const styles = css({});
|
|
60
|
+
export const Component = ({ children }) => <div css={styles}>{children}></div>;
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
import { keyframes } from '@compiled/react';
|
|
65
|
+
|
|
66
|
+
const animation = keyframes({});
|
|
67
|
+
const styles = css({ animate: `${animation} 1s ease-in` });
|
|
68
|
+
export const Component = ({ children }) => <div css={styles}>{children}></div>;
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Options
|
|
72
|
+
|
|
73
|
+
### importSources
|
|
74
|
+
|
|
75
|
+
By default, this rule will check `css` usages from:
|
|
76
|
+
|
|
77
|
+
- `@atlaskit/css`
|
|
78
|
+
- `@atlaskit/primitives`
|
|
79
|
+
- `@compiled/react`
|
|
80
|
+
- `@emotion/react`
|
|
81
|
+
- `@emotion/core`
|
|
82
|
+
- `@emotion/styled`
|
|
83
|
+
- `styled-components`
|
|
84
|
+
|
|
85
|
+
To change this list of libraries, you can define a custom set of `importSources`, which accepts an array of package names (strings).
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { typescriptEslintTester } from '../../__tests__/utils/_tester';
|
|
2
|
+
import rule from '../index';
|
|
3
|
+
|
|
4
|
+
typescriptEslintTester.run(
|
|
5
|
+
'no-exported-styles',
|
|
6
|
+
// @ts-expect-error
|
|
7
|
+
rule,
|
|
8
|
+
{
|
|
9
|
+
valid: [
|
|
10
|
+
{
|
|
11
|
+
name: 'Basic valid test for css',
|
|
12
|
+
code: `
|
|
13
|
+
import { css } from '@compiled/react';
|
|
14
|
+
const styles = css({});
|
|
15
|
+
`,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Basic valid test for cssMap',
|
|
19
|
+
code: `
|
|
20
|
+
import { cssMap } from '@compiled/react';
|
|
21
|
+
const styles = xcss({});
|
|
22
|
+
`,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Basic valid test for keyframes',
|
|
26
|
+
code: `
|
|
27
|
+
import { css } from '@compiled/react';
|
|
28
|
+
const styles = css({});
|
|
29
|
+
`,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Basic valid test for styled',
|
|
33
|
+
code: `
|
|
34
|
+
import { styled } from '@compiled/react';
|
|
35
|
+
const Component = styled.div({});
|
|
36
|
+
`,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Basic valid test for xcss',
|
|
40
|
+
code: `
|
|
41
|
+
import { css } from '@compiled/react';
|
|
42
|
+
const styles = css({});
|
|
43
|
+
`,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Custom import sources (subtractive)',
|
|
47
|
+
code: `
|
|
48
|
+
import { css } from '@compiled/react';
|
|
49
|
+
export const styles = css({});
|
|
50
|
+
`,
|
|
51
|
+
options: [
|
|
52
|
+
{
|
|
53
|
+
importSources: [],
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'Exporting a div with css styles is ok',
|
|
59
|
+
code: `
|
|
60
|
+
import { css } from '@compiled/react';
|
|
61
|
+
const styles = css({});
|
|
62
|
+
export default () => (
|
|
63
|
+
<div css={styles} />
|
|
64
|
+
);
|
|
65
|
+
`,
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
invalid: [
|
|
69
|
+
{
|
|
70
|
+
name: 'Export of css',
|
|
71
|
+
code: `
|
|
72
|
+
import { css } from '@compiled/react';
|
|
73
|
+
|
|
74
|
+
export const styles = css({});
|
|
75
|
+
|
|
76
|
+
export default css({});
|
|
77
|
+
`,
|
|
78
|
+
errors: [
|
|
79
|
+
{ messageId: 'no-exported-styles' },
|
|
80
|
+
{ messageId: 'no-exported-styles' },
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: 'Export of css from emotion',
|
|
85
|
+
code: `
|
|
86
|
+
import { css } from '@emotion/react';
|
|
87
|
+
|
|
88
|
+
export const styles = css(
|
|
89
|
+
{
|
|
90
|
+
display: 'flex',
|
|
91
|
+
position: 'relative',
|
|
92
|
+
},
|
|
93
|
+
borderRadius,
|
|
94
|
+
);
|
|
95
|
+
`,
|
|
96
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'Export of cssMap',
|
|
100
|
+
code: `
|
|
101
|
+
import { cssMap } from '@compiled/react';
|
|
102
|
+
|
|
103
|
+
export const borderStyleMap = cssMap({
|
|
104
|
+
none: { borderStyle: 'none' },
|
|
105
|
+
solid: { borderStyle: 'solid' },
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
export default cssMap({});
|
|
109
|
+
`,
|
|
110
|
+
errors: [
|
|
111
|
+
{ messageId: 'no-exported-styles' },
|
|
112
|
+
{ messageId: 'no-exported-styles' },
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'Export of keyframes',
|
|
117
|
+
code: `
|
|
118
|
+
import { keyframes } from '@compiled/react';
|
|
119
|
+
|
|
120
|
+
export const animation = keyframes({});
|
|
121
|
+
|
|
122
|
+
export default keyframes({});
|
|
123
|
+
`,
|
|
124
|
+
errors: [
|
|
125
|
+
{ messageId: 'no-exported-styles' },
|
|
126
|
+
{ messageId: 'no-exported-styles' },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'Exporting styled component',
|
|
131
|
+
code: `
|
|
132
|
+
import { styled } from '@compiled/react';
|
|
133
|
+
|
|
134
|
+
export const Component = styled.div({});
|
|
135
|
+
`,
|
|
136
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: 'Exporting css styles',
|
|
140
|
+
code: `
|
|
141
|
+
import { css } from '@compiled/react';
|
|
142
|
+
import { colors, getColor } from '@mui/theme';
|
|
143
|
+
import { ff } from '@atlaskit/ff';
|
|
144
|
+
|
|
145
|
+
import { buttonStyles, cssShared, colorKey } from '../shared';
|
|
146
|
+
|
|
147
|
+
const sharedObject = { padding: 0 };
|
|
148
|
+
|
|
149
|
+
export const styles = css({
|
|
150
|
+
...cssShared,
|
|
151
|
+
...sharedObject,
|
|
152
|
+
[colorKey]: getColor('red'),
|
|
153
|
+
background: colors['red'],
|
|
154
|
+
});
|
|
155
|
+
`,
|
|
156
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: 'Export let css',
|
|
160
|
+
code: `
|
|
161
|
+
import { css } from '@compiled/react';
|
|
162
|
+
|
|
163
|
+
export let styles = css({});
|
|
164
|
+
`,
|
|
165
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: 'Export style in object',
|
|
169
|
+
code: `
|
|
170
|
+
import { css } from '@compiled/react';
|
|
171
|
+
|
|
172
|
+
const styles = css({});
|
|
173
|
+
|
|
174
|
+
export { styles };
|
|
175
|
+
`,
|
|
176
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: 'Exporting nested style',
|
|
180
|
+
code: `
|
|
181
|
+
import { css } from '@compiled/react';
|
|
182
|
+
|
|
183
|
+
const styles = {
|
|
184
|
+
primary: css({}),
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export { styles };
|
|
188
|
+
`,
|
|
189
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'Exporting styled components',
|
|
193
|
+
code: `
|
|
194
|
+
import styled from 'styled-components'
|
|
195
|
+
|
|
196
|
+
export const PasswordInput = styled.input.attrs(props => ({
|
|
197
|
+
type: "password"
|
|
198
|
+
}))
|
|
199
|
+
`,
|
|
200
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
name: 'Exporting styled component with base component',
|
|
204
|
+
code: `
|
|
205
|
+
import styled from 'styled-components'
|
|
206
|
+
|
|
207
|
+
const BaseComponent = styled.div({});
|
|
208
|
+
export const Component = styled(BaseComponent)({});
|
|
209
|
+
`,
|
|
210
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'Exporting styled component from compiled',
|
|
214
|
+
code: `
|
|
215
|
+
import { styled as styled2 } from '@compiled/react'
|
|
216
|
+
|
|
217
|
+
export const Component = styled2.div({
|
|
218
|
+
margin: \`\${token('space.200', '16px')} 0\`,
|
|
219
|
+
})
|
|
220
|
+
`,
|
|
221
|
+
errors: [{ messageId: 'no-exported-styles' }],
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createLintRule } from '../utils/create-rule';
|
|
2
|
+
import {
|
|
3
|
+
isCss,
|
|
4
|
+
isStyled,
|
|
5
|
+
isKeyframes,
|
|
6
|
+
isCssMap,
|
|
7
|
+
isXcss,
|
|
8
|
+
SupportedNameChecker,
|
|
9
|
+
} from '@atlaskit/eslint-utils/is-supported-import';
|
|
10
|
+
import type { JSONSchema4 } from '@typescript-eslint/utils/dist/json-schema';
|
|
11
|
+
import { createNoExportedRule } from '@atlaskit/eslint-utils/create-no-exported-rule';
|
|
12
|
+
|
|
13
|
+
const schema: JSONSchema4 = [
|
|
14
|
+
{
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
importSources: {
|
|
18
|
+
type: 'array',
|
|
19
|
+
items: { type: 'string' },
|
|
20
|
+
uniqueItems: true,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
const supportedImports: readonly SupportedNameChecker[] = [
|
|
27
|
+
isCss,
|
|
28
|
+
isCssMap,
|
|
29
|
+
isKeyframes,
|
|
30
|
+
isXcss,
|
|
31
|
+
isStyled,
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
export const rule = createLintRule({
|
|
35
|
+
meta: {
|
|
36
|
+
name: 'no-exported-styles',
|
|
37
|
+
docs: {
|
|
38
|
+
description: 'Disallows exports of css, keyframes, styled and xcss',
|
|
39
|
+
recommended: true,
|
|
40
|
+
severity: 'warn',
|
|
41
|
+
},
|
|
42
|
+
messages: {
|
|
43
|
+
'no-exported-styles':
|
|
44
|
+
'Styles from css, cssMap, keyframes, styled and xcss should not be exported. All styles should be defined and used in the same file instead.',
|
|
45
|
+
},
|
|
46
|
+
type: 'problem',
|
|
47
|
+
schema,
|
|
48
|
+
},
|
|
49
|
+
create: createNoExportedRule(supportedImports, 'no-exported-styles'),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export default rule;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
This rule disallows using imported style values in `css`, `cssMap`, `styled`, `keyframes` and `xcss` calls.
|
|
2
|
+
|
|
3
|
+
Importing style values may result in unexpected errors when used in these APIs, because its value will be null at runtime when using `@compiled/react`. Additionally, co-locating style definitions with their usage is considered best practice in order to improve code readability and build performance.
|
|
4
|
+
|
|
5
|
+
## Examples
|
|
6
|
+
|
|
7
|
+
### Incorrect
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import { css } from '@compiled/react';
|
|
11
|
+
import { colors, getColor } from '@mui/theme';
|
|
12
|
+
|
|
13
|
+
const styles = css({
|
|
14
|
+
[colorKey]: getColor('red'),
|
|
15
|
+
background: colors['red'],
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
```js
|
|
20
|
+
import { css } from '@compiled/react';
|
|
21
|
+
import { buttonStyles, cssShared, HEIGHT, colorKey } from '../shared';
|
|
22
|
+
import { ff } from '@atlaskit/ff';
|
|
23
|
+
|
|
24
|
+
const sharedObject = { padding: 0 };
|
|
25
|
+
|
|
26
|
+
const styles = css({
|
|
27
|
+
...cssShared,
|
|
28
|
+
...sharedObject,
|
|
29
|
+
height: `${HEIGHT}px`,
|
|
30
|
+
width: ff('…') ? `${HEIGHT}px` : undefined,
|
|
31
|
+
});
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Importing styles to use in style composition is not allowed.
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import { css } from '@compiled/react';
|
|
38
|
+
import { buttonStyles } from '../shared';
|
|
39
|
+
|
|
40
|
+
const styles = css({
|
|
41
|
+
color: 'red',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export default () => <div css={[styles, buttonStyles]} />;
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Importing styles to pass to the style prop is also not allowed.
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { importedWidth } from '../shared';
|
|
51
|
+
|
|
52
|
+
export default () => <div style={{ width: importedWidth }} />;
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Correct
|
|
56
|
+
|
|
57
|
+
Co-locate your styles next to your components to improve code readability, linting, and build performance.
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
import { css } from '@compiled/react';
|
|
61
|
+
import { token } from '@atlaskit/tokens';
|
|
62
|
+
|
|
63
|
+
const styles = css({
|
|
64
|
+
color: 'red',
|
|
65
|
+
padding: token('space.150'),
|
|
66
|
+
});
|
|
67
|
+
export const Component = ({ children }) => <div css={styles}>{children}></div>;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```js
|
|
71
|
+
import { keyframes } from '@compiled/react';
|
|
72
|
+
|
|
73
|
+
const animation = keyframes({});
|
|
74
|
+
const styles = css({ animate: `${animation} 1s ease-in` });
|
|
75
|
+
export const Component = ({ children }) => <div css={styles}>{children}></div>;
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Options
|
|
79
|
+
|
|
80
|
+
### `allowedDynamicKeys: [string, string][]`
|
|
81
|
+
|
|
82
|
+
Use this to allow specified imports as dynamic keys, in addition to the built-in allow-list.
|
|
83
|
+
|
|
84
|
+
Each value should be a two-element array. The first item is the entrypoint, and the second item is a named export.
|
|
85
|
+
|
|
86
|
+
Default imports are not supported.
|
|
87
|
+
|
|
88
|
+
```tsx
|
|
89
|
+
// .eslintrc.js
|
|
90
|
+
|
|
91
|
+
// ...
|
|
92
|
+
rules: {
|
|
93
|
+
'@atlaskit/eslint-plugin-ui-styling-standard/no-unsafe-values': [
|
|
94
|
+
'error',
|
|
95
|
+
{
|
|
96
|
+
allowedDynamicKeys: [
|
|
97
|
+
['@atlaskit/primitives/responsive', 'media'],
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
// ...
|
|
102
|
+
},
|
|
103
|
+
// ...
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### `allowedFunctionCalls: [string, string][]`
|
|
107
|
+
|
|
108
|
+
Use this to allow specific functions to be called, in addition to the built-in allow-list.
|
|
109
|
+
|
|
110
|
+
Each value should be a two-element array. The first item is the entrypoint, and the second item is a named export.
|
|
111
|
+
|
|
112
|
+
Default imports are not currently supported.
|
|
113
|
+
|
|
114
|
+
```tsx
|
|
115
|
+
// .eslintrc.js
|
|
116
|
+
|
|
117
|
+
// ...
|
|
118
|
+
rules: {
|
|
119
|
+
'@atlaskit/eslint-plugin-ui-styling-standard/no-unsafe-values': [
|
|
120
|
+
'error',
|
|
121
|
+
{
|
|
122
|
+
allowedFunctionCalls: [
|
|
123
|
+
['@atlaskit/tokens', 'token'],
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
// ...
|
|
128
|
+
},
|
|
129
|
+
// ...
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### `importSources: string[]`
|
|
133
|
+
|
|
134
|
+
By default, this rule will check `css` usages from:
|
|
135
|
+
|
|
136
|
+
- `@atlaskit/css`
|
|
137
|
+
- `@atlaskit/primitives`
|
|
138
|
+
- `@compiled/react`
|
|
139
|
+
- `@emotion/react`
|
|
140
|
+
- `@emotion/core`
|
|
141
|
+
- `@emotion/styled`
|
|
142
|
+
- `styled-components`
|
|
143
|
+
|
|
144
|
+
To change this list of libraries, you can define a custom set of `importSources`, which accepts an array of package names (strings).
|