eslint-plugin-svelte3 icon indicating copy to clipboard operation
eslint-plugin-svelte3 copied to clipboard

Incompatibilty with html-eslint

Open Nukiloco opened this issue 3 years ago • 2 comments

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

Nukiloco avatar Feb 18 '22 16:02 Nukiloco

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

dummdidumm avatar Feb 18 '22 17:02 dummdidumm

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)

Nukiloco avatar Apr 14 '22 14:04 Nukiloco