Skip to content

Commit 2de3442

Browse files
authored
chore: use eslint-plugin-svelte v2 (#487)
1 parent 19efb8a commit 2de3442

File tree

6 files changed

+25
-21
lines changed

6 files changed

+25
-21
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
cache: yarn
3131

3232
- name: Use ESLint ${{ matrix.eslint-version }}
33-
run: yarn upgrade eslint@${{ matrix.eslint-version }}
33+
run: yarn upgrade eslint@${{ matrix.eslint-version }} --ignore-engines
3434

3535
- name: Install
36-
run: yarn --frozen-lockfile
36+
run: yarn --frozen-lockfile --ignore-engines
3737

3838
- name: Test
3939
run: yarn mocha

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ Exactly what does `plugin:prettier/recommended` do? Well, this is what it expand
9797

9898
## `Svelte` support
9999

100-
We recommend to use [`eslint-plugin-svelte`](https://github.com/ota-meshi/eslint-plugin-svelte) instead of [`eslint-plugin-svelte3`](https://github.com/sveltejs/eslint-plugin-svelte3) because `eslint-plugin-svelte` has a correct [`eslint-svelte-parser`](https://github.com/ota-meshi/svelte-eslint-parser) instead of hacking, when use with `eslint-plugin-svelte3`, `eslint-plugin-prettier` will just ignore the text passed by `eslint-plugin-svelte3`, because the text they has been modified.
100+
We recommend to use [`eslint-plugin-svelte`](https://github.com/ota-meshi/eslint-plugin-svelte) instead of [`eslint-plugin-svelte3`](https://github.com/sveltejs/eslint-plugin-svelte3) because `eslint-plugin-svelte` has a correct [`eslint-svelte-parser`](https://github.com/ota-meshi/svelte-eslint-parser) instead of hacking.
101+
102+
When use with `eslint-plugin-svelte3`, `eslint-plugin-prettier` will just ignore the text passed by `eslint-plugin-svelte3`, because the text has been modified.
103+
104+
If you still decide to use `eslint-plugin-svelte3`, you'll need to run `prettier --write *.svelte` manually.
101105

102106
## `arrow-body-style` and `prefer-arrow-callback` issue
103107

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@
4848
"@changesets/changelog-github": "^0.4.5",
4949
"@changesets/cli": "^2.23.0",
5050
"@graphql-eslint/eslint-plugin": "^2.5.0",
51-
"@ota-meshi/eslint-plugin-svelte": "^0.34.1",
5251
"@typescript-eslint/parser": "^5.29.0",
5352
"eslint-config-prettier": "^8.5.0",
5453
"eslint-mdx": "^1.17.0",
5554
"eslint-plugin-eslint-plugin": "^4.3.0",
5655
"eslint-plugin-mdx": "^1.17.0",
5756
"eslint-plugin-self": "^1.2.1",
57+
"eslint-plugin-svelte": "^2.0.0",
5858
"eslint-plugin-utils": "^0.1.0",
5959
"graphql": "^16.5.0",
6060
"mocha": "^9.2.2",

test/prettier.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ const eslint = new ESLint({
5858
},
5959
},
6060
{
61-
files: '**/@ota-meshi/eslint-plugin-svelte/*.svelte',
62-
extends: ['plugin:@ota-meshi/svelte/recommended'],
61+
files: '**/eslint-plugin-svelte/*.svelte',
62+
extends: ['plugin:svelte/recommended'],
6363
},
6464
],
6565
},
@@ -260,7 +260,7 @@ runFixture('*.mdx', [
260260
],
261261
]);
262262

263-
runFixture('@ota-meshi/eslint-plugin-svelte/*.svelte', [
263+
runFixture('eslint-plugin-svelte/*.svelte', [
264264
[
265265
{
266266
column: 5,

yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,20 +2268,6 @@
22682268
"@nodelib/fs.scandir" "2.1.5"
22692269
fastq "^1.6.0"
22702270

2271-
"@ota-meshi/eslint-plugin-svelte@^0.34.1":
2272-
version "0.34.1"
2273-
resolved "https://registry.yarnpkg.com/@ota-meshi/eslint-plugin-svelte/-/eslint-plugin-svelte-0.34.1.tgz#f342da9f41d5d1cd29991a5e1bddc09ec8e3de30"
2274-
integrity sha512-ZJd/vzcwtP3vnSzS6K7feOF0dziuT7ede6g9IVT3i/yHg9g0gsJbooDuoxA9hPrZJbp0kEt/DoNjVRLlQFsy7Q==
2275-
dependencies:
2276-
debug "^4.3.1"
2277-
eslint-utils "^3.0.0"
2278-
known-css-properties "^0.25.0"
2279-
postcss "^8.4.5"
2280-
postcss-load-config "^3.1.4"
2281-
postcss-safe-parser "^6.0.0"
2282-
sourcemap-codec "^1.4.8"
2283-
svelte-eslint-parser "^0.16.0"
2284-
22852271
"@pkgr/utils@^2.0.2", "@pkgr/utils@^2.0.3", "@pkgr/utils@^2.1.0":
22862272
version "2.2.0"
22872273
resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.2.0.tgz#ccbf06cd010684b477dde40ec833a28f0c2136c4"
@@ -4091,6 +4077,20 @@ eslint-plugin-svelte@^1.1.2:
40914077
dependencies:
40924078
eslint-plugin-svelte3 "^3.1.2"
40934079

4080+
eslint-plugin-svelte@^2.0.0:
4081+
version "2.0.0"
4082+
resolved "https://registry.yarnpkg.com/eslint-plugin-svelte/-/eslint-plugin-svelte-2.0.0.tgz#b77a7c458b6139844acfe6a641abd268f4e98a2d"
4083+
integrity sha512-s7uyRqbRtQ+7q9anee4OmDJVXmNriPvk2iAxxFjlk5j1THq/6pVGn5SKtD7rXu989WkQ+fsymMHCZmOMpx+FpQ==
4084+
dependencies:
4085+
debug "^4.3.1"
4086+
eslint-utils "^3.0.0"
4087+
known-css-properties "^0.25.0"
4088+
postcss "^8.4.5"
4089+
postcss-load-config "^3.1.4"
4090+
postcss-safe-parser "^6.0.0"
4091+
sourcemap-codec "^1.4.8"
4092+
svelte-eslint-parser "^0.16.0"
4093+
40944094
eslint-plugin-unicorn@^40.1.0:
40954095
version "40.1.0"
40964096
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-40.1.0.tgz#48975360e39d23df726e4b33e8dd5d650e184832"

0 commit comments

Comments
 (0)