Skip to content

Commit 139a580

Browse files
authored
Add eslint (#99)
1 parent fa6e105 commit 139a580

File tree

4 files changed

+800
-1
lines changed

4 files changed

+800
-1
lines changed

eslint.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import js from "@eslint/js";
2+
import globals from "globals";
3+
import tseslint from "typescript-eslint";
4+
import { defineConfig } from "eslint/config";
5+
6+
7+
export default defineConfig([
8+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"] },
9+
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.browser } },
10+
tseslint.configs.recommended,
11+
]);

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,25 @@
66
"scripts": {
77
"clean": "rm -rf .nyc_output coverage dist",
88
"test": "nyc mocha 'src/**/*.test.ts' --require=tsx",
9+
"lint": "eslint 'src/**/*.ts'",
910
"coverage": "nyc report --reporter html && open coverage/index.html",
1011
"coverage:check": "nyc check-coverage --lines 90 --branches 80 --statements 90"
1112
},
1213
"packageManager": "[email protected]",
1314
"devDependencies": {
15+
"@eslint/js": "^9.31.0",
1416
"@types/chai": "^5.2.2",
1517
"@types/mocha": "^10.0.10",
1618
"@types/sinon": "^17.0.4",
1719
"chai": "^5.2.1",
20+
"eslint": "^9.31.0",
21+
"globals": "^16.3.0",
1822
"mocha": "^11.7.1",
1923
"nyc": "^17.1.0",
2024
"sinon": "^21.0.0",
2125
"tsx": "^4.20.3",
22-
"typescript": "^5.8.3"
26+
"typescript": "^5.8.3",
27+
"typescript-eslint": "^8.37.0"
2328
},
2429
"repository": {
2530
"type": "git",

0 commit comments

Comments
 (0)