Skip to content

Commit

Permalink
chore: use eslint-plugin-svelte v2 (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin authored Jun 30, 2022
1 parent 19efb8a commit 2de3442
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
cache: yarn

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

- name: Install
run: yarn --frozen-lockfile
run: yarn --frozen-lockfile --ignore-engines

- name: Test
run: yarn mocha
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ Exactly what does `plugin:prettier/recommended` do? Well, this is what it expand

## `Svelte` support

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.
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 has been modified.

If you still decide to use `eslint-plugin-svelte3`, you'll need to run `prettier --write *.svelte` manually.

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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
"@changesets/changelog-github": "^0.4.5",
"@changesets/cli": "^2.23.0",
"@graphql-eslint/eslint-plugin": "^2.5.0",
"@ota-meshi/eslint-plugin-svelte": "^0.34.1",
"@typescript-eslint/parser": "^5.29.0",
"eslint-config-prettier": "^8.5.0",
"eslint-mdx": "^1.17.0",
"eslint-plugin-eslint-plugin": "^4.3.0",
"eslint-plugin-mdx": "^1.17.0",
"eslint-plugin-self": "^1.2.1",
"eslint-plugin-svelte": "^2.0.0",
"eslint-plugin-utils": "^0.1.0",
"graphql": "^16.5.0",
"mocha": "^9.2.2",
Expand Down
6 changes: 3 additions & 3 deletions test/prettier.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ const eslint = new ESLint({
},
},
{
files: '**/@ota-meshi/eslint-plugin-svelte/*.svelte',
extends: ['plugin:@ota-meshi/svelte/recommended'],
files: '**/eslint-plugin-svelte/*.svelte',
extends: ['plugin:svelte/recommended'],
},
],
},
Expand Down Expand Up @@ -260,7 +260,7 @@ runFixture('*.mdx', [
],
]);

runFixture('@ota-meshi/eslint-plugin-svelte/*.svelte', [
runFixture('eslint-plugin-svelte/*.svelte', [
[
{
column: 5,
Expand Down
28 changes: 14 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2268,20 +2268,6 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"

"@ota-meshi/eslint-plugin-svelte@^0.34.1":
version "0.34.1"
resolved "https://registry.yarnpkg.com/@ota-meshi/eslint-plugin-svelte/-/eslint-plugin-svelte-0.34.1.tgz#f342da9f41d5d1cd29991a5e1bddc09ec8e3de30"
integrity sha512-ZJd/vzcwtP3vnSzS6K7feOF0dziuT7ede6g9IVT3i/yHg9g0gsJbooDuoxA9hPrZJbp0kEt/DoNjVRLlQFsy7Q==
dependencies:
debug "^4.3.1"
eslint-utils "^3.0.0"
known-css-properties "^0.25.0"
postcss "^8.4.5"
postcss-load-config "^3.1.4"
postcss-safe-parser "^6.0.0"
sourcemap-codec "^1.4.8"
svelte-eslint-parser "^0.16.0"

"@pkgr/utils@^2.0.2", "@pkgr/utils@^2.0.3", "@pkgr/utils@^2.1.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.2.0.tgz#ccbf06cd010684b477dde40ec833a28f0c2136c4"
Expand Down Expand Up @@ -4091,6 +4077,20 @@ eslint-plugin-svelte@^1.1.2:
dependencies:
eslint-plugin-svelte3 "^3.1.2"

eslint-plugin-svelte@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-svelte/-/eslint-plugin-svelte-2.0.0.tgz#b77a7c458b6139844acfe6a641abd268f4e98a2d"
integrity sha512-s7uyRqbRtQ+7q9anee4OmDJVXmNriPvk2iAxxFjlk5j1THq/6pVGn5SKtD7rXu989WkQ+fsymMHCZmOMpx+FpQ==
dependencies:
debug "^4.3.1"
eslint-utils "^3.0.0"
known-css-properties "^0.25.0"
postcss "^8.4.5"
postcss-load-config "^3.1.4"
postcss-safe-parser "^6.0.0"
sourcemap-codec "^1.4.8"
svelte-eslint-parser "^0.16.0"

eslint-plugin-unicorn@^40.1.0:
version "40.1.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-unicorn/-/eslint-plugin-unicorn-40.1.0.tgz#48975360e39d23df726e4b33e8dd5d650e184832"
Expand Down

0 comments on commit 2de3442

Please sign in to comment.