Skip to content

Commit efa9248

Browse files
committed
add ts
1 parent 7d04e7a commit efa9248

14 files changed

+3081
-1259
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = false
12+
insert_final_newline = false

.eslintignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/public/build
2+
/public/bundles
3+
/node_modules
4+
/var
5+
/vendor
6+
/*/
7+
!/assets/
8+
!/src/
9+
!/config/
10+
!/templates/

.eslintrc.cjs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module.exports = {
2+
root: true,
3+
parser: "@typescript-eslint/parser",
4+
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
5+
plugins: ["svelte3", "@typescript-eslint"],
6+
ignorePatterns: ["*.cjs"],
7+
overrides: [{ files: ["*.svelte"], processor: "svelte3/svelte3" }],
8+
settings: {
9+
'svelte3/compiler-options': {customElement: true},
10+
"svelte3/typescript": () => require("typescript"),
11+
},
12+
parserOptions: {
13+
sourceType: "module",
14+
ecmaVersion: 2019,
15+
project: "tsconfig.json",
16+
tsconfigRootDir: __dirname,
17+
},
18+
env: {
19+
browser: true,
20+
es2017: true,
21+
node: true,
22+
},
23+
rules: {
24+
"@typescript-eslint/no-floating-promises": "error",
25+
"@typescript-eslint/no-unused-vars": "off",
26+
},
27+
};

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": false,
4+
"trailingComma": "all",
5+
"printWidth": 100
6+
}
File renamed without changes.

assets/components/asset-component.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<svelte:options tag="asset-component" />
22

3-
<script>
3+
<script lang="ts">
44
import svg from "../images/vector/github.svg"
55
import children1 from "../images/children/1.jpg"
66
</script>
77

88
<div>
9-
<img src={svg} />
10-
<img src={children1} />
9+
<img src={svg} alt="svg icon test"/>
10+
<img src={children1} alt="jpg icon test" />
1111
</div>
1212

1313
<style lang="scss">

assets/components/modal-component.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<svelte:options tag="modal-component" />
22

3-
<script>
3+
<script lang="ts">
44
let dialog;
55
</script>
66
<button on:click={dialog.showModal()}>open</button>

assets/components/test-component.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<svelte:options tag="test-component" />
22

3-
<script>
3+
<script lang="ts">
44
export let customprop1 = null;
55
export let customprop2 = null;
66
</script>

0 commit comments

Comments
 (0)