Re: [code] [textadept] Changing The Syntax Checker Command

From: Jason Schindler <jschind.att.gmail.com>
Date: Tue, 8 Mar 2016 11:16:41 -0600

Thanks Mitchell.

Just in case folks find this thread trying to do the same thing, adding the
--format=compact flag to the eslint command puts the output in a format
that matches the error patterns that jshint outputs, so:

textadept.run.syntax_commands.javascript = 'eslint "%f" --format=compact'

is sufficient if all you want to do is switch your linter to eslint. I'll
have to work on the second half of this in my "free time" ... whatever that
is ;-)

Thanks again!

-Jason

On Mon, Mar 7, 2016 at 5:42 PM, Mitchell <m.att.foicica.com> wrote:

> Hi Jason,
>
> On Mon, 7 Mar 2016, Jason Schindler wrote:
>
> I really have 2 questions.
>>
>> 1 - Primarily, my JavaScript projects have been slowly moving to ESLint
>> from JSHint. When everything was JSHint, the built-in syntax checker was
>> nice to have. Now, it can get in the way. What I would like to do is
>> change it to eslint. I tried the following:
>>
>> textadept.run.syntax_commands.javascript = 'eslint "%f"'
>>
>
> That should work fine.
>
> What I can't determine is how to tell TA to interpret the output. It is
>> formatted differently than the jshint output and I imagine that is why no
>> errors are being reported.
>>
>
> textadept.run.syntax_error_patterns.javascript
>
> The documentation[1] may be helpful when creating a pattern for capturing
> output.
>
> 2 - What would be ultimately be ideal (at least for my JavaScript projects)
>> would be configuring a function that returns a command for syntax checking
>> so that it could potentially be different for each buffer. It could check
>> the project root/package.json for JSHint / JSLint / ESLint settings and
>> return the appropriate command based on what is found. Is there a way to
>> do that currently?
>>
>
> Yeah, simply assign a function to
> `textadept.run.syntax_commands.javascript`. Your function can check for a
> config file and craft and return the command line string that will
> ultimately be passed to the system for execution.
>
> Cheers,
> Mitchell
>
> [1]:
> http://foicica.com/textadept/api.html#textadept.run.syntax_error_patterns
> --
> You are subscribed to code.att.foicica.com.
> To change subscription settings, send an e-mail to code+help.att.foicica.com.
> To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
>
>

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 08 Mar 2016 - 12:16:41 EST

This archive was generated by hypermail 2.2.0 : Wed 09 Mar 2016 - 06:42:49 EST