Skip to content
This repository was archived by the owner on Oct 25, 2023. It is now read-only.

Skip script tags that don't include JS code#21

Open
szimek wants to merge 1 commit intomapbox:mainfrom
szimek:check-script-type
Open

Skip script tags that don't include JS code#21
szimek wants to merge 1 commit intomapbox:mainfrom
szimek:check-script-type

Conversation

@szimek
Copy link
Copy Markdown

@szimek szimek commented Jan 23, 2022

Hi!

I've been playing a bit with this plugin as I was trying to set up ESLint to lint JS code in Liquid templates. One of the issues I had was that I've got a bunch of script tags with JSON LD data and, as it's just JSON and not JS, ESLint reports parser errors.

This PR makes sure that only code from script tags without any type attribute or with type attribute equal to text/javascript is processed and passed to ESLint.

Instead of asserting number of reported messages it could assert that there are no messages that include 'Parsing error', but this way seems good enough.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant