Skip to content

Commit 22ead1f

Browse files
committed
add prettier and eslint
1 parent 500c6d3 commit 22ead1f

File tree

3 files changed

+54
-3
lines changed

3 files changed

+54
-3
lines changed

.prettierignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.DS_Store
2+
node_modules
3+
/docs
4+
/build
5+
/.svelte-kit
6+
/package
7+
.env
8+
.env.*
9+
!.env.example
10+
11+
# Ignore files for PNPM, NPM and YARN
12+
pnpm-lock.yaml
13+
package-lock.json
14+
yarn.lock

.prettierrc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"svelteStrictMode": false,
3+
"svelteAllowShorthand": true,
4+
"svelteIndentScriptAndStyle": true,
5+
"semi": false,
6+
"useTabs": true,
7+
"singleQuote": true,
8+
"trailingComma": "none",
9+
"arrowParens": "avoid",
10+
"bracketSameLine": false,
11+
"plugins": ["prettier-plugin-svelte"],
12+
"pluginSearchDirs": ["."],
13+
"overrides": [
14+
{
15+
"files": "*.svelte",
16+
"options": {
17+
"parser": "svelte"
18+
}
19+
}
20+
]
21+
}

package.json

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,39 @@
55
"scripts": {
66
"dev": "vite dev",
77
"build": "vite build",
8-
"preview": "vite preview"
8+
"preview": "vite preview",
9+
"lint": "prettier --plugin-search-dir . --check . && eslint .",
10+
"format": "prettier --plugin-search-dir . --write ."
911
},
1012
"devDependencies": {
1113
"@sveltejs/adapter-auto": "^2.0.0",
1214
"@sveltejs/kit": "next",
1315
"autoprefixer": "^10.4.7",
16+
"eslint": "^8.35.0",
17+
"eslint-config-prettier": "^8.7.0",
18+
"eslint-plugin-svelte3": "^4.0.0",
1419
"leaflet": "^1.9.2",
1520
"postcss": "^8.4.14",
1621
"postcss-load-config": "^4.0.1",
22+
"prettier": "^2.8.4",
23+
"prettier-plugin-svelte": "^2.9.0",
1724
"svelte": "^3.44.0",
1825
"svelte-preprocess": "^4.10.7",
1926
"vite": "^4.0.0"
2027
},
21-
"type": "module",
2228
"dependencies": {
2329
"geoip-lite": "^1.4.7",
2430
"psl": "^1.9.0",
2531
"whoiser": "^1.16.0"
26-
}
32+
},
33+
"eslintConfig": {
34+
"extends": [
35+
"@sveltejs",
36+
"prettier"
37+
],
38+
"ignorePatterns": [
39+
"docs/*"
40+
]
41+
},
42+
"type": "module"
2743
}

0 commit comments

Comments
 (0)