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

newline breaks added by get_translation trigger no-multiple-empty-lines errors when maxBOF=1

Open maxlath opened this issue 4 years ago • 1 comments

no-multiple-empty-lines errors will be triggered when maxBOF is set to 1 (either explicitly or when falling back on max value, as it is the case by default for any config that extends eslint-config-standard)

The error can be silenced by setting maxBOF to 0 (?!?) or 2 (as I discovered while reading the config file posted by @lagden in #67)

Steps to reproduce: see https://github.com/maxlath/eslint-plugin-svelte3-no-multiple-empty-lines-bug-demo

From what I got, this seems to be due to the fact that eslint-plugin-svelte3 get_translation function adds \n before and after the transformed_code

maxlath avatar Jan 31 '21 13:01 maxlath

In my Svelte projects I'm using this config for the time being:


			"no-multiple-empty-lines": [
				"error",
				{
					"max": 1,
					"maxBOF": 2,
					"maxEOF": 1
				}
			],

But yeah I think the parser should be updated so that the correct values are passed to ESLint

fregante avatar Mar 09 '21 05:03 fregante