Skip to content

Commit f2c1ef0

Browse files
committed
Add eslint
1 parent 541a1ff commit f2c1ef0

File tree

5 files changed

+44
-3
lines changed

5 files changed

+44
-3
lines changed

cli.sh

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ code_quality() {
77
deno fmt --check
88
echo "Linting..."
99
deno lint
10+
echo "Running eslint..."
11+
eslint .
1012
}
1113

1214
auto_fmt() {

eslint.config.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const { execSync } = require("node:child_process");
2+
const { dirname } = require("node:path");
3+
4+
const whichEslint = execSync("which eslint");
5+
const eslintPath = dirname(dirname(whichEslint.toString().trim()));
6+
const tseslint = require(`${eslintPath}/node_modules/typescript-eslint/dist/index.js`);
7+
8+
module.exports = tseslint.config(
9+
...tseslint.configs.recommended.map(({ rules, ...rest }) => rest),
10+
{
11+
files: ["**/*.ts"],
12+
rules: {
13+
"@typescript-eslint/await-thenable": "error",
14+
},
15+
languageOptions: {
16+
parserOptions: {
17+
project: `${__dirname}/tsconfig.json`,
18+
},
19+
}
20+
}
21+
);

flake.lock

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
inherit (pkgs)
7272
kubectl
7373
;
74+
inherit (hotPotPkgs)
75+
typescript-eslint
76+
;
7477
};
7578
in
7679
{

tsconfig.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"esModuleInterop": true,
5+
"experimentalDecorators": false,
6+
"inlineSourceMap": false,
7+
"isolatedModules": true,
8+
"lib": ["ESNext", "DOM"],
9+
"module": "esnext",
10+
"moduleDetection": "force",
11+
"strict": true,
12+
"target": "esnext",
13+
"useDefineForClassFields": true
14+
}
15+
}

0 commit comments

Comments
 (0)