Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added preprocess option #74

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

NikolayMakhonin
Copy link

Reason: I use custom style tag () due to the peculiarities of the development environment and style preprocessor. And I need to ignore it, but ignore-styles option is not functional enough

This is the most flexible solution to this and similar issues:

module.exports = {
	settings: {
		'svelte3/preprocess': text => {
			return text.replace(/custom-style-tag/g, 'style')
		},
	},
}
'''

settings: {
	'svelte3/preprocess': text => {
		return text.replace(/custom-style-tag/g, 'style')
	},
},
@benmccann
Copy link
Member

What's the difference between this and #62 ?

@NikolayMakhonin
Copy link
Author

What's the difference between this and #62 ?

I see that #62 replaces <style type="..."> css, scss, ... syntax </style>
But I need to replace <mystyle> my own syntax </mystyle>

I use WebStorm highlighting for my custom syntax, but it work only for custom tag names. I can't configure it for style tag with attributes.

@benmccann
Copy link
Member

Hmm. I'm not quite sure I understand the need to use mystyle. That seems very unusual and sounds like it might be a WebStorm bug that should be fixed there rather than making changes to this plugin

@NicoCevallos
Copy link

What's the difference between this and #62 ?

I see that #62 replaces <style type="..."> css, scss, ... syntax </style>
But I need to replace <mystyle> my own syntax </mystyle>

I use WebStorm highlighting for my custom syntax, but it work only for custom tag names. I can't configure it for style tag with attributes.

You can do it applying a markup preprocessor, in that function you will receive the entire .svelte file because everything is markup. Different is the case of script and style, in those functions you will receive the <style> and <script> contents only.

Hope you find it useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants