Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
name: Publish Node SDK to npm
name: Build and Test Node SDK

on:
pull_request:
branches:
- main

types: ["opened", "synchronize", "reopened"]
jobs:
build:
build-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4

- name: Enable corepack
run: corepack enable pnpm

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Run lint
run: pnpm run check:lint

- name: Run format
run: pnpm run check:format

- name: Run build
run: pnpm run build

- name: Run tests
run: pnpm run test
49 changes: 42 additions & 7 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,10 +1,45 @@
import js from "@eslint/js";
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import { defineConfig } from "eslint/config";
import unusedImports from "eslint-plugin-unused-imports";

export default defineConfig([
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], plugins: { js }, extends: ["js/recommended"] },
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts}"], languageOptions: { globals: globals.browser } },
tseslint.configs.recommended,
]);
export default [
{
files: ["**/*.ts", "**/*.js"],
languageOptions: {
globals: globals.node,
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
"unused-imports": unusedImports,
},
rules: {
// Set the rule severity to "warn" (or 1) for explicit any types
"@typescript-eslint/no-explicit-any": "warn",

// Disable the core ESLint and TypeScript no-unused-vars rules
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",

// Use the correct rule names from the unused-imports plugin
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
vars: "all",
varsIgnorePattern: "^_",
args: "after-used",
argsIgnorePattern: "^_",
},
],
// Standard ESLint rules from the built-in configs are available
"no-console": "warn",
"no-undef": "error",
"no-unused-expressions": "error",
"no-unused-labels": "error",
},
},
];
34 changes: 20 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"description": "Node.js SDK for Plane API",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist/**/*",
"README.md"
],
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
Expand All @@ -13,9 +17,11 @@
"test:all": "pnpm test:unit && pnpm test:e2e",
"test:watch": "jest --watch",
"test:coverage": "jest --coverage",
"lint": "eslint src/**/*.ts",
"format": "prettier --write src/**/*.ts",
"clean": "rm -rf dist"
"clean": "rm -rf dist && rm -rf node_modules",
"check:lint": "eslint src/**/*.ts",
"fix:lint": "eslint src/**/*.ts --fix",
"check:format": "prettier --check src/**/*.ts",
"fix:format": "prettier --write src/**/*.ts"
},
"keywords": [
"plane",
Expand All @@ -31,22 +37,22 @@
"ts-jest": "^29.4.4"
},
"devDependencies": {
"@eslint/js": "^9.38.0",
"@types/jest": "^29.0.0",
"@types/node": "^20.0.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"eslint": "^8.0.0",
"@typescript-eslint/eslint-plugin": "^8.46.2",
"@typescript-eslint/parser": "^8.46.2",
"eslint": "9.38.0",
"eslint-plugin-unused-imports": "^4.3.0",
"globals": "^16.4.0",
"jest": "^29.0.0",
"prettier": "^3.0.0",
"prettier": "3.6.2",
"ts-node": "^10.9.0",
"typescript": "^5.0.0"
"typescript": "5.9.3",
"typescript-eslint": "^8.46.2"
},
"files": [
"dist/**/*",
"README.md"
],
"packageManager": "pnpm@10.19.0",
"packageManager": "pnpm@10.20.0",
"engines": {
"node": ">=16.0.0"
"node": ">=20.0.0"
}
}
Loading