I have a bundle for linting JavaScript and I'm having trouble figuring out how to handle JavaScript embedded in HTML. Currently, I'm expecting that the `source.js` refers to a full file. This creates an issue since `source.js` is also part of the scope when JavaScript is embedded in HTML, causing my bundle to lint a full HTML document. Is there a way to configure the bundle to ignore embedded JavaScript, or to dynamically switch to linting only the embedded JavaScript?
This the bundle: https://github.com/ryanfitzer/eslint.tmbundle
On Tue, Mar 5, 2019 at 3:08 PM Ryan Fitzer ryan@ryanfitzer.com wrote:
I have a bundle for linting JavaScript and I'm having trouble figuring out how to handle JavaScript embedded in HTML. Currently, I'm expecting that the `source.js` refers to a full file. This creates an issue since `source.js` is also part of the scope when JavaScript is embedded in HTML, causing my bundle to lint a full HTML document. Is there a way to configure the bundle to ignore embedded JavaScript, or to dynamically switch to linting only the embedded JavaScript?
To ignore embedded JavaScript in HTML try changing the scope selector to 'source.js - text.html’. This shouldn't match the scope source.js when its parent scope is 'text.html'. Have you look into eslint-plugin-html (https://github.com/BenoitZugmeyer/eslint-plugin-html) to handle linting embedded JavaScript?
-Ron
This the bundle: https://github.com/ryanfitzer/eslint.tmbundle
textmate mailing list textmate@lists.macromates.com https://lists.macromates.com/listinfo/textmate