Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
baseballyama committed Jan 26, 2025
1 parent ff739aa commit e5a68ba
Show file tree
Hide file tree
Showing 8 changed files with 333 additions and 413 deletions.
377 changes: 167 additions & 210 deletions README.md

Large diffs are not rendered by default.

66 changes: 24 additions & 42 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,45 @@
title: 'eslint-plugin-svelte'
---

# Introduction
## Introduction

`eslint-plugin-svelte` is the official [ESLint] plugin for [Svelte].
It provides many unique check rules by using the template AST.
You can check on the [Online DEMO](https://eslint-online-playground.netlify.app/#eslint-plugin-svelte%20with%20typescript).
`eslint-plugin-svelte` is the official [ESLint](https://eslint.org/) plugin for [Svelte](https://svelte.dev/).
It leverages the AST generated by [svelte-eslint-parser](https://github.com/sveltejs/svelte-eslint-parser) to provide custom linting for Svelte.
Note that `eslint-plugin-svelte` and `svelte-eslint-parser` cannot be used alongside [eslint-plugin-svelte3](https://github.com/sveltejs/eslint-plugin-svelte3).

> [!NOTE]
> This document is in development.\
> Please refer to the document for the version you are using.\
> For example, <https://github.com/sveltejs/eslint-plugin-svelte/blob/eslint-plugin-svelte%402.46.0/README.md>
> and <https://github.com/sveltejs/eslint-plugin-svelte/blob/eslint-plugin-svelte%402.46.0/docs>
[![NPM license](https://img.shields.io/npm/l/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
[![NPM version](https://img.shields.io/npm/v/eslint-plugin-svelte.svg)](https://www.npmjs.com/package/eslint-plugin-svelte)
[![NPM downloads](https://img.shields.io/badge/dynamic/json.svg?label=downloads&colorB=green&suffix=/day&query=$.downloads&uri=https://api.npmjs.org//downloads/point/last-day/eslint-plugin-svelte&maxAge=3600)](http://www.npmtrends.com/eslint-plugin-svelte)
[![NPM downloads](https://img.shields.io/npm/dw/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
[![NPM downloads](https://img.shields.io/npm/dy/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
[![NPM downloads](https://img.shields.io/npm/dt/eslint-plugin-svelte.svg)](http://www.npmtrends.com/eslint-plugin-svelte)
[![Build Status](https://github.com/sveltejs/eslint-plugin-svelte/workflows/CI/badge.svg?branch=main)](https://github.com/sveltejs/eslint-plugin-svelte/actions?query=workflow%3ACI)

[![type-coverage](https://img.shields.io/badge/dynamic/json.svg?label=type-coverage&prefix=%E2%89%A5&suffix=%&query=$.typeCoverage.atLeast&uri=https%3A%2F%2Fraw.githubusercontent.com%2Fsveltejs%2Feslint-plugin-svelte%2Fmain%2Fpackage.json)](https://github.com/plantain-00/type-coverage)
[![Conventional Commits](https://img.shields.io/badge/conventional%20commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-176de3.svg)](https://github.com/atlassian/changesets)

## :name_badge: What is this plugin?
## Installation

[ESLint] plugin for [Svelte].
It provides many unique check rules using the AST generated by [svelte-eslint-parser].
```bash
npm install --save-dev svelte eslint eslint-plugin-svelte globals
```

### ❗ Attention
> [!NOTE]
>
> **Requirements:**
>
> - ESLint v8.57.1, v9.0.0, and above
> - Node.js v18.20.4, v20.18.0, v22.10.0, and above
#### Cannot be used with eslint-plugin-svelte3
## Configuration

The [svelte-eslint-parser] and the `eslint-plugin-svelte` can not be used with the [eslint-plugin-svelte3].
See [User Guide](./user-guide.md).

[svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser
[eslint-plugin-svelte3]: https://github.com/sveltejs/eslint-plugin-svelte3
## Migration Guide

#### Experimental support for Svelte v5
If you’re migrating from `eslint-plugin-svelte` v1 or [`@ota-meshi/eslint-plugin-svelte`](https://www.npmjs.com/package/@ota-meshi/eslint-plugin-svelte), see the [migration guide](./migration.md).

We are working on support for Svelte v5, but it is still an experimental feature. Please note that rules and features related to Svelte v5 may be changed or removed in minor versions without notice.
## Versioning Policy

## :book: Usage
This project follows [Semantic Versioning](https://semver.org/). Unlike [ESLint’s versioning policy](https://github.com/eslint/eslint#semantic-versioning-policy), new rules may be added in minor releases. If these new rules cause unwanted warnings, you can disable them.

See [User Guide](./user-guide.md).
<!--DOCS_IGNORE_END-->

## :white_check_mark: Rules
# Rules

<!-- prettier-ignore-start -->
See [Available Rules](./rules.md).
<!-- prettier-ignore-end -->

## :lock: License

See the [LICENSE](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/LICENSE) file for license rights and limitations (MIT).
## License

[svelte]: https://svelte.dev/
[eslint]: https://eslint.org/
See [LICENSE](https://github.com/sveltejs/eslint-plugin-svelte/blob/main/LICENSE) (MIT).
2 changes: 1 addition & 1 deletion docs/rules/no-export-load-in-svelte-module-in-kit-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ And the API has changed.

## :wrench: Options

Nothing. But if you are not using the default routes folder, please set configuration according to the [user guide](../user-guide.md#settings-svelte-kit).
Nothing. But if you are not using the default routes folder, please set configuration according to the [user guide](../user-guide.md).

## :books: Further Reading

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/valid-compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default [
];
```

See also [User Guide > Specify `svelte.config.js`](../user-guide.md#specify-svelte-config-js)
See also [User Guide > Configuration](../user-guide.md#configuration)

#### warningFilter

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/valid-prop-names-in-kit-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ At SvelteKit v1.0.0-next.405, instead of having multiple props corresponding to

## :wrench: Options

Nothing. But if use are using not default routes folder, please set configuration according to the [user guide](../user-guide.md#settings-svelte-kit).
Nothing. But if use are using not default routes folder, please set configuration according to the [user guide](../user-guide.md).

## :books: Further Reading

Expand Down
Loading

0 comments on commit e5a68ba

Please sign in to comment.