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

feat: svelte support #364

Merged
merged 2 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,25 @@ Running `npx eslint` should prompt you to install the required dependencies, oth
npm i -D eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh
```

#### Svelte

To enable svelte support, you need to explicitly turn it on:

```js
// eslint.config.js
import antfu from '@antfu/eslint-config'

export default antfu({
svelte: true,
})
```

Running `npx eslint` should prompt you to install the required dependencies, otherwise, you can install them manually:

```bash
npm i -D eslint-plugin-svelte
```

#### UnoCSS

To enable UnoCSS support, you need to explicitly turn it on:
Expand Down
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"eslint-plugin-format": ">=0.1.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4"
"eslint-plugin-react-refresh": "^0.4.4",
"eslint-plugin-svelte": "^2.34.1",
"svelte-eslint-parser": "^0.33.1"
},
"peerDependenciesMeta": {
"@unocss/eslint-plugin": {
Expand All @@ -59,6 +61,12 @@
},
"eslint-plugin-react-refresh": {
"optional": true
},
"eslint-plugin-svelte": {
"optional": true
},
"svelte-eslint-parser": {
"optional": true
}
},
"dependencies": {
Expand Down Expand Up @@ -117,6 +125,7 @@
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"eslint-plugin-svelte": "^2.34.1",
"eslint-ts-patch": "^8.55.0-1",
"esno": "^4.0.0",
"execa": "^8.0.1",
Expand All @@ -125,6 +134,7 @@
"lint-staged": "^15.2.0",
"rimraf": "^5.0.5",
"simple-git-hooks": "^2.9.0",
"svelte-eslint-parser": "^0.33.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"vitest": "^1.0.4",
Expand Down
111 changes: 101 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/configs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export * from './formatters'
export * from './react'
export * from './sort'
export * from './stylistic'
export * from './svelte'
export * from './test'
export * from './typescript'
export * from './unicorn'
Expand Down
Loading