Skip to content

Instantly share code, notes, and snippets.

@jacksteamdev
Last active July 14, 2021 19:15
Show Gist options
  • Save jacksteamdev/6993487ac915a908608c43f5c275d2bd to your computer and use it in GitHub Desktop.
Save jacksteamdev/6993487ac915a908608c43f5c275d2bd to your computer and use it in GitHub Desktop.
Sveltekit config files
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [
{ files: ['*.svelte'], processor: 'svelte3/svelte3' },
],
settings: {
'svelte3/typescript': () => require('typescript'),
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
},
env: {
browser: true,
es2017: true,
node: true,
},
}
semi: false
tabWidth: 2
trailingComma: "all"
jsxSingleQuote: true
printWidth: 65
singleQuote: true
arrowParens: "always"
proseWrap: "always"
plugins:
- "./node_modules/prettier-plugin-package"
overrides:
- files: "*.ts"
options:
plugins:
- "./node_modules/prettier-plugin-import-sort"
- files: "*.svelte"
options:
parser: 'svelte'
plugins:
- "./node_modules/prettier-plugin-svelte"

Setup Instructions

  • Run this in the terminal:
pnpm init svelte@next my-app
pnpx svelte-add tailwindcss
pnpm i prettier-plugin-package prettier-plugin-import-sort import-sort-style-module
  • Remove --plugin-search-dir=. from scripts in package.json.

  • Add this to package.json:

{
  "importSort": {
    ".js, .jsx, .ts, .tsx, .mjs": {
      "style": "module"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment