@atlaskit/eslint-plugin-ui-styling-standard 0.20.1 → 1.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 +23 -0
- package/README.md +2 -5
- package/dist/cjs/index.codegen.js +45 -10
- package/dist/cjs/index.js +22 -1
- package/dist/cjs/presets/all-flat.codegen.js +53 -0
- package/dist/cjs/presets/all.codegen.js +2 -9
- package/dist/cjs/presets/recommended-flat.codegen.js +53 -0
- package/dist/cjs/presets/recommended.codegen.js +2 -9
- package/dist/cjs/rules/enforce-style-prop/index.js +45 -17
- package/dist/cjs/rules/external-rules.js +0 -38
- package/dist/cjs/rules/index.codegen.js +4 -3
- package/dist/es2019/index.codegen.js +50 -6
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/presets/all-flat.codegen.js +44 -0
- package/dist/es2019/presets/all.codegen.js +2 -9
- package/dist/es2019/presets/recommended-flat.codegen.js +44 -0
- package/dist/es2019/presets/recommended.codegen.js +2 -9
- package/dist/es2019/rules/enforce-style-prop/index.js +45 -17
- package/dist/es2019/rules/external-rules.js +0 -38
- package/dist/es2019/rules/index.codegen.js +2 -2
- package/dist/esm/index.codegen.js +46 -6
- package/dist/esm/index.js +1 -1
- package/dist/esm/presets/all-flat.codegen.js +44 -0
- package/dist/esm/presets/all.codegen.js +2 -9
- package/dist/esm/presets/recommended-flat.codegen.js +44 -0
- package/dist/esm/presets/recommended.codegen.js +2 -9
- package/dist/esm/rules/enforce-style-prop/index.js +45 -17
- package/dist/esm/rules/external-rules.js +0 -38
- package/dist/esm/rules/index.codegen.js +2 -2
- package/dist/types/index.codegen.d.ts +370 -81
- package/dist/types/index.d.ts +1 -1
- package/dist/types/presets/all-flat.codegen.d.ts +44 -0
- package/dist/types/presets/all.codegen.d.ts +33 -40
- package/dist/types/presets/recommended-flat.codegen.d.ts +44 -0
- package/dist/types/presets/recommended.codegen.d.ts +33 -40
- package/dist/types/rules/index.codegen.d.ts +1 -2
- package/dist/types-ts4.5/index.codegen.d.ts +550 -81
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/presets/all-flat.codegen.d.ts +65 -0
- package/dist/types-ts4.5/presets/all.codegen.d.ts +57 -40
- package/dist/types-ts4.5/presets/recommended-flat.codegen.d.ts +65 -0
- package/dist/types-ts4.5/presets/recommended.codegen.d.ts +57 -40
- package/dist/types-ts4.5/rules/index.codegen.d.ts +1 -2
- package/package.json +11 -5
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
* @codegen <<SignedSource::4595bc1a07f9da4186e2df84cea56831>>
|
|
4
|
+
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
|
+
*/
|
|
6
|
+
import * as atlaskitDesignSystemPlugin from '@atlaskit/eslint-plugin-design-system';
|
|
7
|
+
export default {
|
|
8
|
+
plugins: {
|
|
9
|
+
// NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
|
|
10
|
+
'@atlaskit/design-system': atlaskitDesignSystemPlugin
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
14
|
+
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
15
|
+
'@atlaskit/ui-styling-standard/enforce-style-prop': 'error',
|
|
16
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': 'error',
|
|
17
|
+
'@atlaskit/ui-styling-standard/no-array-arguments': 'error',
|
|
18
|
+
'@atlaskit/ui-styling-standard/no-classname-prop': 'error',
|
|
19
|
+
'@atlaskit/ui-styling-standard/no-container-queries': 'error',
|
|
20
|
+
'@atlaskit/ui-styling-standard/no-dynamic-styles': 'error',
|
|
21
|
+
'@atlaskit/ui-styling-standard/no-exported-styles': 'error',
|
|
22
|
+
'@atlaskit/ui-styling-standard/no-global-styles': 'error',
|
|
23
|
+
'@atlaskit/ui-styling-standard/no-important-styles': 'error',
|
|
24
|
+
'@atlaskit/ui-styling-standard/no-imported-style-values': 'error',
|
|
25
|
+
'@atlaskit/ui-styling-standard/no-nested-selectors': 'error',
|
|
26
|
+
'@atlaskit/ui-styling-standard/no-styled': 'error',
|
|
27
|
+
'@atlaskit/ui-styling-standard/no-unsafe-selectors': 'error',
|
|
28
|
+
'@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
|
|
29
|
+
'@atlaskit/ui-styling-standard/use-compiled': 'error',
|
|
30
|
+
'@atlaskit/design-system/consistent-css-prop-usage': ['error', {
|
|
31
|
+
excludeReactComponents: true,
|
|
32
|
+
shouldAlwaysCheckXcss: true
|
|
33
|
+
}],
|
|
34
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
35
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
36
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
37
|
+
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
38
|
+
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
39
|
+
}],
|
|
40
|
+
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
41
|
+
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
42
|
+
}]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::884e28457d7860b1abca070fca8ab853>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'
|
|
7
|
+
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'],
|
|
8
8
|
rules: {
|
|
9
9
|
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
10
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
@@ -30,18 +30,11 @@ export default {
|
|
|
30
30
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
31
31
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
32
32
|
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
33
|
-
'@compiled/no-suppress-xcss': 'error',
|
|
34
|
-
'@compiled/no-js-xcss': 'error',
|
|
35
33
|
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
36
34
|
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
37
35
|
}],
|
|
38
36
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
37
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}],
|
|
41
|
-
'@compiled/jsx-pragma': ['error', {
|
|
42
|
-
runtime: 'classic',
|
|
43
|
-
onlyRunIfImportingCompiled: true,
|
|
44
|
-
importSources: ['@atlaskit/css']
|
|
45
38
|
}]
|
|
46
39
|
}
|
|
47
40
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
* @codegen <<SignedSource::4595bc1a07f9da4186e2df84cea56831>>
|
|
4
|
+
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
|
+
*/
|
|
6
|
+
import * as atlaskitDesignSystemPlugin from '@atlaskit/eslint-plugin-design-system';
|
|
7
|
+
export default {
|
|
8
|
+
plugins: {
|
|
9
|
+
// NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
|
|
10
|
+
'@atlaskit/design-system': atlaskitDesignSystemPlugin
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
14
|
+
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
15
|
+
'@atlaskit/ui-styling-standard/enforce-style-prop': 'error',
|
|
16
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': 'error',
|
|
17
|
+
'@atlaskit/ui-styling-standard/no-array-arguments': 'error',
|
|
18
|
+
'@atlaskit/ui-styling-standard/no-classname-prop': 'error',
|
|
19
|
+
'@atlaskit/ui-styling-standard/no-container-queries': 'error',
|
|
20
|
+
'@atlaskit/ui-styling-standard/no-dynamic-styles': 'error',
|
|
21
|
+
'@atlaskit/ui-styling-standard/no-exported-styles': 'error',
|
|
22
|
+
'@atlaskit/ui-styling-standard/no-global-styles': 'error',
|
|
23
|
+
'@atlaskit/ui-styling-standard/no-important-styles': 'error',
|
|
24
|
+
'@atlaskit/ui-styling-standard/no-imported-style-values': 'error',
|
|
25
|
+
'@atlaskit/ui-styling-standard/no-nested-selectors': 'error',
|
|
26
|
+
'@atlaskit/ui-styling-standard/no-styled': 'error',
|
|
27
|
+
'@atlaskit/ui-styling-standard/no-unsafe-selectors': 'error',
|
|
28
|
+
'@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
|
|
29
|
+
'@atlaskit/ui-styling-standard/use-compiled': 'error',
|
|
30
|
+
'@atlaskit/design-system/consistent-css-prop-usage': ['error', {
|
|
31
|
+
excludeReactComponents: true,
|
|
32
|
+
shouldAlwaysCheckXcss: true
|
|
33
|
+
}],
|
|
34
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
35
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
36
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
37
|
+
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
38
|
+
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
39
|
+
}],
|
|
40
|
+
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
41
|
+
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
42
|
+
}]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::884e28457d7860b1abca070fca8ab853>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'
|
|
7
|
+
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'],
|
|
8
8
|
rules: {
|
|
9
9
|
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
10
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
@@ -30,18 +30,11 @@ export default {
|
|
|
30
30
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
31
31
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
32
32
|
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
33
|
-
'@compiled/no-suppress-xcss': 'error',
|
|
34
|
-
'@compiled/no-js-xcss': 'error',
|
|
35
33
|
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
36
34
|
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
37
35
|
}],
|
|
38
36
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
37
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}],
|
|
41
|
-
'@compiled/jsx-pragma': ['error', {
|
|
42
|
-
runtime: 'classic',
|
|
43
|
-
onlyRunIfImportingCompiled: true,
|
|
44
|
-
importSources: ['@atlaskit/css']
|
|
45
38
|
}]
|
|
46
39
|
}
|
|
47
40
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isNodeOfType } from 'eslint-codemod-utils';
|
|
2
|
-
import { createLintRule } from '../utils/create-rule';
|
|
3
2
|
import { getAllowedFunctionCalls, isAllowListedVariable } from '@atlaskit/eslint-utils/allowed-function-calls';
|
|
4
3
|
import { findVariable } from '@atlaskit/eslint-utils/find-variable';
|
|
4
|
+
import { createLintRule } from '../utils/create-rule';
|
|
5
5
|
const isParameter = (context, identifier) => {
|
|
6
6
|
var _findVariable;
|
|
7
7
|
const definitions = (_findVariable = findVariable({
|
|
@@ -15,7 +15,7 @@ const isParameter = (context, identifier) => {
|
|
|
15
15
|
return result.type === 'Parameter';
|
|
16
16
|
};
|
|
17
17
|
const isIdentifierAllowed = (context, identifier) => {
|
|
18
|
-
var
|
|
18
|
+
var _variable$identifiers, _variable$identifiers2;
|
|
19
19
|
const variable = findVariable({
|
|
20
20
|
sourceCode: context.getSourceCode(),
|
|
21
21
|
identifier: identifier
|
|
@@ -25,30 +25,44 @@ const isIdentifierAllowed = (context, identifier) => {
|
|
|
25
25
|
}
|
|
26
26
|
const variableDefinition = variable.defs[0].node;
|
|
27
27
|
|
|
28
|
+
// console.log('@@variableDefinition', variableDefinition);
|
|
29
|
+
|
|
28
30
|
// If identifier is a RestElement, report warning
|
|
29
|
-
if (((
|
|
31
|
+
if (((_variable$identifiers = variable.identifiers[0]) === null || _variable$identifiers === void 0 ? void 0 : (_variable$identifiers2 = _variable$identifiers.parent) === null || _variable$identifiers2 === void 0 ? void 0 : _variable$identifiers2.type) === 'RestElement') {
|
|
30
32
|
return false;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
35
|
// Checking if identifier has been destructured from props within function
|
|
34
36
|
if (variableDefinition.type === 'VariableDeclarator') {
|
|
35
|
-
var
|
|
37
|
+
var _init, _init2, _init3, _init4;
|
|
36
38
|
// If it's a let variable, ignore
|
|
37
39
|
if (variableDefinition.parent.kind === 'let') {
|
|
38
40
|
return true;
|
|
39
41
|
}
|
|
42
|
+
|
|
43
|
+
// Allow for `const { width } = props as Props` (etc)
|
|
44
|
+
let init = variableDefinition.init;
|
|
45
|
+
if (((_init = init) === null || _init === void 0 ? void 0 : _init.type) === 'TSAsExpression') {
|
|
46
|
+
init = init.expression;
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
// If it's initialised by a call expression, ignore
|
|
41
|
-
if (((
|
|
50
|
+
if (((_init2 = init) === null || _init2 === void 0 ? void 0 : _init2.type) === 'CallExpression') {
|
|
42
51
|
return true;
|
|
43
52
|
}
|
|
44
53
|
// Destructured from member expression
|
|
45
54
|
// e.g. const width = props.width
|
|
46
|
-
if (((
|
|
47
|
-
return isParameter(context,
|
|
55
|
+
if (((_init3 = init) === null || _init3 === void 0 ? void 0 : _init3.type) === 'MemberExpression') {
|
|
56
|
+
return isParameter(context, init.object);
|
|
57
|
+
}
|
|
58
|
+
// Destructured from an asserted
|
|
59
|
+
// e.g. const width = props.width
|
|
60
|
+
if (((_init4 = init) === null || _init4 === void 0 ? void 0 : _init4.type) === 'MemberExpression') {
|
|
61
|
+
return isParameter(context, init.object);
|
|
48
62
|
}
|
|
49
63
|
// Destructured from object pattern
|
|
50
64
|
// e.g. const { width } = props
|
|
51
|
-
return isParameter(context,
|
|
65
|
+
return isParameter(context, init);
|
|
52
66
|
}
|
|
53
67
|
// If identifier has not been deconstructed from parameter or is a RestElement, report warning
|
|
54
68
|
return isParameter(context, identifier);
|
|
@@ -121,26 +135,40 @@ export const rule = createLintRule({
|
|
|
121
135
|
create(context) {
|
|
122
136
|
return {
|
|
123
137
|
'JSXAttribute[name.name="style"] > JSXExpressionContainer': node => {
|
|
138
|
+
var _node$expression$expr;
|
|
124
139
|
if (!isNodeOfType(node, 'JSXExpressionContainer')) {
|
|
125
140
|
return;
|
|
126
141
|
}
|
|
142
|
+
|
|
127
143
|
// we've reached an attribute named style
|
|
128
144
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
145
|
+
let expression;
|
|
146
|
+
if (
|
|
147
|
+
// @ts-expect-error -- TSAsExpression is not valid in estree
|
|
148
|
+
node.expression.type === 'TSAsExpression' &&
|
|
149
|
+
// @ts-expect-error -- TSAsExpression is not valid in estree
|
|
150
|
+
((_node$expression$expr = node.expression.expression) === null || _node$expression$expr === void 0 ? void 0 : _node$expression$expr.type) === 'ObjectExpression') {
|
|
151
|
+
// This is a `style={{ … } as React.CSSProperties}` scenario
|
|
152
|
+
// @ts-expect-error -- TSAsExpression is not valid in estree
|
|
153
|
+
expression = node.expression.expression;
|
|
154
|
+
} else if (node.expression.type === 'ObjectExpression') {
|
|
155
|
+
// Typical `style={{ … }}` scenario
|
|
156
|
+
expression = node.expression;
|
|
138
157
|
} else {
|
|
139
158
|
context.report({
|
|
140
159
|
node: node,
|
|
141
160
|
messageId: 'enforce-style-prop'
|
|
142
161
|
});
|
|
162
|
+
return;
|
|
143
163
|
}
|
|
164
|
+
expression.properties.forEach(value => {
|
|
165
|
+
if (!isPropertyValueAllowed(value, context)) {
|
|
166
|
+
context.report({
|
|
167
|
+
node: value,
|
|
168
|
+
messageId: 'enforce-style-prop'
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
});
|
|
144
172
|
}
|
|
145
173
|
};
|
|
146
174
|
}
|
|
@@ -61,28 +61,6 @@ export const externalRules = [{
|
|
|
61
61
|
recommended: true,
|
|
62
62
|
severity: 'error'
|
|
63
63
|
}
|
|
64
|
-
}, {
|
|
65
|
-
name: '@compiled/no-suppress-xcss',
|
|
66
|
-
displayName: 'no-suppress-xcss',
|
|
67
|
-
isExternal: true,
|
|
68
|
-
docs: {
|
|
69
|
-
description: 'Disallows supressing type violations when using the xcss prop.',
|
|
70
|
-
url: getRuleUrl('no-suppress-xcss'),
|
|
71
|
-
externalUrl: 'https://github.com/atlassian-labs/compiled/tree/master/packages/eslint-plugin/src/rules/no-suppress-xcss',
|
|
72
|
-
recommended: true,
|
|
73
|
-
severity: 'error'
|
|
74
|
-
}
|
|
75
|
-
}, {
|
|
76
|
-
name: '@compiled/no-js-xcss',
|
|
77
|
-
displayName: 'no-js-xcss',
|
|
78
|
-
isExternal: true,
|
|
79
|
-
docs: {
|
|
80
|
-
description: 'Disallows using xcss prop inside JavaScript files.',
|
|
81
|
-
url: getRuleUrl('no-js-xcss'),
|
|
82
|
-
externalUrl: 'https://github.com/atlassian-labs/compiled/tree/master/packages/eslint-plugin/src/rules/no-js-xcss',
|
|
83
|
-
recommended: true,
|
|
84
|
-
severity: 'error'
|
|
85
|
-
}
|
|
86
64
|
}, {
|
|
87
65
|
name: '@atlaskit/design-system/no-empty-styled-expression',
|
|
88
66
|
displayName: 'no-empty-styled-expression',
|
|
@@ -111,20 +89,4 @@ export const externalRules = [{
|
|
|
111
89
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
112
90
|
}
|
|
113
91
|
}
|
|
114
|
-
}, {
|
|
115
|
-
name: '@compiled/jsx-pragma',
|
|
116
|
-
displayName: 'jsx-pragma',
|
|
117
|
-
isExternal: true,
|
|
118
|
-
docs: {
|
|
119
|
-
description: 'Ensures that the Compiled JSX pragma is set when using Compiled',
|
|
120
|
-
url: getRuleUrl('jsx-pragma'),
|
|
121
|
-
externalUrl: 'https://github.com/atlassian-labs/compiled/tree/master/packages/eslint-plugin/src/rules/jsx-pragma',
|
|
122
|
-
recommended: true,
|
|
123
|
-
severity: 'error',
|
|
124
|
-
pluginConfig: {
|
|
125
|
-
runtime: 'classic',
|
|
126
|
-
onlyRunIfImportingCompiled: true,
|
|
127
|
-
importSources: ['@atlaskit/css']
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
92
|
}];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::71ba23a2a1467988c4fae8c2756447f9>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
import atlaskitTheme from './atlaskit-theme';
|
|
@@ -20,7 +20,7 @@ import noStyled from './no-styled';
|
|
|
20
20
|
import noUnsafeSelectors from './no-unsafe-selectors';
|
|
21
21
|
import noUnsafeValues from './no-unsafe-values';
|
|
22
22
|
import useCompiled from './use-compiled';
|
|
23
|
-
export
|
|
23
|
+
export const rules = {
|
|
24
24
|
'atlaskit-theme': atlaskitTheme,
|
|
25
25
|
'convert-props-syntax': convertPropsSyntax,
|
|
26
26
|
'enforce-style-prop': enforceStyleProp,
|
|
@@ -1,12 +1,52 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
/**
|
|
2
5
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::0b2a9d2f41301e40371dbce6d69039df>>
|
|
4
7
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
8
|
*/
|
|
9
|
+
import allFlat from './presets/all-flat.codegen';
|
|
6
10
|
import all from './presets/all.codegen';
|
|
11
|
+
import recommendedFlat from './presets/recommended-flat.codegen';
|
|
7
12
|
import recommended from './presets/recommended.codegen';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
import { rules } from './rules/index.codegen';
|
|
14
|
+
|
|
15
|
+
// this uses require because not all node versions this package supports use the same import assertions/attributes
|
|
16
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
17
|
+
var pkgJson = require('@atlaskit/eslint-plugin-ui-styling-standard/package.json');
|
|
18
|
+
var version = pkgJson.version,
|
|
19
|
+
name = pkgJson.name;
|
|
20
|
+
export var plugin = {
|
|
21
|
+
meta: {
|
|
22
|
+
name: name,
|
|
23
|
+
version: version
|
|
24
|
+
},
|
|
25
|
+
rules: rules,
|
|
26
|
+
// flat configs need to be done like this so they can get a reference to the plugin.
|
|
27
|
+
// see here: https://eslint.org/docs/latest/extend/plugins#configs-in-plugins
|
|
28
|
+
// they cannot use `Object.assign` because it will not work with the getter
|
|
29
|
+
configs: {
|
|
30
|
+
all: all,
|
|
31
|
+
'flat/all': _objectSpread(_objectSpread({}, allFlat), {}, {
|
|
32
|
+
plugins: _objectSpread(_objectSpread({}, allFlat.plugins), {}, {
|
|
33
|
+
get '@atlaskit/ui-styling-standard'() {
|
|
34
|
+
return plugin;
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
recommended: recommended,
|
|
39
|
+
'flat/recommended': _objectSpread(_objectSpread({}, recommendedFlat), {}, {
|
|
40
|
+
plugins: _objectSpread(_objectSpread({}, recommendedFlat.plugins), {}, {
|
|
41
|
+
get '@atlaskit/ui-styling-standard'() {
|
|
42
|
+
return plugin;
|
|
43
|
+
}
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
export { rules } from './rules/index.codegen';
|
|
49
|
+
var configs = plugin.configs,
|
|
50
|
+
meta = plugin.meta;
|
|
51
|
+
export { configs, meta };
|
|
52
|
+
export default plugin;
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { meta, rules, plugin, configs, default } from './index.codegen';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
* @codegen <<SignedSource::4595bc1a07f9da4186e2df84cea56831>>
|
|
4
|
+
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
|
+
*/
|
|
6
|
+
import * as atlaskitDesignSystemPlugin from '@atlaskit/eslint-plugin-design-system';
|
|
7
|
+
export default {
|
|
8
|
+
plugins: {
|
|
9
|
+
// NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
|
|
10
|
+
'@atlaskit/design-system': atlaskitDesignSystemPlugin
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
14
|
+
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
15
|
+
'@atlaskit/ui-styling-standard/enforce-style-prop': 'error',
|
|
16
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': 'error',
|
|
17
|
+
'@atlaskit/ui-styling-standard/no-array-arguments': 'error',
|
|
18
|
+
'@atlaskit/ui-styling-standard/no-classname-prop': 'error',
|
|
19
|
+
'@atlaskit/ui-styling-standard/no-container-queries': 'error',
|
|
20
|
+
'@atlaskit/ui-styling-standard/no-dynamic-styles': 'error',
|
|
21
|
+
'@atlaskit/ui-styling-standard/no-exported-styles': 'error',
|
|
22
|
+
'@atlaskit/ui-styling-standard/no-global-styles': 'error',
|
|
23
|
+
'@atlaskit/ui-styling-standard/no-important-styles': 'error',
|
|
24
|
+
'@atlaskit/ui-styling-standard/no-imported-style-values': 'error',
|
|
25
|
+
'@atlaskit/ui-styling-standard/no-nested-selectors': 'error',
|
|
26
|
+
'@atlaskit/ui-styling-standard/no-styled': 'error',
|
|
27
|
+
'@atlaskit/ui-styling-standard/no-unsafe-selectors': 'error',
|
|
28
|
+
'@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
|
|
29
|
+
'@atlaskit/ui-styling-standard/use-compiled': 'error',
|
|
30
|
+
'@atlaskit/design-system/consistent-css-prop-usage': ['error', {
|
|
31
|
+
excludeReactComponents: true,
|
|
32
|
+
shouldAlwaysCheckXcss: true
|
|
33
|
+
}],
|
|
34
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
35
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
36
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
37
|
+
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
38
|
+
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
39
|
+
}],
|
|
40
|
+
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
41
|
+
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
42
|
+
}]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::884e28457d7860b1abca070fca8ab853>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'
|
|
7
|
+
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'],
|
|
8
8
|
rules: {
|
|
9
9
|
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
10
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
@@ -30,18 +30,11 @@ export default {
|
|
|
30
30
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
31
31
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
32
32
|
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
33
|
-
'@compiled/no-suppress-xcss': 'error',
|
|
34
|
-
'@compiled/no-js-xcss': 'error',
|
|
35
33
|
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
36
34
|
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
37
35
|
}],
|
|
38
36
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
37
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}],
|
|
41
|
-
'@compiled/jsx-pragma': ['error', {
|
|
42
|
-
runtime: 'classic',
|
|
43
|
-
onlyRunIfImportingCompiled: true,
|
|
44
|
-
importSources: ['@atlaskit/css']
|
|
45
38
|
}]
|
|
46
39
|
}
|
|
47
40
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
+
* @codegen <<SignedSource::4595bc1a07f9da4186e2df84cea56831>>
|
|
4
|
+
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
|
+
*/
|
|
6
|
+
import * as atlaskitDesignSystemPlugin from '@atlaskit/eslint-plugin-design-system';
|
|
7
|
+
export default {
|
|
8
|
+
plugins: {
|
|
9
|
+
// NOTE: The reference to this plugin is inserted dynamically while creating the plugin in `index.codegen.tsx`
|
|
10
|
+
'@atlaskit/design-system': atlaskitDesignSystemPlugin
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
14
|
+
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
15
|
+
'@atlaskit/ui-styling-standard/enforce-style-prop': 'error',
|
|
16
|
+
'@atlaskit/ui-styling-standard/local-cx-xcss': 'error',
|
|
17
|
+
'@atlaskit/ui-styling-standard/no-array-arguments': 'error',
|
|
18
|
+
'@atlaskit/ui-styling-standard/no-classname-prop': 'error',
|
|
19
|
+
'@atlaskit/ui-styling-standard/no-container-queries': 'error',
|
|
20
|
+
'@atlaskit/ui-styling-standard/no-dynamic-styles': 'error',
|
|
21
|
+
'@atlaskit/ui-styling-standard/no-exported-styles': 'error',
|
|
22
|
+
'@atlaskit/ui-styling-standard/no-global-styles': 'error',
|
|
23
|
+
'@atlaskit/ui-styling-standard/no-important-styles': 'error',
|
|
24
|
+
'@atlaskit/ui-styling-standard/no-imported-style-values': 'error',
|
|
25
|
+
'@atlaskit/ui-styling-standard/no-nested-selectors': 'error',
|
|
26
|
+
'@atlaskit/ui-styling-standard/no-styled': 'error',
|
|
27
|
+
'@atlaskit/ui-styling-standard/no-unsafe-selectors': 'error',
|
|
28
|
+
'@atlaskit/ui-styling-standard/no-unsafe-values': 'error',
|
|
29
|
+
'@atlaskit/ui-styling-standard/use-compiled': 'error',
|
|
30
|
+
'@atlaskit/design-system/consistent-css-prop-usage': ['error', {
|
|
31
|
+
excludeReactComponents: true,
|
|
32
|
+
shouldAlwaysCheckXcss: true
|
|
33
|
+
}],
|
|
34
|
+
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
35
|
+
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
36
|
+
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
37
|
+
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
38
|
+
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
39
|
+
}],
|
|
40
|
+
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
41
|
+
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
42
|
+
}]
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
3
|
-
* @codegen <<SignedSource::
|
|
3
|
+
* @codegen <<SignedSource::884e28457d7860b1abca070fca8ab853>>
|
|
4
4
|
* @codegenCommand yarn workspace @atlaskit/eslint-plugin-ui-styling-standard codegen
|
|
5
5
|
*/
|
|
6
6
|
export default {
|
|
7
|
-
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'
|
|
7
|
+
plugins: ['@atlaskit/ui-styling-standard', '@atlaskit/design-system'],
|
|
8
8
|
rules: {
|
|
9
9
|
'@atlaskit/ui-styling-standard/atlaskit-theme': 'error',
|
|
10
10
|
'@atlaskit/ui-styling-standard/convert-props-syntax': 'error',
|
|
@@ -30,18 +30,11 @@ export default {
|
|
|
30
30
|
'@atlaskit/design-system/no-css-tagged-template-expression': 'error',
|
|
31
31
|
'@atlaskit/design-system/no-keyframes-tagged-template-expression': 'error',
|
|
32
32
|
'@atlaskit/design-system/no-styled-tagged-template-expression': 'error',
|
|
33
|
-
'@compiled/no-suppress-xcss': 'error',
|
|
34
|
-
'@compiled/no-js-xcss': 'error',
|
|
35
33
|
'@atlaskit/design-system/no-empty-styled-expression': ['error', {
|
|
36
34
|
importSources: ['@compiled/react', '@atlaskit/css', '@emotion/core', '@emotion/react', '@emotion/styled', 'styled-components']
|
|
37
35
|
}],
|
|
38
36
|
'@atlaskit/design-system/no-invalid-css-map': ['error', {
|
|
39
37
|
allowedFunctionCalls: [['@atlaskit/tokens', 'token']]
|
|
40
|
-
}],
|
|
41
|
-
'@compiled/jsx-pragma': ['error', {
|
|
42
|
-
runtime: 'classic',
|
|
43
|
-
onlyRunIfImportingCompiled: true,
|
|
44
|
-
importSources: ['@atlaskit/css']
|
|
45
38
|
}]
|
|
46
39
|
}
|
|
47
40
|
};
|