package Code::TidyAll::Plugin::JSON;
use strict;
use warnings;
use JSON::MaybeXS ();
use Specio::Library::Builtins;
use Moo;
our $VERSION = '0.85';
extends 'Code::TidyAll::Plugin';
has ascii =>
my $json = JSON::MaybeXS->new(
canonical => 1,
pretty => 1,
relaxed => 1,
utf8 => 1,
);
$json = $json->ascii if $self->ascii;
return $json->enc
$json->decode($source) );
}
1;
# ABSTRACT: Use the JSON::MaybeXS module to tidy JSON documents with tidyall
__END__
=pod
=encoding UTF-8
=head1 NAME
Code::TidyAll::Plugin::JSON - Use the JSON:
ersion 0.85
=head1 SYNOPSIS
# In your tidyall config
[GenericTransformer / JSONOrderedTidy]
cmd = json-ordered-tidy
argv = -stdout
ok_exit_codes = 0 1
=head1 DESCRIPTION
This p
hift;
return unless $self->_has_options;
my $conf_file = $self->_tempdir->child('jshint.json');
$conf_file->spew(
'{ ' . join( ",\n", map {qq["$_": true]} split /\s+/, $self->opt
ef
; or refer to a jshint.json config file in the same directory
;
[JSHint]
select = static/**/*.js
argv = --config $ROOT/jshint.json
where jshint.json looks like
{
"bitw
version 0.85
=head1 SYNOPSIS
# In your tidyall config
[GenericValidator / JSONOrderedTidy]
cmd = json-ordered-tidy
argv = -check
ok_exit_codes = 0 1
=head1 DESCRIPTION
This pl