Skip to content

Commit

Permalink
docs: CLI & ESLint Config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
oluijks authored Jul 6, 2024
1 parent c8bfa6e commit 2ae567d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/www/src/content/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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 <cwd> the working directory. (default: the current directory)
-h, --help display help for command
```
Expand Down
30 changes: 30 additions & 0 deletions apps/www/src/content/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 2ae567d

Please sign in to comment.