Skip to content

Commit 195088c

Browse files
chore: eslint config setup
1 parent a53a225 commit 195088c

7 files changed

Lines changed: 365 additions & 287 deletions

File tree

eslint.config.mjs

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,45 @@
1-
import js from "@eslint/js";
21
import globals from "globals";
2+
import pluginJs from "@eslint/js";
33
import tseslint from "typescript-eslint";
4-
import { defineConfig } from "eslint/config";
4+
import unusedImports from "eslint-plugin-unused-imports";
55

6-
export default defineConfig([
7-
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"] },
8-
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.browser } },
9-
tseslint.configs.recommended,
10-
]);
6+
export default [
7+
{
8+
files: ["**/*.ts", "**/*.js"],
9+
languageOptions: {
10+
globals: globals.node,
11+
},
12+
},
13+
pluginJs.configs.recommended,
14+
...tseslint.configs.recommended,
15+
{
16+
plugins: {
17+
"unused-imports": unusedImports,
18+
},
19+
rules: {
20+
// Set the rule severity to "warn" (or 1) for explicit any types
21+
"@typescript-eslint/no-explicit-any": "warn",
22+
23+
// Disable the core ESLint and TypeScript no-unused-vars rules
24+
"no-unused-vars": "off",
25+
"@typescript-eslint/no-unused-vars": "off",
26+
27+
// Use the correct rule names from the unused-imports plugin
28+
"unused-imports/no-unused-imports": "error",
29+
"unused-imports/no-unused-vars": [
30+
"warn",
31+
{
32+
vars: "all",
33+
varsIgnorePattern: "^_",
34+
args: "after-used",
35+
argsIgnorePattern: "^_",
36+
},
37+
],
38+
// Standard ESLint rules from the built-in configs are available
39+
"no-console": "warn",
40+
"no-undef": "error",
41+
"no-unused-expressions": "error",
42+
"no-unused-labels": "error",
43+
},
44+
},
45+
];

package.json

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
"description": "Node.js SDK for Plane API",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
7+
"files": [
8+
"dist/**/*",
9+
"README.md"
10+
],
711
"scripts": {
812
"build": "tsc",
913
"dev": "tsc --watch",
1014
"test": "ts-node tests/run-all.test.ts",
11-
"lint": "eslint src/**/*.ts",
12-
"format": "prettier --write src/**/*.ts",
13-
"clean": "rm -rf dist"
15+
"clean": "rm -rf dist && rm -rf node_modules",
16+
"check:lint": "eslint src/**/*.ts",
17+
"fix:lint": "eslint src/**/*.ts --fix",
18+
"check:format": "prettier --check src/**/*.ts",
19+
"fix:format": "prettier --write src/**/*.ts"
1420
},
1521
"keywords": [
1622
"plane",
@@ -26,22 +32,22 @@
2632
"ts-jest": "^29.4.4"
2733
},
2834
"devDependencies": {
35+
"@eslint/js": "^9.38.0",
2936
"@types/jest": "^29.0.0",
3037
"@types/node": "^20.0.0",
31-
"@typescript-eslint/eslint-plugin": "^6.0.0",
32-
"@typescript-eslint/parser": "^6.0.0",
33-
"eslint": "^8.0.0",
38+
"@typescript-eslint/eslint-plugin": "^8.46.2",
39+
"@typescript-eslint/parser": "^8.46.2",
40+
"eslint": "9.38.0",
41+
"eslint-plugin-unused-imports": "^4.3.0",
42+
"globals": "^16.4.0",
3443
"jest": "^29.0.0",
35-
"prettier": "^3.0.0",
44+
"prettier": "3.6.2",
3645
"ts-node": "^10.9.0",
37-
"typescript": "^5.0.0"
46+
"typescript": "5.9.3",
47+
"typescript-eslint": "^8.46.2"
3848
},
39-
"files": [
40-
"dist/**/*",
41-
"README.md"
42-
],
43-
"packageManager": "pnpm@10.19.0",
49+
"packageManager": "pnpm@10.20.0+sha512.cf9998222162dd85864d0a8102e7892e7ba4ceadebbf5a31f9c2fce48dfce317a9c53b9f6464d1ef9042cba2e02ae02a9f7c143a2b438cd93c91840f0192b9dd",
4450
"engines": {
45-
"node": ">=16.0.0"
51+
"node": ">=20.0.0"
4652
}
4753
}

0 commit comments

Comments
 (0)