@master/eslint-plugin-css 2.0.0-rc.85 → 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/dist/configs/base.d.ts +0 -1
- package/dist/configs/legacy.d.ts +0 -1
- package/dist/configs/recommended.d.ts +0 -1
- package/dist/configs/stylesheet.d.ts +0 -1
- package/dist/create-rule.d.ts +1 -6
- package/dist/index.d.ts +0 -1
- package/dist/plugin.d.ts +0 -1
- package/dist/rules/no-conflicting-classes.js +1 -1
- package/dist/rules/no-invalid-classes.d.ts +1 -1
- package/dist/rules/no-unapproved-raw-values.js +1 -1
- package/dist/rules/prefer-canonical-classes.d.ts +0 -1
- package/dist/rules/prefer-canonical-classes.js +1 -1
- package/dist/rules/sort-classes.js +1 -1
- package/dist/settings-schema.d.ts +0 -1
- package/dist/settings.d.ts +1 -2
- package/dist/stylesheet-parser.d.ts +4 -4
- package/dist/utils/define-source-visitors.d.ts +1 -7
- package/dist/utils/define-source-visitors.js +2 -2
- package/dist/utils/define-visitors.d.ts +1 -5
- package/dist/utils/master-css.d.ts +0 -1
- package/dist/utils/report-lint-diagnostics.d.ts +4 -2
- package/dist/utils/report-lint-diagnostics.js +8 -2
- package/dist/utils/resolve-class-node.d.ts +0 -1
- package/dist/utils/resolve-compose-directive-class-nodes.d.ts +0 -1
- package/dist/utils/resolve-context.d.ts +1 -2
- package/dist/utils/with-visit-class-node.d.ts +0 -1
- package/package.json +8 -8
package/dist/configs/base.d.ts
CHANGED
package/dist/configs/legacy.d.ts
CHANGED
package/dist/create-rule.d.ts
CHANGED
|
@@ -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
package/dist/plugin.d.ts
CHANGED
|
@@ -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: "
|
|
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<"
|
|
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: "
|
|
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: "
|
|
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: "
|
|
14
|
+
messages: { invalidClassOrder: "{{message}}" },
|
|
15
15
|
schema: []
|
|
16
16
|
},
|
|
17
17
|
defaultOptions: [],
|
package/dist/settings.d.ts
CHANGED
|
@@ -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:
|
|
10
|
-
comments:
|
|
11
|
-
tokens:
|
|
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:
|
|
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,
|
|
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:
|
|
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;
|
|
@@ -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:
|
|
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,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.
|
|
51
|
-
"@master/css-
|
|
52
|
-
"@master/css-
|
|
53
|
-
"@master/css-
|
|
54
|
-
"@master/css-
|
|
55
|
-
"@master/css-validator": "^2.0.0-rc.
|
|
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.
|
|
68
|
+
"@master/css-schema": "^2.0.0-rc.86"
|
|
69
69
|
},
|
|
70
|
-
"version": "2.0.0-rc.
|
|
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",
|