Skip to content

Commit 61e7b8d

Browse files
authored
Migrate to ESLint 9 (#15)
* chore: bump libs * chore: migrate * chore: satisfy linter * chore: bump version * fix: also lint "tests"
1 parent 650973e commit 61e7b8d

File tree

9 files changed

+1165
-886
lines changed

9 files changed

+1165
-886
lines changed

.eslintrc

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

eslint.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @ts-check
2+
3+
import { configs } from "@js-soft/eslint-config-ts"
4+
import { globalIgnores } from "eslint/config"
5+
import tseslint from "typescript-eslint"
6+
7+
export default tseslint.config(globalIgnores(["**/dist", "**/node_modules"]), {
8+
extends: [configs.base, configs.mocha],
9+
languageOptions: {
10+
parserOptions: {
11+
project: ["./tsconfig.json", "example/tsconfig.json"]
12+
}
13+
},
14+
files: ["**/*.ts"],
15+
rules: {
16+
"no-console": "off",
17+
"jest/expect-expect": "off"
18+
}
19+
})

example/test/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function sleep(ms: number = 500): Promise<void> {
1+
function sleep(ms = 500): Promise<void> {
22
if (ms <= 0) throw new Error("Please enter a positive value greater than 0.")
33

44
return new Promise((resolve) => {
@@ -16,11 +16,11 @@ describe("Long running tests", function () {
1616

1717
const testVar = process.env.TEST_VAR
1818
describe("env var mounting", function () {
19-
it("should mount env vars on the root", async function () {
20-
if (testVar != "test") throw new Error("TEST_VAR is not set to 'test'")
19+
it("should mount env vars on the root", function () {
20+
if (testVar !== "test") throw new Error("TEST_VAR is not set to 'test'")
2121
})
2222

23-
it("should mount env vars", async function () {
24-
if (process.env.TEST_VAR != "test") throw new Error("TEST_VAR is not set to 'test'")
23+
it("should mount env vars", function () {
24+
if (process.env.TEST_VAR !== "test") throw new Error("TEST_VAR is not set to 'test'")
2525
})
2626
})

example/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"strictNullChecks": true,
34
"lib": ["es2015", "dom"],
45
"baseUrl": "."
56
}

0 commit comments

Comments
 (0)