Giter VIP home page Giter VIP logo

eslint-plugin-svelte's People

Contributors

brewal avatar ccdexcom avatar github-actions[bot] avatar ota-meshi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

brewal ccdexcom

eslint-plugin-svelte's Issues

ignore style-tags

Tell us about your environment

  • **ESLint version: 8.57.0
  • **@intlify/eslint-plugin-svelte version: 0.4.0
  • **Node version: 20.11.1

Please show your full configuration:

/** @type { import("eslint").Linter.Config } */
module.exports = {
	root: true,
	extends: [
		'eslint:recommended',
		'plugin:@typescript-eslint/recommended',
		'plugin:svelte/recommended',
		'prettier',
		'plugin:@intlify/svelte/recommended',
	],
	parser: '@typescript-eslint/parser',
	plugins: ['@typescript-eslint', '@intlify/svelte', 'unused-imports'],
	rules: {
		// False positives under svelte 5 with generics
		'no-undef': 'off',
		// False positives under svelte 5 with vars named $page etc
		'svelte/valid-compile': 'off',
		'no-unused-vars': 'off',
		'@typescript-eslint/no-unused-vars': [
			'error', // or "error"
			{
				// Variables starting underscores are allowed, becuase it is frequently used
				// Variables starging with $$ are allowed, since shadcn uses it internally (generated code that we edit)
				argsIgnorePattern: '^_',
				varsIgnorePattern: '^(_|\\$\\$)',
				caughtErrorsIgnorePattern: '^_',
			},
		],
		'unused-imports/no-unused-imports': 'error',
		'unused-imports/no-unused-vars': [
			'warn',
			{
				vars: 'all',
				varsIgnorePattern: '^(_|\\$\\$)',
				args: 'after-used',
				argsIgnorePattern: '^_',
			},
		],
	},
	parserOptions: {
		sourceType: 'module',
		ecmaVersion: 2020,
		extraFileExtensions: ['.svelte'],
	},
	env: {
		browser: true,
		es2017: true,
		node: true,
	},
	overrides: [
		{
			files: ['*.svelte'],
			parser: 'svelte-eslint-parser',
			parserOptions: {
				parser: '@typescript-eslint/parser',
			},
		},
	],
}

What did you do?

1: Created a style-tag with some css in a .svelte-file
2: run eslint on the file ./node_modules/.bin/eslint src/routes/test.svelte

<h1>Text</h1>

<style>
	h1 {
		background: blue;
	}
</style>

What did you expect to happen?

I expected no errors for the style-tag

What actually happened?

I got a warning from @intlify/svelte/no-raw-text for the css.

./src/routes/test.svelte
  1:5  warning  raw text 'Text' is used                         @intlify/svelte/no-raw-text
  3:8  warning  raw text 'h1 {
		background: blue;
	}' is used  @intlify/svelte/no-raw-text

โœ– 2 problems (0 errors, 2 warnings)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.