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

indent rule not working on .svelte files? #188

Open
aradalvand opened this issue Sep 17, 2022 · 0 comments
Open

indent rule not working on .svelte files? #188

aradalvand opened this issue Sep 17, 2022 · 0 comments

Comments

@aradalvand
Copy link

aradalvand commented Sep 17, 2022

The following .eslintrc.cjs (created by npm create svelte@latest, I just added a rules section):

module.exports = {
	root: true,
	parser: '@typescript-eslint/parser',
	extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
	plugins: ['svelte3', '@typescript-eslint'],
	ignorePatterns: ['*.cjs'],
	overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
	settings: {
		'svelte3/typescript': () => require('typescript')
	},
	parserOptions: {
		sourceType: 'module',
		ecmaVersion: 2020
	},
	env: {
		browser: true,
		es2017: true,
		node: true
	},
	rules: {
		quotes: ["error", "single"],
		indent: ["error", "tab"]
	},
};

When I run npx eslint --fix MyComponent.svelte, the indent rule isn't applied, if the file is using spaces as indentation I expect ESLint to convert those into tabs, it does that for .ts/.js files but not for .svelte files.
Other rules like the quotes rule ARE applied in .svelte files as well; so this problem must be specific to indent probably.

Any ideas?

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

1 participant