@atlaskit/eslint-plugin-ui-styling-standard 3.0.3 → 3.0.5

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +28 -28
  3. package/dist/cjs/rules/convert-props-syntax/index.js +1 -1
  4. package/dist/cjs/rules/enforce-style-prop/index.js +1 -1
  5. package/dist/cjs/rules/local-cx-xcss/index.js +1 -1
  6. package/dist/cjs/rules/no-array-arguments/index.js +1 -1
  7. package/dist/cjs/rules/no-atlaskit-theme/index.js +1 -1
  8. package/dist/cjs/rules/no-classname-prop/index.js +1 -1
  9. package/dist/cjs/rules/no-container-queries/index.js +22 -23
  10. package/dist/cjs/rules/no-dynamic-styles/index.js +1 -1
  11. package/dist/cjs/rules/no-exported-styles/index.js +1 -1
  12. package/dist/cjs/rules/no-global-styles/index.js +2 -2
  13. package/dist/cjs/rules/no-important-styles/index.js +1 -1
  14. package/dist/cjs/rules/no-imported-style-values/index.js +9 -3
  15. package/dist/cjs/rules/no-nested-selectors/index.js +4 -2
  16. package/dist/cjs/rules/no-styled/index.js +1 -1
  17. package/dist/cjs/rules/no-unsafe-selectors/index.js +10 -10
  18. package/dist/cjs/rules/no-unsafe-selectors/lint-selector.js +6 -1
  19. package/dist/cjs/rules/no-unsafe-selectors/source-position-utils.js +5 -0
  20. package/dist/cjs/rules/no-unused-cssmap-properties/index.js +1 -1
  21. package/dist/cjs/rules/utils/parse-selector.js +6 -0
  22. package/dist/es2019/rules/convert-props-syntax/index.js +1 -1
  23. package/dist/es2019/rules/enforce-style-prop/index.js +1 -1
  24. package/dist/es2019/rules/local-cx-xcss/index.js +1 -1
  25. package/dist/es2019/rules/no-array-arguments/index.js +1 -1
  26. package/dist/es2019/rules/no-atlaskit-theme/index.js +1 -1
  27. package/dist/es2019/rules/no-classname-prop/index.js +1 -1
  28. package/dist/es2019/rules/no-container-queries/index.js +22 -23
  29. package/dist/es2019/rules/no-dynamic-styles/index.js +1 -1
  30. package/dist/es2019/rules/no-exported-styles/index.js +1 -1
  31. package/dist/es2019/rules/no-global-styles/index.js +2 -2
  32. package/dist/es2019/rules/no-important-styles/index.js +1 -1
  33. package/dist/es2019/rules/no-imported-style-values/index.js +10 -4
  34. package/dist/es2019/rules/no-nested-selectors/index.js +2 -2
  35. package/dist/es2019/rules/no-styled/index.js +1 -1
  36. package/dist/es2019/rules/no-unsafe-selectors/index.js +10 -10
  37. package/dist/es2019/rules/no-unsafe-selectors/lint-selector.js +7 -1
  38. package/dist/es2019/rules/no-unsafe-selectors/source-position-utils.js +5 -0
  39. package/dist/es2019/rules/no-unused-cssmap-properties/index.js +1 -1
  40. package/dist/es2019/rules/utils/parse-selector.js +6 -0
  41. package/dist/esm/rules/convert-props-syntax/index.js +1 -1
  42. package/dist/esm/rules/enforce-style-prop/index.js +1 -1
  43. package/dist/esm/rules/local-cx-xcss/index.js +1 -1
  44. package/dist/esm/rules/no-array-arguments/index.js +1 -1
  45. package/dist/esm/rules/no-atlaskit-theme/index.js +1 -1
  46. package/dist/esm/rules/no-classname-prop/index.js +1 -1
  47. package/dist/esm/rules/no-container-queries/index.js +22 -23
  48. package/dist/esm/rules/no-dynamic-styles/index.js +1 -1
  49. package/dist/esm/rules/no-exported-styles/index.js +1 -1
  50. package/dist/esm/rules/no-global-styles/index.js +2 -2
  51. package/dist/esm/rules/no-important-styles/index.js +1 -1
  52. package/dist/esm/rules/no-imported-style-values/index.js +9 -3
  53. package/dist/esm/rules/no-nested-selectors/index.js +4 -2
  54. package/dist/esm/rules/no-styled/index.js +1 -1
  55. package/dist/esm/rules/no-unsafe-selectors/index.js +10 -10
  56. package/dist/esm/rules/no-unsafe-selectors/lint-selector.js +7 -1
  57. package/dist/esm/rules/no-unsafe-selectors/source-position-utils.js +5 -0
  58. package/dist/esm/rules/no-unused-cssmap-properties/index.js +1 -1
  59. package/dist/esm/rules/utils/parse-selector.js +6 -0
  60. package/dist/types/rules/no-unsafe-selectors/lint-selector.d.ts +16 -2
  61. package/dist/types/rules/no-unsafe-selectors/source-position-utils.d.ts +9 -4
  62. package/dist/types/rules/utils/parse-selector.d.ts +17 -4
  63. package/package.json +4 -3
@@ -71,7 +71,7 @@ var rule = createLintRule({
71
71
  severity: 'warn'
72
72
  },
73
73
  messages: {
74
- 'unused-property': "The \"{{propertyName}}\" style is never used. Remove it from cssMap, or apply it to the intended element if the style is still required."
74
+ 'unused-property': 'The "{{propertyName}}" style is never used. Remove it from cssMap, or apply it to the intended element if the style is still required.'
75
75
  },
76
76
  type: 'problem'
77
77
  },
@@ -1,6 +1,12 @@
1
1
  import cssSelectorParser from 'postcss-selector-parser';
2
2
  import { getSourceCode } from '@atlaskit/eslint-utils/context-compat';
3
3
  var cssSelectorProcessor = cssSelectorParser();
4
+
5
+ /**
6
+ * Structural stand-in for postcss-selector-parser's Root AST. Avoid returning the
7
+ * library's Selector/Container types — under TSRS they expand into an infinite cycle.
8
+ */
9
+
4
10
  var selectorCache = new WeakMap();
5
11
 
6
12
  /**
@@ -1,10 +1,24 @@
1
1
  import type { Rule } from 'eslint';
2
2
  import type * as ESTree from 'eslint-codemod-utils';
3
- import { type Selector } from 'postcss-selector-parser';
3
+ /**
4
+ * Structural stand-ins for postcss-selector-parser types. Importing Selector /
5
+ * Pseudo / Nesting under TSRS expands into an infinite Container/Diff cycle.
6
+ */
7
+ type SelectorNodeLike = {
8
+ type: string;
9
+ sourceIndex: number;
10
+ value: string;
11
+ prev: () => unknown;
12
+ next: () => unknown;
13
+ };
14
+ type SelectorLike = {
15
+ first: SelectorNodeLike;
16
+ walk: (callback: (node: unknown) => false | undefined) => void;
17
+ };
4
18
  type CheckArgs = {
5
19
  context: Rule.RuleContext;
6
20
  sourceNode: ESTree.Node;
7
- selector: Selector;
21
+ selector: SelectorLike;
8
22
  config: {
9
23
  shouldAlwaysInsertNestingSelectorForAmbiguousPseudos: boolean;
10
24
  };
@@ -1,13 +1,18 @@
1
1
  import type * as ESTree from 'eslint-codemod-utils';
2
- import { type Node as SelectorNode } from 'postcss-selector-parser';
3
2
  type Range = [number, number];
3
+ /**
4
+ * Structural stand-in for postcss-selector-parser's Node. Avoid importing that
5
+ * Node type — under TSRS it expands into an infinite Container/Diff cycle.
6
+ */
7
+ type SelectorNodeWithValue = {
8
+ sourceIndex: number;
9
+ value: string;
10
+ };
4
11
  export declare function getRangeFromNode({ node, sourceNode, }: {
5
12
  /**
6
13
  * The selector AST node to get the range of.
7
14
  */
8
- node: SelectorNode & {
9
- value: string;
10
- };
15
+ node: SelectorNodeWithValue;
11
16
  /**
12
17
  * The source ESTree node whose value was parsed to obtain the selector AST.
13
18
  *
@@ -1,9 +1,22 @@
1
1
  import type { Rule } from 'eslint';
2
- import cssSelectorParser from 'postcss-selector-parser';
3
- declare const cssSelectorProcessor: ReturnType<typeof cssSelectorParser>;
4
- type ParsedSelector = ReturnType<typeof cssSelectorProcessor.astSync>;
2
+ /**
3
+ * Structural stand-in for postcss-selector-parser's Root AST. Avoid returning the
4
+ * library's Selector/Container types — under TSRS they expand into an infinite cycle.
5
+ */
6
+ export type ParsedSelector = {
7
+ nodes: Array<{
8
+ nodes: unknown[];
9
+ first: {
10
+ type: string;
11
+ sourceIndex: number;
12
+ value: string;
13
+ prev: () => unknown;
14
+ next: () => unknown;
15
+ };
16
+ walk: (callback: (node: unknown) => false | undefined) => void;
17
+ }>;
18
+ };
5
19
  /**
6
20
  * Parse each selector once per linted source file. Consumers treat the returned AST as read-only.
7
21
  */
8
22
  export declare function parseSelector(context: Rule.RuleContext, selectorText: string): ParsedSelector;
9
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/eslint-plugin-ui-styling-standard",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
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",
@@ -28,7 +28,7 @@
28
28
  ],
29
29
  "atlaskit:src": "src/index.tsx",
30
30
  "dependencies": {
31
- "@atlaskit/eslint-plugin-design-system": "^16.14.0",
31
+ "@atlaskit/eslint-plugin-design-system": "^16.16.0",
32
32
  "@atlaskit/eslint-utils": "^3.1.0",
33
33
  "@babel/runtime": "^7.0.0",
34
34
  "@typescript-eslint/utils": "^8.64.0",
@@ -42,8 +42,9 @@
42
42
  "postcss-selector-parser": "^6.0.16"
43
43
  },
44
44
  "devDependencies": {
45
+ "@af/codegen-utils": "workspace:^",
45
46
  "@af/formatting": "workspace:^",
46
- "@atlaskit/ds-lib": "^8.0.0",
47
+ "@atlaskit/ds-lib": "^9.0.0",
47
48
  "@atlassian/codegen": "^0.3.0",
48
49
  "@atlassian/ts-loader": "^0.1.0",
49
50
  "@eslint/eslintrc": "^3.0.2",