Skip to content

Commit

Permalink
Merge pull request #686 from rage/svelte
Browse files Browse the repository at this point in the history
Svelte
  • Loading branch information
nygrenh authored Dec 14, 2023
2 parents 861ba19 + 0a70fe8 commit c38cd27
Show file tree
Hide file tree
Showing 159 changed files with 7,759 additions and 4,344 deletions.
151 changes: 151 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:prettier/recommended",
],
globals: {
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 6,
sourceType: "module",
},
plugins: ["@typescript-eslint", "import", "prettier", "sort-class-members"],
settings: {
"import/core-modules": ["vscode"],
},
rules: {
"no-unused-vars": "off",
// unused vars are allowed if they start with an underscore
"@typescript-eslint/no-unused-vars": [
"warn",
{
varsIgnorePattern: "^_",
argsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
},
],

"@typescript-eslint/ban-ts-comment": ["error", { "ts-ignore": "allow-with-description" }],
"import/no-named-as-default": "off",
curly: "error",
"sort-imports": [
"error",
{
ignoreCase: true,
ignoreDeclarationSort: true,
},
],
"import/order": [
"error",
{
alphabetize: {
order: "asc",
},
groups: [["builtin", "external"], "parent", "sibling", "index"],
"newlines-between": "always",
},
],
"@typescript-eslint/no-var-requires": "off",
// == disabled default configs from svelte template ==
/*
"@typescript-eslint/no-use-before-define": [
"error",
{
classes: false,
functions: false,
},
],
quotes: "off",
"@typescript-eslint/quotes": ["error", "double", { avoidEscape: true }],
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/semi": ["error"],
"@typescript-eslint/lines-between-class-members": [
"error",
"always",
{ exceptAfterSingleLine: true },
],
"@typescript-eslint/naming-convention": [
"error",
{
selector: "function",
format: ["camelCase"],
},
{
selector: "method",
modifiers: ["public"],
format: ["camelCase"],
},
{
selector: "method",
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require",
},
{
selector: "property",
modifiers: ["private"],
format: ["camelCase"],
leadingUnderscore: "require",
},
{
selector: "typeLike",
format: ["PascalCase"],
},
],
"max-len": [
"warn",
{
code: 130,
comments: 100,
ignoreComments: false,
},
],
eqeqeq: ["error"],
"sort-class-members/sort-class-members": [
2,
{
order: [
"[static-properties]",
"[static-methods]",
"[properties]",
"[conventional-private-properties]",
"constructor",
"[methods]",
"[conventional-private-methods]",
"[everything-else]",
],
accessorPairPositioning: "getThenSet",
},
],
"no-throw-literal": "warn",
semi: "off",
*/
},
ignorePatterns: ["webview-ui/**"],
overrides: [
{
files: ["*.ts", "*.tsx"],
rules: {
"@typescript-eslint/explicit-function-return-type": ["error"],
"@typescript-eslint/explicit-module-boundary-types": ["error"],
"@typescript-eslint/no-var-requires": ["error"],
},
},
],
};
125 changes: 0 additions & 125 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
text eol=lf
* text=auto eol=lf
1 change: 1 addition & 0 deletions .github/workflows/build-and-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
run: |
npm run ci:all
npm install -g @vscode/vsce
npm run webpack
vsce package ${{ env.PRERELEASE }}
# move packaged extension from project root to own release folder
mkdir extension && mv *.vsix extension
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,10 @@ jobs:
cd ..
- name: Unit tests
uses: GabrielBB/setup-xvfb@v1.0.1
uses: coactions/setup-xvfb@v1
with:
run: npm test

- name: Integration tests
uses: GabrielBB/[email protected]
with:
run: npm run test-integration-only integration

playwright_tests:
name: Playwright tests
env:
Expand Down
2 changes: 1 addition & 1 deletion .husky/lint-staged-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
"*.{html,js,json,jsx,ts,yml}": ["prettier --check"],
"*.{js,jsx,ts,tsx}": ["eslint --cache --max-warnings 0"],
"src/*.{js,jsx,ts,tsx}": ["eslint --cache --max-warnings 0"],
};
26 changes: 26 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# shared
/src/shared
/webview-ui/src/shared
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"printWidth": 110,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": false,
"quoteProps": "consistent",
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": true,
"arrowParens": "always"
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
"html.validate.scripts": false,
"html.validate.styles": false,
"spellright.language": ["en"],
"spellright.documentTypes": ["markdown", "latex", "plaintext", "typescript"]
"spellright.documentTypes": ["markdown", "latex", "plaintext", "typescript"],
"eslint.validate": ["svelte"]
}
11 changes: 10 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ out/**
src/**
submodules/**
test-resources/**
types/**

**/.dockerignore
**/.eslintcache
Expand Down Expand Up @@ -45,3 +44,13 @@ webpack.common.js
webpack.config.js
webpack.dev.js
webpack.prod.js

# Ignore all webview-ui files except the build directory
webview-ui/src/**
webview-ui/public/**
webview-ui/scripts/**
webview-ui/index.html
webview-ui/README.md
webview-ui/package.json
webview-ui/package-lock.json
webview-ui/node_modules/**
Loading

0 comments on commit c38cd27

Please sign in to comment.