Closed OrahKokos closed 7 months ago
8.55.0
eslint-plugin-svelte
2.35.1(eslint@8.55.0)(svelte@4.0.5)
<script lang="ts"> console.log(`^ Parsing error: '>' expected.eslint`) </script>
<p>Parsing error: ';' expected.eslint</p>
I've expected for the lint process to work on .svelte files.
.svelte
<script lang="ts">
Configurations have been provided. This is a simple vite svelte project, generated by vite (No sveltekit)
I've followed the project setup specification provided by the readme, however i did not have luck setting up eslint to work with .svelte files.
I don't know since you haven't provided a repo to reproduce it, but I think you're putting the overrides in the wrong place. If the issue persists, please provide a repo to reproduce.
overrides
Before You File a Bug Report Please Confirm You Have Done The Following...
What version of ESLint are you using?
8.55.0
What version of
eslint-plugin-svelte
are you using?2.35.1(eslint@8.55.0)(svelte@4.0.5)
What did you do?
Configuration
## Eslint ```json { "root": true, "parser": "@typescript-eslint/parser", "parserOptions": { "extraFileExtensions": [ ".svelte" ], "project": "./tsconfig.json" }, "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier", "plugin:import/errors", "plugin:import/warnings", "plugin:import/typescript", "plugin:svelte/base", "plugin:svelte/recommended" ], "plugins": [ "@typescript-eslint", "prettier", "import" ], "rules": { "prettier/prettier": "error", "import/order": [ "error", { "alphabetize": { "order": "asc" }, "groups": [ "builtin", "external", "internal", [ "parent", "sibling" ], "index" ], "newlines-between": "always" } ], "import/no-unresolved": "off", "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/explicit-function-return-type": [ "error", { "allowExpressions": true } ], "@typescript-eslint/explicit-module-boundary-types": "error", "@typescript-eslint/no-non-null-assertion": "error", "@typescript-eslint/no-unused-vars": [ "error", { "argsIgnorePattern": "^_" } ], "@typescript-eslint/no-empty-function": "error" }, "settings": { "overrides": [ { "files": [ "src/**/*.svelte" ], "parser": "svelte-eslint-parser", "parserOptions": { "parser": "@typescript-eslint/parser" } } ], "env": { "browser": true, "es2020": true, "node": true } } } ``` ## Prettier ```json { "useTabs": false, "singleQuote": true, "trailingComma": "none", "printWidth": 100, "arrowParens": "always", "semi": false } ``` ## Typescript ```json { "extends": "@tsconfig/svelte/tsconfig.json", "compilerOptions": { "target": "ESNext", "useDefineForClassFields": true, "module": "ESNext", "resolveJsonModule": true, "allowJs": true, "checkJs": true, "isolatedModules": true, "strict": true }, "include": ["src/**/*.d.ts", "src/**/*.ts", "src/**/*.js", "src/**/*.svelte"], "references": [{ "path": "./tsconfig.node.json" }] } ```Example1.svelte
Example2.svelte
What did you expect to happen?
I've expected for the lint process to work on
.svelte
files.What actually happened?
Error 1: Parsing error: ';' expected
.svelte
files which have no script or style tagsError 2: Parsing error: '>' expected
.svelte
files which have<script lang="ts">
Link to GitHub Repo with Minimal Reproducible Example
Configurations have been provided. This is a simple vite svelte project, generated by vite (No sveltekit)
Additional comments
I've followed the project setup specification provided by the readme, however i did not have luck setting up eslint to work with
.svelte
files.