Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #3

Merged
merged 19 commits into from
Jun 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
last 2 versions
defaults and fully supports es6-module
14 changes: 10 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# misc
.DS_Store

# node
node_modules

# output
/build

# framework-related
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# Ignore files for PNPM, NPM and YARN
# package manager
pnpm-lock.yaml
package-lock.json
yarn.lock
79 changes: 48 additions & 31 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,69 +1,86 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
extraFileExtensions: ['.svelte'],
},
plugins: ['svelte3', '@typescript-eslint/eslint-plugin'],
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'plugin:prettier/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
env: {
browser: true,
es2017: true,
node: true
node: true,
},
ignorePatterns: ['*.cjs', '.gitignore', 'svelte.config.js', 'vite.config.js'],
overrides: [{ files: ['*.svelte'], processor: 'svelte3/svelte3' }],
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
}
],
settings: {
'svelte3/typescript': true,
"svelte3/ignore-styles": ({ lang }) => !!lang,
"import/resolver": {
typescript: {} // this loads <rootdir>/tsconfig.json to eslint
svelte: {
kit: {
files: {
routes: 'src/routes',
},
},
},
'import/resolver': {
typescript: {}
},
},
rules: {
'@typescript-eslint/no-namespace': 'off',
'import/no-duplicates': 'off',
'import/order': [
'error',
{
pathGroups: [
{
pattern: '$app/**',
group: 'internal',
},
{
pattern: '$lib/!(types)**/**',
group: 'parent',
},
{
pattern: '$lib/types',
group: 'type',
},
{
pattern: '$lib/types/**',
group: 'type',
}
{
pattern: '$app/**',
group: 'internal',
},
{
pattern: '$lib/!(types)**/**',
group: 'parent',
},
{
pattern: '$lib/types',
group: 'type',
},
{
pattern: '$lib/types/**',
group: 'type',
}
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
},
groups: [
'type',
'builtin',
'external',
'internal',
'parent',
['sibling', 'index'],
'type',
'builtin',
'external',
'internal',
'parent',
['sibling', 'index'],
],
},
],
'import/no-unresolved': [2, { ignore: ['^\\$[env|app|locales]'] }]
'import/no-unresolved': [2, { ignore: ['^\\$[env|app|locales]'] }]
},
};
43 changes: 21 additions & 22 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
name: lint
name: Lint

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read
pull-requests: read

jobs:
test:
name: lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest]
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v2
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache: npm

- name: Install and build
run: |
npm install
npm run build --if-present
- name: Install dependencies
run: npm ci

- name: Lint
- name: Lint code
run: npm run lint

- name: Build code
run: npm run build
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# misc
.DS_Store

# node
node_modules

# output
/build

# framework-related
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
save-exact=true
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

14 changes: 10 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# misc
.DS_Store

# node
node_modules

# output
/build

# framework-related
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*

# Ignore files for PNPM, NPM and YARN
# package manager
pnpm-lock.yaml
package-lock.json
yarn.lock
34 changes: 30 additions & 4 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
{
"useTabs": false,
"arrowParens": "always",
"bracketSpacing": true,
"bracketSameLine": false,
"jsxSingleQuote": false,
"endOfLine": "lf",
"printWidth": 100,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100
}
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": ["*.js", "*.jsx", "*.ts", "*.tsx"],
"options": {
"parser": "typescript"
}
},
{
"files": ["*.yml", "*.yaml", "*.json"],
"options": {
"tabWidth": 2
}
},
{ "files": "*.svelte", "options": { "parser": "svelte" } }
]
}

Loading
Loading