Skip to content

Commit 34a8147

Browse files
committed
🔧 add basic dev tooling
1 parent 9ef36b4 commit 34a8147

File tree

5 files changed

+223
-37
lines changed

5 files changed

+223
-37
lines changed

.eslintrc.json

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
{
2+
"$schema": "https://json.schemastore.org/eslintrc",
3+
"parser": "@typescript-eslint/parser",
4+
"env": {
5+
"browser": true,
6+
"node": true
7+
},
28
"ignorePatterns": ["test/fixtures/**", "dist/**", "rollup.config.js"],
39
"plugins": ["prettier-doc"],
410
"extends": [
511
"eslint:recommended",
6-
"plugin:ava/recommended",
712
"plugin:prettier-doc/recommended",
8-
"plugin:node/recommended"
13+
"plugin:astro/recommended",
14+
"plugin:@typescript-eslint/eslint-recommended",
15+
"plugin:@typescript-eslint/recommended"
916
],
10-
"astroAllowShorthand": false,
1117
"rules": {
12-
"curly": ["error", "multi-line"],
13-
"node/no-unsupported-features/es-builtins": [
14-
"error",
15-
{
16-
"version": "^12.20.0 || ^14.13.1 || >=16.0.0",
17-
"ignores": []
18-
}
19-
],
20-
"node/no-unsupported-features/node-builtins": [
21-
"error",
22-
{
23-
"version": "^12.20.0 || ^14.13.1 || >=16.0.0",
24-
"ignores": []
25-
}
26-
]
18+
"curly": ["error", "multi-line"]
2719
},
2820
"parserOptions": {
2921
"ecmaVersion": "latest",
3022
"sourceType": "module"
31-
}
23+
},
24+
"overrides": [
25+
{
26+
"files": ["*.astro"],
27+
"parser": "astro-eslint-parser",
28+
"parserOptions": {
29+
"parser": "@typescript-eslint/parser",
30+
"extraFileExtensions": [".astro"]
31+
}
32+
}
33+
]
3234
}

astro.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineConfig } from 'astro/config'
22
import webmanifest from 'astro-webmanifest'
3-
// @ts-ignore-next-line
3+
// @ts-expect-error for some reason is not getting the path properly
44
import getHomeDocument from './src/utils/getHomeDocument.ts'
55

66
export default defineConfig({

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
"start": "astro dev",
99
"build": "astro build",
1010
"preview": "astro preview",
11+
"get-custom-types": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"esnext\", \"target\": \"es2017\", \"lib\": [\"esnext\"]}' ts-node --esm scripts/get-custom-types.ts",
1112
"format": "prettier --ignore-path .gitignore . -wu",
12-
"get-custom-types": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"esnext\", \"target\": \"es2017\", \"lib\": [\"esnext\"]}' ts-node --esm scripts/get-custom-types.ts"
13+
"lint": "eslint 'src/**/*.{js,ts,tsx,astro}'",
14+
"type-check": "astro check && tsc --noemit"
1315
},
1416
"dependencies": {
1517
"@astrolib/seo": "^0.2.1",
@@ -24,17 +26,20 @@
2426
"devDependencies": {
2527
"@prismicio/types": "^0.2.3",
2628
"@tsconfig/node14": "^1.0.1",
29+
"@typescript-eslint/eslint-plugin": "^5.41.0",
30+
"@typescript-eslint/parser": "^5.41.0",
2731
"astro": "^1.4.2",
2832
"astro-webmanifest": "^0.4.1",
2933
"dotenv": "^16.0.3",
3034
"eslint": "^8.24.0",
35+
"eslint-plugin-astro": "^0.20.0",
3136
"eslint-plugin-node": "^11.1.0",
3237
"eslint-plugin-prettier-doc": "^1.1.0",
3338
"execa": "^6.1.0",
3439
"node-fetch": "^3.2.5",
3540
"ora": "^6.1.0",
3641
"prettier": "^2.6.1",
37-
"prettier-plugin-astro": "^0.5.5",
42+
"prettier-plugin-astro": "^0.6.0",
3843
"prismic-ts-codegen": "^0.0.3",
3944
"prompts": "^2.4.2",
4045
"ts-node": "10.8.0",

tsconfig.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2+
"extends": "astro/tsconfigs/base",
3+
"types": ["astro/client"],
24
"compilerOptions": {
3-
"moduleResolution": "node",
45
"baseUrl": ".",
56
"strict": true,
6-
"resolveJsonModule": true,
7-
"esModuleInterop": true,
8-
"module": "esnext",
7+
"importsNotUsedAsValues": "error",
98
"paths": {
109
"~/*": ["src/*"]
1110
}
12-
}
11+
},
12+
"include": ["src/*"]
1313
}

0 commit comments

Comments
 (0)