@master/eslint-plugin-css 2.0.0-rc.84 → 2.0.0-rc.86

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/README.md CHANGED
@@ -2,52 +2,52 @@
2
2
  <div align="center">
3
3
 
4
4
  <p align="center">
5
- <a href="https://css.master.co">
6
- <picture>
7
- <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
8
- <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
9
- <img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
10
- </picture>
11
- </a>
5
+ <a href="https://css.master.co">
6
+ <picture>
7
+ <source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/201701649-3bb7d698-abec-4d5f-ac30-ccc4d7bafcd4.svg">
8
+ <source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg">
9
+ <img alt="Master CSS" src="https://user-images.githubusercontent.com/33840671/201703010-77bf2373-9899-40cc-98f5-30cf9b546941.svg" width="100%">
10
+ </picture>
11
+ </a>
12
12
  </p>
13
13
  <p align="center">An ESLint plugin enforcing a consistent coding style for Master CSS</p>
14
14
 
15
15
  <p align="center">
16
- <a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
17
- <picture>
18
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
19
- <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
20
- <img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
21
- </picture>
22
- </a>
23
- <a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/eslint-plugin-css">
24
- <picture>
25
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/eslint-plugin-css?color=212022&label=%20&logo=npm&style=for-the-badge">
26
- <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/eslint-plugin-css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
27
- <img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/eslint-plugin-css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
28
- </picture>
29
- </a>
30
- <a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
31
- <picture>
32
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
33
- <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
34
- <img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
35
- </picture>
36
- </a>
37
- <a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
38
- <picture>
39
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
40
- <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
41
- <img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
42
- </picture>
43
- </a>
44
- <a aria-label="Github Actions" href="https://github.com/master-co/css/actions/workflows/ci-release.yml">
45
- <picture>
46
- <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
47
- <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
48
- <img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
49
- </picture>
50
- </a>
16
+ <a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/master-co/css/releases">
17
+ <picture>
18
+ <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
19
+ <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
20
+ <img alt="NPM Version" src="https://img.shields.io/github/v/release/master-co/css?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
21
+ </picture>
22
+ </a>
23
+ <a aria-label="NPM Package" href="https://www.npmjs.com/package/@master/eslint-plugin-css">
24
+ <picture>
25
+ <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/@master/eslint-plugin-css?color=212022&label=%20&logo=npm&style=for-the-badge">
26
+ <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/@master/eslint-plugin-css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
27
+ <img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/@master/eslint-plugin-css?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
28
+ </picture>
29
+ </a>
30
+ <a aria-label="Discord Community" href="https://discord.gg/sZNKpAAAw6">
31
+ <picture>
32
+ <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/discord/917780624314613760?color=212022&label=%20&logo=discord&style=for-the-badge">
33
+ <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
34
+ <img alt="Discord online" src="https://img.shields.io/discord/917780624314613760?color=f6f7f8&label=%20&logo=discord&style=for-the-badge">
35
+ </picture>
36
+ </a>
37
+ <a aria-label="Follow @mastercorg" href="https://twitter.com/mastercorg">
38
+ <picture>
39
+ <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
40
+ <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
41
+ <img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
42
+ </picture>
43
+ </a>
44
+ <a aria-label="Github Actions" href="https://github.com/master-co/css/actions/workflows/ci-release.yml">
45
+ <picture>
46
+ <source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
47
+ <source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
48
+ <img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/master-co/css/ci-release.yml?branch=rc&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
49
+ </picture>
50
+ </a>
51
51
  </p>
52
52
 
53
53
  </div>
@@ -73,26 +73,26 @@ import htmlParser from '@angular-eslint/template-parser'
73
73
  import tsParser from '@typescript-eslint/parser'
74
74
 
75
75
  export default defineConfig([
76
- {
77
- files: ['**/*.html'],
78
- languageOptions: {
79
- parser: htmlParser
80
- }
81
- },
82
- {
83
- files: ['**/*.{ts,tsx}'],
84
- languageOptions: {
85
- parser: tsParser
86
- }
87
- },
88
- ...css,
89
- {
90
- rules: {
91
- '@master/css/no-invalid-classes': ['error', {
92
- disallowUnknownClass: true
93
- }]
94
- }
76
+ {
77
+ files: ['**/*.html'],
78
+ languageOptions: {
79
+ parser: htmlParser
95
80
  }
81
+ },
82
+ {
83
+ files: ['**/*.{ts,tsx}'],
84
+ languageOptions: {
85
+ parser: tsParser
86
+ }
87
+ },
88
+ ...css,
89
+ {
90
+ rules: {
91
+ '@master/css/no-invalid-classes': ['error', {
92
+ disallowUnknownClass: true
93
+ }]
94
+ }
95
+ }
96
96
  ])
97
97
  ```
98
98
 
@@ -106,11 +106,11 @@ Sorts Master CSS classes into a consistent and logical order.
106
106
  import { defineConfig } from 'eslint/config'
107
107
 
108
108
  export default defineConfig([
109
- {
110
- rules: {
111
- '@master/css/sort-classes': 'warn'
112
- }
109
+ {
110
+ rules: {
111
+ '@master/css/sort-classes': 'warn'
113
112
  }
113
+ }
114
114
  ])
115
115
  ```
116
116
 
@@ -122,11 +122,11 @@ Disallows invalid Master CSS classes.
122
122
  import { defineConfig } from 'eslint/config'
123
123
 
124
124
  export default defineConfig([
125
- {
126
- rules: {
127
- '@master/css/no-invalid-classes': 'error'
128
- }
125
+ {
126
+ rules: {
127
+ '@master/css/no-invalid-classes': 'error'
129
128
  }
129
+ }
130
130
  ])
131
131
  ```
132
132
 
@@ -136,13 +136,13 @@ Set `disallowUnknownClass: true` to reject classes that do not match the active
136
136
  import { defineConfig } from 'eslint/config'
137
137
 
138
138
  export default defineConfig([
139
- {
140
- rules: {
141
- '@master/css/no-invalid-classes': ['error', {
142
- disallowUnknownClass: true
143
- }]
144
- }
139
+ {
140
+ rules: {
141
+ '@master/css/no-invalid-classes': ['error', {
142
+ disallowUnknownClass: true
143
+ }]
145
144
  }
145
+ }
146
146
  ])
147
147
  ```
148
148
 
@@ -154,11 +154,11 @@ Prefers canonical Master CSS class forms, including semantic utilities, theme to
154
154
  import { defineConfig } from 'eslint/config'
155
155
 
156
156
  export default defineConfig([
157
- {
158
- rules: {
159
- '@master/css/prefer-canonical-classes': 'warn'
160
- }
157
+ {
158
+ rules: {
159
+ '@master/css/prefer-canonical-classes': 'warn'
161
160
  }
161
+ }
162
162
  ])
163
163
  ```
164
164
 
@@ -173,7 +173,7 @@ import { defineConfig } from 'eslint/config'
173
173
  import css from '@master/eslint-config-css'
174
174
 
175
175
  export default defineConfig([
176
- ...css
176
+ ...css
177
177
  ])
178
178
  ```
179
179
 
@@ -185,21 +185,21 @@ You can disable specific canonicalization families:
185
185
  import { defineConfig } from 'eslint/config'
186
186
 
187
187
  export default defineConfig([
188
- {
189
- rules: {
190
- '@master/css/prefer-canonical-classes': ['warn', {
191
- preferStaticUtilities: true,
192
- preferThemeTokens: true,
193
- preferPropertyAliases: true,
194
- preferVariableReferences: true,
195
- preferMultiValueTokens: true,
196
- preferCompositionUtilities: true,
197
- preferConditionOrder: true,
198
- preferNativeDeclarationsInCompose: true,
199
- preferVariantBlocksInCompose: true
200
- }]
201
- }
188
+ {
189
+ rules: {
190
+ '@master/css/prefer-canonical-classes': ['warn', {
191
+ preferStaticUtilities: true,
192
+ preferThemeTokens: true,
193
+ preferPropertyAliases: true,
194
+ preferVariableReferences: true,
195
+ preferMultiValueTokens: true,
196
+ preferCompositionUtilities: true,
197
+ preferConditionOrder: true,
198
+ preferNativeDeclarationsInCompose: true,
199
+ preferVariantBlocksInCompose: true
200
+ }]
202
201
  }
202
+ }
203
203
  ])
204
204
  ```
205
205
 
@@ -211,11 +211,11 @@ Disallows classes that emit the same CSS declaration properties for the same var
211
211
  import { defineConfig } from 'eslint/config'
212
212
 
213
213
  export default defineConfig([
214
- {
215
- rules: {
216
- '@master/css/no-conflicting-classes': 'warn'
217
- }
214
+ {
215
+ rules: {
216
+ '@master/css/no-conflicting-classes': 'warn'
218
217
  }
218
+ }
219
219
  ])
220
220
  ```
221
221
 
@@ -229,14 +229,14 @@ Disallows raw values in token-backed utilities unless they are explicitly allowe
229
229
  import { defineConfig } from 'eslint/config'
230
230
 
231
231
  export default defineConfig([
232
- {
233
- rules: {
234
- '@master/css/no-unapproved-raw-values': ['warn', {
235
- allowProperties: ['width', 'height'],
236
- allowedPatterns: ['^var\\(', '^calc\\(']
237
- }]
238
- }
232
+ {
233
+ rules: {
234
+ '@master/css/no-unapproved-raw-values': ['warn', {
235
+ allowProperties: ['width', 'height'],
236
+ allowedPatterns: ['^var\\(', '^calc\\(']
237
+ }]
239
238
  }
239
+ }
240
240
  ])
241
241
  ```
242
242
 
@@ -250,17 +250,17 @@ Settings live under the `@master/css` settings key:
250
250
  import { defineConfig } from 'eslint/config'
251
251
 
252
252
  export default defineConfig([
253
- {
254
- settings: {
255
- '@master/css': {
256
- classAttributes: ['class', 'className'],
257
- classFunctions: ['clsx', 'classList.add'],
258
- classDeclarations: ['classes'],
259
- ignoredKeys: ['compoundVariants', 'defaultVariants'],
260
- manifest
261
- }
262
- }
253
+ {
254
+ settings: {
255
+ '@master/css': {
256
+ classAttributes: ['class', 'className'],
257
+ classFunctions: ['clsx', 'classList.add'],
258
+ classDeclarations: ['classes'],
259
+ ignoredKeys: ['compoundVariants', 'defaultVariants'],
260
+ manifest
261
+ }
263
262
  }
263
+ }
264
264
  ])
265
265
  ```
266
266
 
@@ -1,5 +1,4 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/base.d.ts
4
3
  declare const _default: Linter.Config;
5
4
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/legacy.d.ts
4
3
  declare const _default: Linter.LegacyConfig;
5
4
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/recommended.d.ts
4
3
  declare const _default: Linter.Config;
5
4
  //#endregion
@@ -1,5 +1,4 @@
1
1
  import { Linter } from "eslint";
2
-
3
2
  //#region src/configs/stylesheet.d.ts
4
3
  declare const _default: Linter.Config;
5
4
  //#endregion
@@ -1,11 +1,6 @@
1
1
  import { ESLintUtils } from "@typescript-eslint/utils";
2
-
3
2
  //#region src/create-rule.d.ts
4
- declare const _default: <Options extends readonly unknown[], MessageIds extends string>({
5
- meta,
6
- name,
7
- ...rule
8
- }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
3
+ declare const _default: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener> & {
9
4
  name: string;
10
5
  };
11
6
  //#endregion
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { TSESLint } from "@typescript-eslint/utils";
2
2
  import { Linter } from "eslint";
3
3
  import settings from "./settings.js";
4
-
5
4
  //#region src/index.d.ts
6
5
  declare const masterCSSPlugin: Omit<TSESLint.Linter.Plugin, 'configs'> & {
7
6
  configs: {
package/dist/plugin.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { TSESLint } from "@typescript-eslint/utils";
2
-
3
2
  //#region src/plugin.d.ts
4
3
  declare const plugin: TSESLint.Linter.Plugin;
5
4
  //#endregion
@@ -12,7 +12,7 @@ var no_conflicting_classes_default = create_rule_default({
12
12
  docs: { description: "Disallow conflicting Master CSS classes" },
13
13
  messages: {
14
14
  collisionClass: "{{message}}",
15
- partialCollisionClass: "Prefer \"{{replacement}}\" over \"{{actual}}\" because \"{{conflict}}\" overrides part of it."
15
+ partialCollisionClass: "{{message}}"
16
16
  },
17
17
  fixable: "code",
18
18
  schema: []
@@ -1,5 +1,5 @@
1
1
  //#region src/rules/no-invalid-classes.d.ts
2
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidClass" | "disallowUnknownClass", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
2
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"disallowUnknownClass" | "invalidClass", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
3
3
  name: string;
4
4
  };
5
5
  //#endregion
@@ -10,7 +10,7 @@ var no_unapproved_raw_values_default = create_rule_default({
10
10
  meta: {
11
11
  type: "suggestion",
12
12
  docs: { description: "Disallow unapproved raw values in token-backed Master CSS classes" },
13
- messages: { unapprovedRawValue: "Unexpected raw value \"{{value}}\" in \"{{className}}\". Use a token or allow it explicitly." },
13
+ messages: { unapprovedRawValue: "{{message}}" },
14
14
  fixable: null,
15
15
  schema: [{
16
16
  type: "object",
@@ -1,5 +1,4 @@
1
1
  import { CanonicalClassNameOptions } from "@master/css-lint";
2
-
3
2
  //#region src/rules/prefer-canonical-classes.d.ts
4
3
  declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferClass", [Required<CanonicalClassNameOptions>], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
5
4
  name: string;
@@ -11,7 +11,7 @@ var prefer_canonical_classes_default = create_rule_default({
11
11
  meta: {
12
12
  type: "suggestion",
13
13
  docs: { description: "Prefer canonical Master CSS classes" },
14
- messages: { preferClass: "Prefer \"{{recommended}}\" over \"{{actual}}\"." },
14
+ messages: { preferClass: "{{message}}" },
15
15
  fixable: "code",
16
16
  schema: [{
17
17
  type: "object",
@@ -11,7 +11,7 @@ var sort_classes_default = create_rule_default({
11
11
  type: "layout",
12
12
  fixable: "code",
13
13
  docs: { description: "Sort Master CSS classes" },
14
- messages: { invalidClassOrder: "No consistent class order followed." },
14
+ messages: { invalidClassOrder: "{{message}}" },
15
15
  schema: []
16
16
  },
17
17
  defaultOptions: [],
@@ -1,5 +1,4 @@
1
1
  import { JSONSchema4 } from "@typescript-eslint/utils/json-schema";
2
-
3
2
  //#region src/settings-schema.d.ts
4
3
  declare const masterCSSSettingsSchema: JSONSchema4;
5
4
  declare const noInvalidClassesOptionsSchema: JSONSchema4;
@@ -1,12 +1,11 @@
1
1
  import { MasterCSSManifest } from "./utils/master-css.js";
2
-
3
2
  //#region src/settings.d.ts
4
3
  declare const settings: {
5
- manifest: any;
6
4
  classAttributes: string[];
7
5
  classFunctions: string[];
8
6
  classDeclarations: string[];
9
7
  ignoredKeys: string[];
8
+ manifest: any;
10
9
  };
11
10
  interface Settings {
12
11
  classAttributes?: string[];
@@ -6,9 +6,9 @@ declare const _default: {
6
6
  parseForESLint(source: string): {
7
7
  ast: {
8
8
  type: string;
9
- body: any[];
10
- comments: any[];
11
- tokens: any[];
9
+ body: undefined[];
10
+ comments: undefined[];
11
+ tokens: undefined[];
12
12
  sourceType: string;
13
13
  range: number[];
14
14
  loc: {
@@ -23,7 +23,7 @@ declare const _default: {
23
23
  };
24
24
  };
25
25
  visitorKeys: {
26
- Program: any[];
26
+ Program: undefined[];
27
27
  };
28
28
  };
29
29
  };
@@ -1,7 +1,6 @@
1
1
  import { MasterCSSLintContentRuleOptions, MasterCSSLintRuleId } from "@master/css-lint";
2
2
  import { MasterCSS } from "@master/css-engine";
3
3
  import { RuleContext, RuleListener } from "@typescript-eslint/utils/ts-eslint";
4
-
5
4
  //#region src/utils/define-source-visitors.d.ts
6
5
  type SourceRuleOptions = MasterCSSLintContentRuleOptions[keyof MasterCSSLintContentRuleOptions];
7
6
  interface DefineSourceVisitorsOptions {
@@ -11,11 +10,6 @@ interface DefineSourceVisitorsOptions {
11
10
  ruleOptions?: SourceRuleOptions;
12
11
  }
13
12
  declare function shouldUseSourceVisitors(context: RuleContext<any, any[]>): boolean;
14
- declare function defineSourceVisitors({
15
- context,
16
- css,
17
- ruleId,
18
- ruleOptions
19
- }: DefineSourceVisitorsOptions): RuleListener;
13
+ declare function defineSourceVisitors({ context, css, ruleId, ruleOptions }: DefineSourceVisitorsOptions): RuleListener;
20
14
  //#endregion
21
15
  export { defineSourceVisitors as default, shouldUseSourceVisitors };
@@ -1,4 +1,4 @@
1
- import { messageIdByCode, stringifyLintDiagnosticData } from "./report-lint-diagnostics.js";
1
+ import { messageIdByCode, stringifyLintDiagnosticMessageData } from "./report-lint-diagnostics.js";
2
2
  import { lintMasterCSSContent, masterCSSLintRuleIds } from "@master/css-lint";
3
3
  //#region src/utils/define-source-visitors.ts
4
4
  const SOURCE_LINT_FILE_RE = /\.mdx$/i;
@@ -27,7 +27,7 @@ function reportSourceDiagnostic(context, node, diagnostic) {
27
27
  },
28
28
  ...messageId ? {
29
29
  messageId,
30
- data: stringifyLintDiagnosticData(diagnostic.data || { message: diagnostic.message })
30
+ data: stringifyLintDiagnosticMessageData(diagnostic)
31
31
  } : { message: diagnostic.message }
32
32
  };
33
33
  if (fix) descriptor.fix = (fixer) => fixer.replaceTextRange([fix.range.start, fix.range.end], fix.text);
@@ -2,12 +2,8 @@ import { TSESTree } from "@typescript-eslint/utils";
2
2
  import { Settings } from "../settings.js";
3
3
  import { RuleContext, RuleListener } from "@typescript-eslint/utils/ts-eslint";
4
4
  import resolveClassNode from "./resolve-class-node.js";
5
-
6
5
  //#region src/utils/define-visitors.d.ts
7
- declare function defineVisitors({
8
- context,
9
- settings
10
- }: {
6
+ declare function defineVisitors({ context, settings }: {
11
7
  context: RuleContext<any, any[]>;
12
8
  settings: Settings;
13
9
  }, visitNode: (node: TSESTree.Node, resolved: ReturnType<typeof resolveClassNode>) => void): RuleListener;
@@ -1,6 +1,5 @@
1
1
  import { createCSSWithNativeDeclarations } from "@master/css-validator";
2
2
  import { MasterCSS, MasterCSSManifest } from "@master/css";
3
-
4
3
  //#region src/utils/master-css.d.ts
5
4
  declare const defaultManifest: MasterCSSManifest;
6
5
  //#endregion
@@ -2,7 +2,6 @@ import { TSESTree } from "@typescript-eslint/utils";
2
2
  import { MasterCSSLintDiagnostic, MasterCSSLintFix } from "@master/css-lint";
3
3
  import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
4
4
  import { ResolvedClassNode } from "./resolve-class-node.js";
5
-
6
5
  //#region src/utils/report-lint-diagnostics.d.ts
7
6
  type FixRange = [number, number];
8
7
  interface ReportLintDiagnosticsOptions {
@@ -15,6 +14,9 @@ declare const messageIdByCode: Record<string, string>;
15
14
  declare function stringifyLintDiagnosticData(data?: MasterCSSLintDiagnostic['data']): {
16
15
  [k: string]: string;
17
16
  };
17
+ declare function stringifyLintDiagnosticMessageData(diagnostic: Pick<MasterCSSLintDiagnostic, 'data' | 'message'>): {
18
+ [k: string]: string;
19
+ };
18
20
  declare function reportLintDiagnostics(context: RuleContext<any, any[]>, node: TSESTree.Node, resolved: ResolvedClassNode, diagnostics: MasterCSSLintDiagnostic[], options?: ReportLintDiagnosticsOptions): void;
19
21
  //#endregion
20
- export { reportLintDiagnostics as default, messageIdByCode, stringifyLintDiagnosticData };
22
+ export { reportLintDiagnostics as default, messageIdByCode, stringifyLintDiagnosticData, stringifyLintDiagnosticMessageData };
@@ -13,6 +13,12 @@ const messageIdByCode = {
13
13
  function stringifyLintDiagnosticData(data = {}) {
14
14
  return Object.fromEntries(Object.entries(data).filter(([, value]) => value !== void 0).map(([key, value]) => [key, Array.isArray(value) ? value.join(", ") : String(value)]));
15
15
  }
16
+ function stringifyLintDiagnosticMessageData(diagnostic) {
17
+ return stringifyLintDiagnosticData({
18
+ ...diagnostic.data,
19
+ message: diagnostic.message
20
+ });
21
+ }
16
22
  function defaultFix(resolved, fix) {
17
23
  if (fix.scope === "directive") return;
18
24
  return {
@@ -35,7 +41,7 @@ function reportLintDiagnostics(context, node, resolved, diagnostics, options = {
35
41
  },
36
42
  ...messageId ? {
37
43
  messageId,
38
- data: stringifyLintDiagnosticData(diagnostic.data || { message: diagnostic.message })
44
+ data: stringifyLintDiagnosticMessageData(diagnostic)
39
45
  } : { message: diagnostic.message }
40
46
  };
41
47
  if (fix) descriptor.fix = (fixer) => fixer.replaceTextRange(fix.range, fix.text);
@@ -43,4 +49,4 @@ function reportLintDiagnostics(context, node, resolved, diagnostics, options = {
43
49
  }
44
50
  }
45
51
  //#endregion
46
- export { reportLintDiagnostics as default, messageIdByCode, stringifyLintDiagnosticData };
52
+ export { reportLintDiagnostics as default, messageIdByCode, stringifyLintDiagnosticData, stringifyLintDiagnosticMessageData };
@@ -1,5 +1,4 @@
1
1
  import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
2
-
3
2
  //#region src/utils/resolve-class-node.d.ts
4
3
  type ResolvedClassListUnescape = string | false;
5
4
  interface ResolvedClassListNode {
@@ -1,6 +1,5 @@
1
1
  import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
2
2
  import { ResolvedClassNode } from "./resolve-class-node.js";
3
-
4
3
  //#region src/utils/resolve-compose-directive-class-nodes.d.ts
5
4
  interface ResolvedComposeDirectiveClassNode extends ResolvedClassNode {
6
5
  directiveStart: number;
@@ -1,14 +1,13 @@
1
1
  import { MasterCSS } from "./master-css.js";
2
2
  import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
3
-
4
3
  //#region src/utils/resolve-context.d.ts
5
4
  declare function resolveContext(context: RuleContext<any, any[]>): {
6
5
  settings: {
7
- manifest: any;
8
6
  classAttributes: string[];
9
7
  classFunctions: string[];
10
8
  classDeclarations: string[];
11
9
  ignoredKeys: string[];
10
+ manifest: any;
12
11
  };
13
12
  options: any;
14
13
  css: MasterCSS;
@@ -1,7 +1,6 @@
1
1
  import { TSESTree } from "@typescript-eslint/utils";
2
2
  import { RuleContext } from "@typescript-eslint/utils/ts-eslint";
3
3
  import resolveClassNode from "./resolve-class-node.js";
4
-
5
4
  //#region src/utils/with-visit-class-node.d.ts
6
5
  declare function withVisitClassNode(visit: (node: TSESTree.Node, resolved: ReturnType<typeof resolveClassNode>) => void, context: RuleContext<any, any[]>): (node: any) => void;
7
6
  //#endregion
package/package.json CHANGED
@@ -47,12 +47,12 @@
47
47
  "dependencies": {
48
48
  "@typescript-eslint/utils": "^8.61.1",
49
49
  "typescript-eslint": "^8.61.1",
50
- "@master/css": "^2.0.0-rc.84",
51
- "@master/css-lexer": "^2.0.0-rc.84",
52
- "@master/css-preset": "^2.0.0-rc.84",
53
- "@master/css-project": "^2.0.0-rc.84",
54
- "@master/css-lint": "^2.0.0-rc.84",
55
- "@master/css-validator": "^2.0.0-rc.84"
50
+ "@master/css": "^2.0.0-rc.86",
51
+ "@master/css-lint": "^2.0.0-rc.86",
52
+ "@master/css-project": "^2.0.0-rc.86",
53
+ "@master/css-preset": "^2.0.0-rc.86",
54
+ "@master/css-lexer": "^2.0.0-rc.86",
55
+ "@master/css-validator": "^2.0.0-rc.86"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@angular-eslint/template-parser": "^21.4.0",
@@ -65,9 +65,9 @@
65
65
  "svelte-eslint-parser": "^1.8.0",
66
66
  "ts-node": "^10.9.2",
67
67
  "vue-eslint-parser": "^10.4.1",
68
- "@master/css-schema": "^2.0.0-rc.84"
68
+ "@master/css-schema": "^2.0.0-rc.86"
69
69
  },
70
- "version": "2.0.0-rc.84",
70
+ "version": "2.0.0-rc.86",
71
71
  "scripts": {
72
72
  "build": "tsdown --config ../../shared/tsdown-package.config.ts",
73
73
  "dev": "tsdown --config ../../shared/tsdown-package.config.ts --watch",