How to use @putout/formatter-json - 3 common examples

To help you get started, we’ve selected a few @putout/formatter-json 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 coderaiser / putout / packages / formatter-dump / lib / dump.js View on Github external
module.exports = ({name, places, index, count, filesCount, errorsCount}) => {
    const json = jsonFormatter({
        name, places, index, count, filesCount, errorsCount,
    });
    
    if (!json)
        return '';
    
    if (!json.errors.length)
        return '';
    
    const output = [];
    for (const {name, places} of json.errors) {
        const line = buildLine(places);
        
        output.push([
            underline(name),
            table(line, {
github coderaiser / putout / packages / formatter-eslint / lib / eslint.js View on Github external
module.exports = ({name, source, places, index, count, filesCount, errorsCount}) => {
    const json = jsonFormatter({
        name, source, places, index, count, filesCount, errorsCount,
    });
    
    if (!json)
        return '';
    
    if (!json.errors.length)
        return;
    
    const output = [];
    for (const {name, places} of json.errors) {
        const messages = places.map(convertPlace);
        
        output.push({
            filePath: name,
            source,
github coderaiser / putout / packages / formatter-codeframe / lib / codeframe.js View on Github external
module.exports = ({name, source, places, index, count, filesCount, errorsCount}) => {
    const json = jsonFormatter({
        name, source, places, index, count, filesCount, errorsCount,
    });
    
    if (!json)
        return '';
    
    if (!json.errors.length)
        return;
    
    const output = [];
    for (const {name, places, source} of json.errors) {
        for (const {rule, position, message} of places) {
            const {line, column} = position;
            const location = {
                start: {
                    line,

@putout/formatter-json

putout formatter output json on end

MIT
Latest version published 3 years ago

Package Health Score

64 / 100
Full package analysis

Popular @putout/formatter-json functions