Skip to content

Commit

Permalink
feat: svelte support (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
thenbe committed Dec 25, 2023
1 parent 5ea1e2e commit ec6313c
Show file tree
Hide file tree
Showing 8 changed files with 261 additions and 11 deletions.
19 changes: 19 additions & 0 deletions README.md
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
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
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

0 comments on commit ec6313c

Please sign in to comment.