UNPKG

2.83 kBTypeScriptView Raw
1import { HTMLDataV1 } from "vscode-html-languageservice";
2import { LitDiagnosticSeverity } from "./types/lit-diagnostic.js";
3export type LitAnalyzerRuleSeverity = "on" | "off" | "warn" | "warning" | "error" | 0 | 1 | 2 | true | false;
4export type LitAnalyzerRuleId = "no-unknown-tag-name" | "no-missing-import" | "no-unclosed-tag" | "no-unknown-attribute" | "no-unknown-property" | "no-unknown-event" | "no-unknown-slot" | "no-unintended-mixed-binding" | "no-invalid-boolean-binding" | "no-expressionless-property-binding" | "no-noncallable-event-binding" | "no-boolean-in-attribute-binding" | "no-complex-attribute-binding" | "no-nullable-attribute-binding" | "no-incompatible-type-binding" | "no-invalid-directive-binding" | "no-incompatible-property-type" | "no-invalid-attribute-name" | "no-invalid-tag-name" | "no-invalid-css" | "no-property-visibility-mismatch" | "no-legacy-attribute" | "no-missing-element-type-definition";
5export type LitAnalyzerRules = Partial<Record<LitAnalyzerRuleId, LitAnalyzerRuleSeverity | [LitAnalyzerRuleSeverity]>>;
6export declare const ALL_RULE_IDS: LitAnalyzerRuleId[];
7export declare const RULE_ID_CODE_MAP: Record<LitAnalyzerRuleId, number>;
8export declare function ruleIdCode(ruleId: LitAnalyzerRuleId): number;
9export declare function ruleSeverity(rules: LitAnalyzerConfig | LitAnalyzerRules, ruleId: LitAnalyzerRuleId): LitAnalyzerRuleSeverity;
10export declare function isRuleDisabled(config: LitAnalyzerConfig, ruleId: LitAnalyzerRuleId): boolean;
11export declare function isRuleEnabled(config: LitAnalyzerConfig, ruleId: LitAnalyzerRuleId): boolean;
12export declare function litDiagnosticRuleSeverity(config: LitAnalyzerConfig, ruleId: LitAnalyzerRuleId): LitDiagnosticSeverity;
13export type LitAnalyzerLogging = "off" | "error" | "warn" | "debug" | "verbose";
14export type LitSecuritySystem = "off" | "ClosureSafeTypes";
15export interface LitAnalyzerConfig {
16 strict: boolean;
17 rules: LitAnalyzerRules;
18 securitySystem: LitSecuritySystem;
19 disable: boolean;
20 logging: LitAnalyzerLogging;
21 cwd: string;
22 format: {
23 disable: boolean;
24 };
25 dontShowSuggestions: boolean;
26 dontSuggestConfigChanges: boolean;
27 maxNodeModuleImportDepth: number;
28 maxProjectImportDepth: number;
29 htmlTemplateTags: string[];
30 cssTemplateTags: string[];
31 globalTags: string[];
32 globalAttributes: string[];
33 globalEvents: string[];
34 customHtmlData: (string | HTMLDataV1)[] | string | HTMLDataV1;
35}
36/**
37 * Parses a partial user configuration and returns a full options object with defaults.
38 * @param userOptions
39 */
40export declare function makeConfig(userOptions?: Partial<LitAnalyzerConfig>): LitAnalyzerConfig;
41export declare function makeRules(userOptions: Partial<LitAnalyzerConfig>): LitAnalyzerRules;
42//# sourceMappingURL=lit-analyzer-config.d.ts.map
\No newline at end of file