diff --git a/apps/www/src/content/cli.md b/apps/www/src/content/cli.md index 4cd9efd80..f7df57888 100644 --- a/apps/www/src/content/cli.md +++ b/apps/www/src/content/cli.md @@ -16,10 +16,11 @@ npx shadcn-svelte@latest init You will be asked a few questions to configure `components.json`: ```txt showLineNumbers +Would you like to use TypeScript? (recommended) › Yes Which style would you like to use? › Default -Which color would you like to use as base color? › Slate -Where is your global CSS file? › src/app.pcss -Where is your tailwind.config.[cjs|js|ts] located? › tailwind.config.js +Which base color would you like to use? › Slate +Where is your global CSS file? (this file will be overwritten) › src/app.css +Where is your Tailwind config located? (this file will be overwritten) › tailwind.config.[cjs|js|ts] Configure the import alias for components: › $lib/components Configure the import alias for utils: › $lib/utils ``` @@ -32,7 +33,6 @@ Usage: shadcn-svelte init [options] initialize your project and install dependencies Options: - -y, --yes skip confirmation prompt. (default: false) -c, --cwd the working directory. (default: the current directory) -h, --help display help for command ``` diff --git a/apps/www/src/content/installation/index.md b/apps/www/src/content/installation/index.md index ecbb200ec..94d15c17d 100644 --- a/apps/www/src/content/installation/index.md +++ b/apps/www/src/content/installation/index.md @@ -115,6 +115,36 @@ The main benefit of adding an additional `.eslintrc` file just to `$lib/componen If this is not important to you, then another option is to use a similar rule override in your global ESLint configuration file, usually `.eslintrc.cjs`. For inspiration, please refer to [this gist](https://gist.github.com/huntabyte/b73073a93a7a664f3cbad7c50376c9c9). +If your global ESLint configuration is using the [flat config format](https://eslint.org/docs/latest/use/configure/configuration-files) or you would like to migrate to the flat config format [Configuration Migration Guide](https://eslint.org/docs/latest/use/configure/migration-guide) you could add another rule block in your `eslint.config.js` for example: + +```js title="src/eslint.config.js" +/** @type {import('eslint').Linter.FlatConfig[]} */ +export default [ + /* ... */ + { + files: ["**/*.svelte"], + languageOptions: { + parserOptions: { + parser: ts.parser, + }, + }, + }, + { + /* location of your components where you would like to apply these rules */ + files: ["**/components/ui/**/*.svelte"], + rules: { + "@typescript-eslint/no-unused-vars": [ + "warn", + { + argsIgnorePattern: "^_", + varsIgnorePattern: "^\\$\\$(Props|Events|Slots|Generic)$", + }, + ], + }, + }, +]; +``` + ## VSCode extension Install the shadcn-svelte [VSCode extension](https://marketplace.visualstudio.com/items?itemName=Selemondev.vscode-shadcn-svelte) by [@selemondev](https://github.com/selemondev) in Visual Studio Code to easily add Shadcn Svelte components to your project.