Skip to content

Commit 8bf3236

Browse files
committed
upgrade eslint and add lint script for express
1 parent ffca1dd commit 8bf3236

File tree

4 files changed

+34
-12
lines changed

4 files changed

+34
-12
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { FlatCompat } from "@eslint/eslintrc";
2+
import js from "@eslint/js";
3+
import path from "node:path";
4+
import { fileURLToPath } from "node:url";
5+
import tseslint from "typescript-eslint";
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
const compat = new FlatCompat({
10+
baseDirectory: __dirname,
11+
recommendedConfig: js.configs.recommended,
12+
allConfig: js.configs.all,
13+
});
14+
15+
export default [
16+
...compat.extends("eslint:recommended", "prettier"),
17+
...tseslint.configs.recommended,
18+
{
19+
ignores: ["prettier.config.cjs"],
20+
},
21+
{ files: ["**/*.{ts}"] },
22+
{
23+
rules: {
24+
"max-params": ["error", 4],
25+
"prefer-const": "error",
26+
"@typescript-eslint/no-explicit-any": "off",
27+
"@typescript-eslint/ban-ts-comment": "off",
28+
"@typescript-eslint/no-unused-vars": "off",
29+
},
30+
},
31+
];

templates/types/streaming/express/eslintrc.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

templates/types/streaming/express/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable turbo/no-undeclared-env-vars */
21
import cors from "cors";
32
import "dotenv/config";
43
import express, { Express, Request, Response } from "express";

templates/types/streaming/express/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"format:write": "prettier --ignore-unknown --write .",
1313
"build": "tsup index.ts --format esm --dts",
1414
"start": "node dist/index.js",
15-
"dev": "concurrently \"tsup index.ts --format esm --dts --watch\" \"nodemon --watch dist/index.js\""
15+
"dev": "concurrently \"tsup index.ts --format esm --dts --watch\" \"nodemon --watch dist/index.js\"",
16+
"lint": "eslint ."
1617
},
1718
"dependencies": {
1819
"ai": "3.3.42",
@@ -33,6 +34,7 @@
3334
"@types/cors": "^2.8.16",
3435
"@types/express": "^4.17.21",
3536
"@types/node": "^20.9.5",
37+
"typescript-eslint": "^8.14.0",
3638
"concurrently": "^8.2.2",
3739
"eslint": "^9.14.0",
3840
"eslint-config-prettier": "^8.10.0",

0 commit comments

Comments
 (0)