How to use hint - 10 common examples

To help you get started, we’ve selected a few hint 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 / utils-tests-helpers / src / hint-runner.ts View on Github external
const runHint = async (t: ExecutionContext, hintTest: HintLocalTest) => {

        try {
            if (hintTest.before) {
                await hintTest.before(t);
            }

            const hintConfig = createConfig(hintId, connector, configs);
            const resources = resourceLoader.loadResources(hintConfig);
            const engine = new Engine(hintConfig, resources);

            // Can assume `getAsUri(hintTest.path)` is not `null` since these are controlled test inputs.
            const target = getAsUri(hintTest.path)!;
            const results = await engine.executeOn(target);

            await engine.close();

            if (hintTest.after) {
                await hintTest.after(t);
            }

            const sources = new Map();

            for (const result of results) {
                if (!sources.has(result.resource)) {
                    sources.set(result.resource, await requestSource(result.resource, connector));
github webhintio / hint / packages / hint-manifest-is-valid / src / meta.ts View on Github external
category: Category.pwa,

        description: getMessage('description', 'en'),
        name: getMessage('name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('name', language);
    },
    id: 'manifest-is-valid',
    schema: [],
    scope: HintScope.any
};

export default meta;
github webhintio / hint / packages / hint-manifest-app-name / src / meta.ts View on Github external
docs: {
        category: Category.pwa,
        description: getMessage('description', 'en'),
        name: getMessage('name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('name', language);
    },
    id: 'manifest-app-name',
    schema: [],
    scope: HintScope.any
};

export default meta;
github webhintio / hint / packages / hint-manifest-file-extension / src / meta.ts View on Github external
docs: {
        category: Category.pwa,
        description: getMessage('description', 'en'),
        name: getMessage('name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('name', language);
    },
    id: 'manifest-file-extension',
    schema: [],
    scope: HintScope.any
};

export default meta;
github webhintio / hint / packages / hint-webpack-config / src / meta / config-exists.ts View on Github external
docs: {
        category: Category.development,
        description: getMessage('configExists_description', 'en'),
        name: getMessage('configExists_name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('configExists_description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('configExists_name', language);
    },
    id: 'webpack-config/config-exists',
    schema: [],
    scope: HintScope.local
};

export default meta;
github webhintio / hint / packages / hint-babel-config / src / meta / is-valid.ts View on Github external
docs: {
        category: Category.development,
        description: getMessage('isValid_description', 'en'),
        name: getMessage('isValid_name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('isValid_description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('isValid_name', language);
    },
    id: 'babel-config/is-valid',
    schema: [],
    scope: HintScope.local
};

export default meta;
github webhintio / hint / packages / hint-webpack-config / src / meta / is-installed.ts View on Github external
docs: {
        category: Category.development,
        description: getMessage('isInstalled_description', 'en'),
        name: getMessage('isInstalled_name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('isInstalled_description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('isInstalled_name', language);
    },
    id: 'webpack-config/is-installed',
    schema: [],
    scope: HintScope.local
};

export default meta;
github webhintio / hint / packages / hint-typescript-config / src / meta / no-comments.ts View on Github external
docs: {
        category: Category.development,
        description: getMessage('noComments_description', 'en'),
        name: getMessage('noComments_name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('noComments_description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('noComments_name', language);
    },
    id: 'typescript-config/no-comments',
    schema: [],
    scope: HintScope.local
};

export default meta;
github webhintio / hint / packages / hint-typescript-config / src / meta / is-valid.ts View on Github external
docs: {
        category: Category.development,
        description: getMessage('isValid_description', 'en'),
        name: getMessage('isValid_name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('isValid_description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('isValid_name', language);
    },
    id: 'typescript-config/is-valid',
    schema: [],
    scope: HintScope.local
};

export default meta;
github webhintio / hint / packages / hint-typescript-config / src / meta / strict.ts View on Github external
docs: {
        category: Category.development,
        description: getMessage('strict_description', 'en'),
        name: getMessage('strict_name', 'en')
    },
    /* istanbul ignore next */
    getDescription(language: string) {
        return getMessage('strict_description', language);
    },
    /* istanbul ignore next */
    getName(language: string) {
        return getMessage('strict_name', language);
    },
    id: 'typescript-config/strict',
    schema: [],
    scope: HintScope.local
};

export default meta;