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

Incompatibilty with html-eslint #170

Open
Nukiloco opened this issue Feb 18, 2022 · 2 comments
Open

Incompatibilty with html-eslint #170

Nukiloco opened this issue Feb 18, 2022 · 2 comments

Comments

@Nukiloco
Copy link

It seems like when running this plugin, the eslint plugin phases the entire file including the script part instead of the html block causing issues.
It really seems like a good eslint phase though to use though.

https://github.com/yeonjuan/html-eslint

@dummdidumm
Copy link
Member

Could you clarify what exactly the problem is, maybe giving some steps how to reproduce the problem?

@Nukiloco
Copy link
Author

This is the configuration file:

module.exports = {
	parser: '@typescript-eslint/parser', // add the TypeScript parser
	plugins: [
		'svelte3',
		'@typescript-eslint', // add the TypeScript plugin
		'@html-eslint'
	],
	overrides: [ // this stays the same
		{
			files: ['*.svelte'],
			processor: 'svelte3/svelte3'
		},
		{
			files: ['*.html'],
			parser: '@html-eslint/parser',
			extends: ['plugin:@html-eslint/recommended'],
		},
	],
	rules: {
		'indent': [
			'error',
			'tab',
			{'SwitchCase': 1}
		],
		'linebreak-style': [
			'error',
			'windows'
		],
		'quotes': [
			'error',
			'single'
		],
		'semi': [
			'error',
			'never'
		],
		'yoda': [
			'error',
			'never'
		],
		'@html-eslint/require-closing-tags': [
			'error',
			{'selfClosing': 'never'}
		],
		'@html-eslint/indent': [
			'error',
			'tab'
		],
		'@html-eslint/quotes': [
			'error',
			'single'
		],
		'@html-eslint/no-multiple-empty-lines': [
			'error',
			{'max': 1}
		]
	},
	settings: {
		'svelte3/typescript': () => require('typescript'), // pass the TypeScript package to the Svelte plugin
	}
}

The html-eslint parser seems like it will parse all the parts of a svelte file
Usually for me it returns an error parsing on the ts script part with More than 1 blank lines not allowed.eslint(@html-eslint/no-multiple-empty-lines)

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

No branches or pull requests

2 participants