Skip to content

Commit 672229e

Browse files
authored
fix: migrate eslint configurations (#61)
* re-introduce tests + improve workflow + lib updates. * remove yarn.lock * update eslint configurations
1 parent 476e2f5 commit 672229e

File tree

5 files changed

+144
-42
lines changed

5 files changed

+144
-42
lines changed

.eslintignore

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

.eslintrc

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

eslint.config.mjs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin";
3+
import tsParser from "@typescript-eslint/parser";
4+
import path from "node:path";
5+
import { fileURLToPath } from "node:url";
6+
import js from "@eslint/js";
7+
import { FlatCompat } from "@eslint/eslintrc";
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const compat = new FlatCompat({
12+
baseDirectory: __dirname,
13+
recommendedConfig: js.configs.recommended,
14+
allConfig: js.configs.all
15+
});
16+
17+
export default defineConfig([globalIgnores(["*", "!src", "src/__tests__"]), {
18+
extends: compat.extends("prettier"),
19+
20+
plugins: {
21+
"@typescript-eslint": typescriptEslintEslintPlugin,
22+
},
23+
24+
languageOptions: {
25+
parser: tsParser,
26+
ecmaVersion: 5,
27+
sourceType: "script",
28+
29+
parserOptions: {
30+
project: "./tsconfig.json",
31+
},
32+
},
33+
34+
rules: {
35+
"@typescript-eslint/explicit-function-return-type": "off",
36+
"@typescript-eslint/no-explicit-any": "off",
37+
"@typescript-eslint/no-empty-function": "warn",
38+
"@typescript-eslint/no-namespace": "off",
39+
"@typescript-eslint/no-use-before-define": "off",
40+
},
41+
}, {
42+
files: ["./src/configs.ts", "./src/utils/Jagex.ts", "./src/lib/RuneScape.ts"],
43+
44+
rules: {
45+
"@typescript-eslint/camelcase": "off",
46+
},
47+
}]);

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
"slugify": "^1.5.0"
3131
},
3232
"devDependencies": {
33+
"@eslint/eslintrc": "^3.3.4",
34+
"@eslint/js": "^10.0.1",
3335
"@types/jest": "^30.0.0",
3436
"@typescript-eslint/eslint-plugin": "^8.56.1",
3537
"@typescript-eslint/parser": "^8.56.1",

pnpm-lock.yaml

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)