How to use the @hint/utils-types.Category.other function in @hint/utils-types

To help you get started, we’ve selected a few @hint/utils-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webhintio / hint / packages / hint / src / lib / hint-context.ts View on Github external
/**
         * By default all hints get configured with `default` so they can
         * decide the severity of each report unless it's overriden by the
         * user.
         */
        const finalSeverity = this.severity !== Severity.default ?
            this.severity :
            severity;

        /*
         * If location is undefined or equal to null, `position` will be set as `{ column: -1, line: -1 }` later in `hint.report`.
         * So pass the `location` on as it is.
         */

        this.engine.report({
            category: (this.meta && this.meta.docs && this.meta.docs.category) ? this.meta.docs.category : Category.other,
            codeLanguage: options.codeLanguage,
            hintId: this.id,
            location: position || { column: -1, line: -1 },
            message,
            resource,
            severity: finalSeverity,
            sourceCode: codeSnippet || sourceCode || ''
        });
    }
github webhintio / hint / packages / extension-browser / src / content-script / formatter.ts View on Github external
private getHintCategory(hint: IHintConstructor): string {
        return hint.meta.docs && hint.meta.docs.category || Category.other;
    }
github webhintio / hint / packages / create-hint / src / create-hint.ts View on Github external
public constructor(hintData: inquirer.Answers, parentName?: string) {
        this.name = hintData.name;
        this.normalizedName = normalizeStringByDelimiter(hintData.name, '-');
        this.className = `${parentName ? toPascalCase(parentName) : ''}${toPascalCase(this.normalizedName)}Hint`;
        this.category = hintData.category || Category.other;
        this.description = escapeSafeString(hintData.description);
        this.elementType = hintData.elementType;
        this.events = getEventsByUseCase(hintData.useCase);
        this.useCase[hintData.useCase] = true;
        this.scope = hintData.scope;
        this.parentName = parentName || '';
    }
}
github webhintio / hint / packages / extension-browser / src / devtools / utils / categories.ts View on Github external
return [...new Set(metas.map((meta) => {
        return (meta.docs && meta.docs.category || Category.other);
    }))].sort();
};
github webhintio / hint / packages / formatter-html / src / formatter.ts View on Github external
const categoriesArray: string[] = resources.hints.map((hint) => {
        if (hint.meta.docs && hint.meta.docs.category) {
            return hint.meta.docs.category;
        }

        return Category.other;
    });