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

From: Mitchell <m.att.foicica.com>
Date: Mon, 7 Mar 2016 18:42:35 -0500 (EST)

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.
Received on Mon 07 Mar 2016 - 18:42:35 EST

This archive was generated by hypermail 2.2.0 : Tue 08 Mar 2016 - 06:50:54 EST