diff --git a/.changeset/quick-beers-reflect.md b/.changeset/quick-beers-reflect.md new file mode 100644 index 00000000..8367d818 --- /dev/null +++ b/.changeset/quick-beers-reflect.md @@ -0,0 +1,5 @@ +--- +"svelte-eslint-parser": major +--- + +feat!: change the parser to an ESM-only package diff --git a/README.md b/README.md index f9a55fdd..494035db 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,6 @@ You can check it on [Online DEMO](https://sveltejs.github.io/svelte-eslint-parse > Please refer to the README for the version you are using.\ > For example, -**_Note that this parser has experimental support for Svelte v5, but may break with new versions of Svelte v5._** - [![NPM license](https://img.shields.io/npm/l/svelte-eslint-parser.svg)](https://www.npmjs.com/package/svelte-eslint-parser) [![NPM version](https://img.shields.io/npm/v/svelte-eslint-parser.svg)](https://www.npmjs.com/package/svelte-eslint-parser) [![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/svelte-eslint-parser&maxAge=3600)](http://www.npmtrends.com/svelte-eslint-parser) @@ -41,12 +39,6 @@ It provides many unique check rules by using the template AST. ESLint plugin for internationalization (i18n) with Svelte. It provides rules to help internationalization your application created with Svelte. -## ❗ Attention - -The [svelte-eslint-parser] can not be used with the [eslint-plugin-svelte3]. - -[svelte-eslint-parser]: https://github.com/sveltejs/svelte-eslint-parser - ## 💿 Installation ```bash @@ -74,20 +66,6 @@ export default [ ]; ``` -### ESLint Config (`.eslintrc.*`) - -```json -{ - "extends": "eslint:recommended", - "overrides": [ - { - "files": ["*.svelte"], - "parser": "svelte-eslint-parser" - } - ] -} -``` - ### CLI ```console @@ -101,18 +79,26 @@ $ eslint src --ext .svelte [`parserOptions`] has the same properties as what [espree](https://github.com/eslint/espree#usage), the default parser of ESLint, is supporting. For example: -```json -{ - "parserOptions": { - "sourceType": "module", - "ecmaVersion": 2021, - "ecmaFeatures": { - "globalReturn": false, - "impliedStrict": false, - "jsx": false - } - } -} +```js +import svelteParser from "svelte-eslint-parser"; +export default [ + // ... + { + files: ["**/*.svelte", "*.svelte"], + languageOptions: { + parser: svelteParser, + parserOptions: { + sourceType: "module", + ecmaVersion: 2021, + ecmaFeatures: { + globalReturn: false, + impliedStrict: false, + jsx: false, + }, + }, + }, + }, +]; ``` [`parserOptions`]: https://eslint.org/docs/latest/use/configure/parser#configure-parser-options @@ -139,17 +125,6 @@ export default [ ]; ``` -For example in `.eslintrc.*`: - -```json -{ - "parser": "svelte-eslint-parser", - "parserOptions": { - "parser": "@typescript-eslint/parser" - } -} -``` - If you are using the `"@typescript-eslint/parser"`, and if you want to use TypeScript in `