How to use eslint-plugin-prettier - 2 common examples

To help you get started, we’ve selected a few eslint-plugin-prettier 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 DefinitelyTyped / DefinitelyTyped / types / eslint-plugin-prettier / eslint-plugin-prettier-tests.ts View on Github external
import * as utils from 'eslint-plugin-prettier';

declare function log(...args: Array): void;

utils.showInvisibles(' some string ');

utils.generateDifferences('abc', 'def').forEach(difference => {
    const {
        operation,
        offset,
        deleteText = '',
        insertText = '',
    } = difference;

    switch (operation) {
        case 'delete':
            log('delete', offset, deleteText);
            break;
        case 'insert':
            log('insert', offset, insertText);
            break;
        case 'replace':
            log('replace', offset, insertText, deleteText);
github DefinitelyTyped / DefinitelyTyped / types / eslint-plugin-prettier / eslint-plugin-prettier-tests.ts View on Github external
import * as utils from 'eslint-plugin-prettier';

declare function log(...args: Array): void;

utils.showInvisibles(' some string ');

utils.generateDifferences('abc', 'def').forEach(difference => {
    const {
        operation,
        offset,
        deleteText = '',
        insertText = '',
    } = difference;

    switch (operation) {
        case 'delete':
            log('delete', offset, deleteText);
            break;
        case 'insert':
            log('insert', offset, insertText);
            break;

eslint-plugin-prettier

Runs prettier as an eslint rule

MIT
Latest version published 5 months ago

Package Health Score

95 / 100
Full package analysis