@atlaskit/eslint-plugin-ui-styling-standard 0.16.0 → 0.16.1

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/eslint-plugin-ui-styling-standard
2
2
 
3
+ ## 0.16.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#110975](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110975)
8
+ [`47a912f14bb6f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/47a912f14bb6f) -
9
+ Fixed a bug in `walkStyleProperties` that could result in `styled(BaseComponent)({})` styles to
10
+ not be linted.
11
+
3
12
  ## 0.16.0
4
13
 
5
14
  ### Minor Changes
@@ -2,4 +2,6 @@
2
2
 
3
3
  Ensures consistency with all `css` and `xcss` prop usages.
4
4
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/consistent-css-prop-usage/usage for more details.
5
+ This rule is maintained by another package and configured here; refer to
6
+ https://atlassian.design/components/eslint-plugin-design-system/consistent-css-prop-usage/usage for
7
+ more details.
@@ -1,5 +1,8 @@
1
1
  # @atlaskit/design-system/no-css-tagged-template-expression
2
2
 
3
- Disallows any `css` tagged template expressions that originate from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
3
+ Disallows any `css` tagged template expressions that originate from a CSS-in-JS library, including
4
+ `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
4
5
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/no-css-tagged-template-expression/usage for more details.
6
+ This rule is maintained by another package and configured here; refer to
7
+ https://atlassian.design/components/eslint-plugin-design-system/no-css-tagged-template-expression/usage
8
+ for more details.
@@ -1,5 +1,8 @@
1
1
  # @atlaskit/design-system/no-empty-styled-expression
2
2
 
3
- Forbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX elements).
3
+ Forbids any styled expression to be used when passing empty arguments to styled.div() (or other JSX
4
+ elements).
4
5
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/no-empty-styled-expression/usage for more details.
6
+ This rule is maintained by another package and configured here; refer to
7
+ https://atlassian.design/components/eslint-plugin-design-system/no-empty-styled-expression/usage for
8
+ more details.
@@ -1,5 +1,8 @@
1
1
  # @atlaskit/design-system/no-exported-css
2
2
 
3
- Forbid exporting `css` function calls. Exporting `css` function calls can result in unexpected behaviour at runtime, and is not statically analysable.
3
+ Forbid exporting `css` function calls. Exporting `css` function calls can result in unexpected
4
+ behaviour at runtime, and is not statically analysable.
4
5
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/no-exported-css/usage for more details.
6
+ This rule is maintained by another package and configured here; refer to
7
+ https://atlassian.design/components/eslint-plugin-design-system/no-exported-css/usage for more
8
+ details.
@@ -1,5 +1,8 @@
1
1
  # @atlaskit/design-system/no-exported-keyframes
2
2
 
3
- Forbid exporting `keyframes` function calls. Exporting `css` function calls can result in unexpected behaviour at runtime, and is not statically analysable.
3
+ Forbid exporting `keyframes` function calls. Exporting `css` function calls can result in unexpected
4
+ behaviour at runtime, and is not statically analysable.
4
5
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/no-exported-keyframes/usage for more details.
6
+ This rule is maintained by another package and configured here; refer to
7
+ https://atlassian.design/components/eslint-plugin-design-system/no-exported-keyframes/usage for more
8
+ details.
@@ -1,5 +1,8 @@
1
1
  # @atlaskit/design-system/no-invalid-css-map
2
2
 
3
- Ensure that all usages of the cssMap API are valid, and enforces the format of the object that is passed to cssMap. This is intended to be used alongside TypeScript's type-checking.
3
+ Ensure that all usages of the cssMap API are valid, and enforces the format of the object that is
4
+ passed to cssMap. This is intended to be used alongside TypeScript's type-checking.
4
5
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/no-invalid-css-map/usage for more details.
6
+ This rule is maintained by another package and configured here; refer to
7
+ https://atlassian.design/components/eslint-plugin-design-system/no-invalid-css-map/usage for more
8
+ details.
@@ -2,4 +2,6 @@
2
2
 
3
3
  Disallows using xcss prop inside JavaScript files.
4
4
 
5
- This rule is maintained by another package and configured here; refer to https://github.com/atlassian-labs/compiled/tree/master/packages/eslint-plugin/src/rules/no-js-xcss for more details.
5
+ This rule is maintained by another package and configured here; refer to
6
+ https://github.com/atlassian-labs/compiled/tree/master/packages/eslint-plugin/src/rules/no-js-xcss
7
+ for more details.
@@ -1,5 +1,8 @@
1
1
  # @atlaskit/design-system/no-keyframes-tagged-template-expression
2
2
 
3
- Disallows any `keyframes` tagged template expressions that originate from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
3
+ Disallows any `keyframes` tagged template expressions that originate from a CSS-in-JS library,
4
+ including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
4
5
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/no-keyframes-tagged-template-expression/usage for more details.
6
+ This rule is maintained by another package and configured here; refer to
7
+ https://atlassian.design/components/eslint-plugin-design-system/no-keyframes-tagged-template-expression/usage
8
+ for more details.
@@ -1,5 +1,8 @@
1
1
  # @atlaskit/design-system/no-styled-tagged-template-expression
2
2
 
3
- Disallows any `styled` tagged template expressions that originate from from a CSS-in-JS library, including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
3
+ Disallows any `styled` tagged template expressions that originate from from a CSS-in-JS library,
4
+ including `@atlaskit/css`, `@compiled/react`, Emotion, and `styled-components`.
4
5
 
5
- This rule is maintained by another package and configured here; refer to https://atlassian.design/components/eslint-plugin-design-system/no-styled-tagged-template-expression/usage for more details.
6
+ This rule is maintained by another package and configured here; refer to
7
+ https://atlassian.design/components/eslint-plugin-design-system/no-styled-tagged-template-expression/usage
8
+ for more details.
@@ -1,12 +1,15 @@
1
1
  # @compiled/no-suppress-xcss
2
2
 
3
- Disallows supressing type violations when using the xcss prop. Supressing type violations will cause incidents and unexpected behaviour when code changes in the future.
3
+ Disallows supressing type violations when using the xcss prop. Supressing type violations will cause
4
+ incidents and unexpected behaviour when code changes in the future.
4
5
 
5
- Components that use xcss prop have explicitly declared what styles they should and should not accept, consumers must adhere to this API.
6
+ Components that use xcss prop have explicitly declared what styles they should and should not
7
+ accept, consumers must adhere to this API.
6
8
 
7
9
  ## Incorrect
8
10
 
9
- Do not suppress type violations; if the value doesn't match the type, fix the value or expect breaking changes in the future.
11
+ Do not suppress type violations; if the value doesn't match the type, fix the value or expect
12
+ breaking changes in the future.
10
13
 
11
14
  ```js
12
15
  // @ts-expect-error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-ui-styling-standard",
3
- "version": "0.16.0",
3
+ "version": "0.16.1",
4
4
  "author": "Atlassian Pty Ltd",
5
5
  "description": "The eslint plugin to enforce and educate on Atlassian's UI Styling Standard",
6
6
  "license": "Apache-2.0",
@@ -54,7 +54,7 @@
54
54
  "devDependencies": {
55
55
  "@af/formatting": "*",
56
56
  "@atlaskit/ds-lib": "^2.3.0",
57
- "@atlaskit/eslint-plugin-design-system": "^10.6.0",
57
+ "@atlaskit/eslint-plugin-design-system": "^10.7.0",
58
58
  "@atlassian/codegen": "*",
59
59
  "@compiled/eslint-plugin": "^0.13.6",
60
60
  "@types/eslint": "^8.56.6",
@@ -317,6 +317,19 @@ typescriptEslintTester.run(
317
317
  `,
318
318
  errors: [{ messageId: 'no-nested-selectors' }],
319
319
  },
320
+ {
321
+ name: 'Nested selector inside styled(BaseComponent)()',
322
+ code: `
323
+ import { styled } from '@compiled/react';
324
+ import { BaseComponent } from './base-component';
325
+ styled(BaseComponent)({
326
+ '> span': {
327
+ color: 'orange'
328
+ }
329
+ });
330
+ `,
331
+ errors: [{ messageId: 'no-nested-selectors' }],
332
+ },
320
333
  ],
321
334
  },
322
335
  );
@@ -127,6 +127,25 @@ tester.run('no-unsafe-selectors', rule, {
127
127
  },
128
128
  ],
129
129
  },
130
+ {
131
+ name: 'styled API extending base component',
132
+ code: `
133
+ import { styled } from '@compiled/react';
134
+ import { BaseComponent } from './base-component';
135
+
136
+ styled(BaseComponent)({
137
+ '@keyframes fadeIn': {},
138
+ });
139
+ `,
140
+ errors: [
141
+ {
142
+ messageId: 'no-keyframes-at-rules',
143
+ line: 6,
144
+ column: 11,
145
+ endColumn: 30,
146
+ },
147
+ ],
148
+ },
130
149
  {
131
150
  name: 'keyframes API invalid usage',
132
151
  code: outdent`