### Start Svelte Development Server Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/explorer-v2/README.md Starts the Svelte development server after installing project dependencies. The `-- --open` flag can be used to automatically open the application in a new browser tab. ```bash npm run dev # or start the server and open the app in a new browser tab npm run dev -- --open ``` -------------------------------- ### Build Svelte Project for Production Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/explorer-v2/README.md Builds a production-ready version of the Svelte application. It's recommended to install an adapter for your target environment before building. The built app can be previewed using `npm run preview`. ```bash npm run build ``` -------------------------------- ### Install svelte-eslint-parser Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/README.md Installs the svelte-eslint-parser along with ESLint as a development dependency using npm. ```bash npm install --save-dev eslint svelte-eslint-parser ``` -------------------------------- ### Create a New Svelte Project Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/explorer-v2/README.md Initializes a new Svelte project in the current directory or a specified directory using npm. The `@next` tag is currently used for the latest version. ```bash npm init svelte@next # create a new project in my-app npm init svelte@next my-app ``` -------------------------------- ### Configure Svelte Features Parsing (e.g., Runes) Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/README.md This example demonstrates how to configure Svelte-specific features, such as the 'runes' feature for Svelte 5, via `parserOptions.svelteFeatures`. The default for runes is true, and the parser can also attempt to read this from your svelte.config.js. ```javascript export default [ { files: [ // Set .svelte/.js/.ts files. See above for more details. ], languageOptions: { parser: svelteParser, parserOptions: { svelteFeatures: { // This is for Svelte 5. The default is true. // If false, ESLint won't recognize rune symbols. // If not specified, the parser tries to read compilerOptions.runes from `svelte.config.js`. // If `parserOptions.svelteConfig` is not given and static analysis fails, it defaults to true. runes: true, }, }, }, }, ]; ``` -------------------------------- ### Configure ESLint for Svelte Files Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/README.md Configures ESLint to use svelte-eslint-parser for parsing Svelte files. This setup includes recommended ESLint configurations and specifies the parser for various Svelte file extensions. ```javascript import js from "@eslint/js"; import svelteParser from "svelte-eslint-parser"; export default [ js.configs.recommended, { files: [ "**/*.svelte", "*.svelte", // Need to specify the file extension for Svelte 5 with rune symbols "**/*.svelte.js", "*.svelte.js", "**/*.svelte.ts", "*.svelte.ts", ], languageOptions: { parser: svelteParser, }, }, ]; ``` -------------------------------- ### Configure Multiple Parsers for Different File Types Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/README.md This configuration allows you to specify different parsers for different file types within your ESLint setup. It demonstrates how to import and assign parsers like '@typescript-eslint/parser' and 'espree' for JavaScript, TypeScript, and Svelte files. ```javascript import tsParser from "@typescript-eslint/parser"; import espree from "espree"; export default [ { files: [ // Set .svelte/.js/.ts files. See above for more details. ], languageOptions: { parser: svelteParser, parserOptions: { parser: { ts: tsParser, js: espree, typescript: tsParser, }, }, }, }, ]; ``` -------------------------------- ### Define SvelteStyleElement Interface Source: https://github.com/sveltejs/svelte-eslint-parser/blob/main/docs/AST.md Defines the AST node for a