eslint-plugin-svelte3
You can not use both eslint-plugin-svelte3
and eslint-plugin-svelte
at same time. So before start to use this plugin, you need to remove eslint-plugin-svelte3
’s stuff from both package.json
and .eslintrc.*
.
Note: If you want to know difference between
eslint-plugin-svelte
andeslint-plugin-svelte3
, Please read the reason for deprecatingeslint-plugin-svelte3
in eslint-plugin-svelte3 README.
# FromNote: If you’re using TypeScript, maybe you get
Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser.
error at some configuration files.
In this case, please refer this GitHub comment to solve it.
eslint-plugin-svelte
v1 To v2
eslint-plugin-svelte
v1 was an alias for eslint-plugin-svelte3, but eslint-plugin-svelte
v2 is now an independent eslint-plugin.
If you want the previous behavior, replace it with eslint-plugin-svelte3.
# From@ota-meshi/eslint-plugin-svelte
@ota-meshi/eslint-plugin-svelte
has been renamed to eslint-plugin-svelte
.
Therefore, you need to replace the package name, and the presets, rules, and settings specified in the configuration.
package.json
Replace the package name.
- "@ota-meshi/eslint-plugin-svelte": "^0.X.X"
+ "eslint-plugin-svelte": "^X.X.X"
.eslintrc.*
Replace @ota-meshi/svelte
with svelte
as a string.
Examples:
Presets
"extends": [
- "plugin:@ota-meshi/svelte/recommended"
+ "plugin:svelte/recommended"
],
Rules
"rules": {
- "@ota-meshi/svelte/no-dupe-else-if-blocks": "error",
+ "svelte/no-dupe-else-if-blocks": "error",
- "@ota-meshi/svelte/button-has-type": "error",
+ "svelte/button-has-type": "error",
},
settings
"settings": {
- "@ota-meshi/svelte": { ... }
+ "svelte": { ... }
},
eslint-plugin-svelte
v2 To v3
This section explains the necessary changes when upgrading from eslint-plugin-svelte
v2 to v3.
v3 includes support for ESLint Flat Config only, changes to the recommended rule set, and other breaking changes.
v3 requires one of the following Node.js versions:
^18.20.4
^20.18.0
>=22.10.0
.eslintrc.js
and .eslintrc.json
are no longer supported.eslint.config.js
).recommended
:
svelte/infinite-reactive-loop
svelte/no-dom-manipulating
svelte/no-dupe-on-directives
svelte/no-reactive-reassign
svelte/require-event-dispatcher-types
svelte/valid-compile
has been removed from recommended
.svelte/no-dynamic-slot-name
is deprecated.svelte/no-goto-without-base
is deprecated and replaced with svelte/no-navigation-without-base
.no-not-function-handler
and valid-prop-names-in-kit-pages
now support Svelte 5.consistent-selector-style
: Enforce consistent selector styles.no-useless-children-snippet
: Prevent unnecessary {@children}
usage.prefer-const
: Prefer const
over let
.no-navigation-without-base
: Ensure proper usage of goto()
.npm install eslint-plugin-svelte@3
# 2. Check Node.js Version
node -v
v18.20.4
or later.npx eslint -v
8.57.1
or later (or 9.x
).eslint.config.js
)
.eslintrc.js
and migrate to eslint.config.js
.recommended
, check the impact of newly added rules.no-goto-without-base
with no-navigation-without-base
.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4