Skip to content

Commit

Permalink
Merge pull request #70 from phanect/refactor-format-all
Browse files Browse the repository at this point in the history
Format all files by Prettier
  • Loading branch information
scosman authored May 13, 2024
2 parents 4e6f41d + c24f4be commit 9650fd3
Show file tree
Hide file tree
Showing 15 changed files with 195 additions and 189 deletions.
55 changes: 30 additions & 25 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
module.exports = {
root: true,
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:svelte/recommended', 'prettier'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier",
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
parserOptions: {
sourceType: "module",
ecmaVersion: 2020,
extraFileExtensions: [".svelte"],
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
files: ["*.svelte"],
parser: "svelte-eslint-parser",
parserOptions: {
parser: {
// Specify a parser for each lang.
ts: '@typescript-eslint/parser',
js: 'espree',
typescript: '@typescript-eslint/parser'
}
}
}
ts: "@typescript-eslint/parser",
js: "espree",
typescript: "@typescript-eslint/parser",
},
},
},
],
env: {
browser: true,
es2017: true,
node: true
},
env: {
browser: true,
es2017: true,
node: true,
},
rules: {
'no-undef': 'off'
"no-undef": "off",
// no-undef has been turned off because of this:
// basically, it causes issues and TS does those checks so it's redundant
// https://typescript-eslint.io/linting/troubleshooting#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
}
};
},
}
14 changes: 7 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Build

on: [push,pull_request]
on: [push, pull_request]

env:
PUBLIC_SUPABASE_URL: 'https://fake_test_url.supabase.co'
PUBLIC_SUPABASE_ANON_KEY: 'fake_anon_key'
PRIVATE_SUPABASE_SERVICE_ROLE: 'fake_service_role'
PRIVATE_STRIPE_API_KEY: 'fake_strip_api_key'
PUBLIC_SUPABASE_URL: "https://fake_test_url.supabase.co"
PUBLIC_SUPABASE_ANON_KEY: "fake_anon_key"
PRIVATE_SUPABASE_SERVICE_ROLE: "fake_service_role"
PRIVATE_STRIPE_API_KEY: "fake_strip_api_key"

jobs:
build_and_test:
Expand All @@ -19,5 +19,5 @@ jobs:
- name: NPM install
run: npm install

- name: SvelteKit Build
run: npm run build
- name: SvelteKit Build
run: npm run build
10 changes: 5 additions & 5 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Format Check

on: [push,pull_request]
on: [push, pull_request]

env:
PUBLIC_SUPABASE_URL: 'https://fake_test_url.supabase.co'
PUBLIC_SUPABASE_ANON_KEY: 'fake_anon_key'
PRIVATE_SUPABASE_SERVICE_ROLE: 'fake_service_role'
PRIVATE_STRIPE_API_KEY: 'fake_strip_api_key'
PUBLIC_SUPABASE_URL: "https://fake_test_url.supabase.co"
PUBLIC_SUPABASE_ANON_KEY: "fake_anon_key"
PRIVATE_SUPABASE_SERVICE_ROLE: "fake_service_role"
PRIVATE_STRIPE_API_KEY: "fake_strip_api_key"

jobs:
build_and_test:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Linting

on: [push,pull_request]
on: [push, pull_request]

env:
PUBLIC_SUPABASE_URL: 'https://fake_test_url.supabase.co'
PUBLIC_SUPABASE_ANON_KEY: 'fake_anon_key'
PRIVATE_SUPABASE_SERVICE_ROLE: 'fake_service_role'
PRIVATE_STRIPE_API_KEY: 'fake_strip_api_key'
PUBLIC_SUPABASE_URL: "https://fake_test_url.supabase.co"
PUBLIC_SUPABASE_ANON_KEY: "fake_anon_key"
PRIVATE_SUPABASE_SERVICE_ROLE: "fake_service_role"
PRIVATE_STRIPE_API_KEY: "fake_strip_api_key"

jobs:
build_and_test:
Expand All @@ -21,6 +21,6 @@ jobs:

- name: Linting
run: npm run lint

- name: Typechecking
run: npm run check
11 changes: 5 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Tests

on: [push,pull_request]
on: [push, pull_request]

env:
PUBLIC_SUPABASE_URL: 'https://fake_test_url.supabase.co'
PUBLIC_SUPABASE_ANON_KEY: 'fake_anon_key'
PRIVATE_SUPABASE_SERVICE_ROLE: 'fake_service_role'
PRIVATE_STRIPE_API_KEY: 'fake_strip_api_key'
PUBLIC_SUPABASE_URL: "https://fake_test_url.supabase.co"
PUBLIC_SUPABASE_ANON_KEY: "fake_anon_key"
PRIVATE_SUPABASE_SERVICE_ROLE: "fake_service_role"
PRIVATE_STRIPE_API_KEY: "fake_strip_api_key"

jobs:
build_and_test:
Expand All @@ -21,4 +21,3 @@ jobs:

- name: Tests
run: npm run test_run

3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/.svelte-kit/
**/node_modules/
**/package-lock.json
10 changes: 5 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"plugins": ["prettier-plugin-svelte"],
"useTabs": false,
"tabWidth": 2,
"semi": false,
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
"plugins": ["prettier-plugin-svelte"],
"useTabs": false,
"tabWidth": 2,
"semi": false,
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
}
6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "svelte.svelte-vscode",
"eslint.validate": ["javascript", "javascriptreact", "svelte"]
"editor.formatOnSave": true,
"editor.defaultFormatter": "svelte.svelte-vscode",
"eslint.validate": ["javascript", "javascriptreact", "svelte"]
}
Loading

0 comments on commit 9650fd3

Please sign in to comment.