Skip to content

Commit fb94a4a

Browse files
committed
Add eslint config and vscode settings
1 parent ce75f57 commit fb94a4a

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"deno.enablePaths": ["references/deno-reference", "runtime_tests/tests/deno"],
3-
"debug.toolBarLocation": "commandCenter"
3+
"debug.toolBarLocation": "commandCenter",
4+
"eslint.workingDirectories": ["apps/webapp"]
45
}

apps/webapp/.eslintrc

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
{
2-
"extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node", "prettier"],
3-
"rules": {
4-
"@typescript-eslint/strict-boolean-expressions": [
5-
"error",
6-
{
7-
"allowNullableBoolean": true,
8-
"allowNullableString": true,
9-
"allowNullableNumber": true
2+
"plugins": [
3+
"@trigger.dev/eslint-plugin",
4+
"react-hooks",
5+
"@typescript-eslint/eslint-plugin",
6+
"import"
7+
],
8+
"parser": "@typescript-eslint/parser",
9+
"overrides": [
10+
{
11+
"files": ["*.ts", "*.tsx"],
12+
"rules": {
13+
// Autofixes imports from "@trigger.dev/core" to fine grained modules
14+
"@trigger.dev/no-trigger-core-import": "error",
15+
// Normalize `import type {}` and `import { type }`
16+
"@typescript-eslint/consistent-type-imports": [
17+
"warn",
18+
{
19+
// the "type" annotation can get tangled and cause syntax errors
20+
// during some autofixes, so easier to just turn it off
21+
"prefer": "type-imports",
22+
"disallowTypeAnnotations": true,
23+
"fixStyle": "inline-type-imports"
24+
}
25+
],
26+
// no-trigger-core-import splits imports into multiple lines
27+
// this one merges them back into a single line
28+
// if they still import from the same module
29+
"import/no-duplicates": ["warn", { "prefer-inline": true }],
30+
// lots of undeclared vars, enable this rule if you want to clean them up
31+
"turbo/no-undeclared-env-vars": "off"
1032
}
11-
]
12-
}
33+
}
34+
],
35+
"ignorePatterns": ["seed.js", "seedCloud.ts", "populate.js"]
1336
}

0 commit comments

Comments
 (0)