Skip to content

Commit

Permalink
Refactor to current SvelteKit library best practices (#96)
Browse files Browse the repository at this point in the history
* chore: refactor to new folder structure

* chore: move lib

* chore: move tests

* chore: move files back

* Delete settings.json

* chore: bump deps

* chore: add file endings

* chore: fix the build

* chore: fix test snapshots

* chore: fix linter

* chore: prepare semantic release

* chore: restore older prettier config

* chore: remove file endings
  • Loading branch information
stipsan authored Mar 18, 2024
1 parent c5eff49 commit ec03460
Show file tree
Hide file tree
Showing 22 changed files with 11,537 additions and 12,445 deletions.
17 changes: 17 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
/dist

# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

# Ignore problematic test files
/tests/render-tests/050-custom-block-type.svelte
40 changes: 14 additions & 26 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,43 +1,31 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'sanity/typescript',
'plugin:svelte/recommended'
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
},
rules: {
'no-console': 'off',
'no-undef': 'off',
'no-negated-condition': 'off'
}
}
],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2019,
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
rules: {
indent: 'off',
'max-len': 'off',
'implicit-arrow-linebreak': 'off',
'@typescript-eslint/no-explicit-any': 'warn'
}
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
}
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
node-version: lts/*
- run: npm ci
- run: npm run lint
- run: npm run prepublish
- run: npm run prepublishOnly

test:
runs-on: ${{ matrix.platform }}
Expand Down Expand Up @@ -76,5 +76,6 @@ jobs:
# Branches that will release new versions are defined in "release" in "package.json"
- run: npx semantic-release
env:
NPM_CONFIG_PROVENANCE: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
.DS_Store
node_modules
/build
/dist
/.svelte-kit
/package
/dist
.vercel_build_output
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vercel
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
4 changes: 3 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
"trailingComma": "none",
"semi": false,
"printWidth": 100,
"bracketSpacing": false
"bracketSpacing": false,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-packagejson"],
"overrides": [{"files": "*.svelte", "options": {"parser": "svelte"}}]
}
1 change: 0 additions & 1 deletion .vscode/settings.json

This file was deleted.

Loading

0 comments on commit ec03460

Please sign in to comment.