Skip to content

Commit

Permalink
chore: use esconfig with native eslint v9 (#537)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihalgonsalves authored Aug 9, 2024
1 parent d2fd917 commit 4164087
Show file tree
Hide file tree
Showing 9 changed files with 491 additions and 596 deletions.
1 change: 1 addition & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ jobs:
yarn typecheck
yarn lint:check
yarn format:check
yarn knip
yarn sync
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion bin/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
// eslint-disable-next-line @typescript-eslint/no-require-imports
const { PostgresError } = require("../dist");

const main = () => {
Expand Down
41 changes: 0 additions & 41 deletions eslint.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import tseslint from "typescript-eslint";

// eslint-disable-next-line import/extensions
import sharedConfig from "@nihalgonsalves/esconfig/eslint.config.shared.js";

export default tseslint.config({ ignores: ["dist"] }, ...sharedConfig, {
rules: {
"@typescript-eslint/no-duplicate-enum-values": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{ allowNumber: true },
],
},
});
5 changes: 5 additions & 0 deletions knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"entry": ["src/index.ts!"],
"project": ["**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}"],
}
13 changes: 4 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"homepage": "https://github.com/nihalgonsalves/pg-error-enum#readme",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"packageManager": "yarn@4.2.2+sha512.c44e283c54e02de9d1da8687025b030078c1b9648d2895a65aab8e64225bfb7becba87e1809fc0b4b6778bbd47a1e2ab6ac647de4c5e383a53a7c17db6c3ff4b",
"packageManager": "yarn@4.4.0+sha512.91d93b445d9284e7ed52931369bc89a663414e5582d00eea45c67ddc459a2582919eece27c412d6ffd1bd0793ff35399381cb229326b961798ce4f4cc60ddfdb",
"scripts": {
"sync": "tsx bin/sync.ts",
"clean": "rm -rf ./dist/",
Expand All @@ -30,16 +30,11 @@
"dist/**/*"
],
"devDependencies": {
"@eslint/compat": "^1.1.1",
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.8.0",
"@nihalgonsalves/esconfig": "^0.9.22",
"@types/eslint__eslintrc": "^2.1.2",
"@types/eslint__js": "^8.42.3",
"@nihalgonsalves/esconfig": "^0.10.2",
"@types/node": "^18",
"eslint": "^9.8.0",
"eslint-plugin-import": "^2.29.1",
"lefthook": "^1.7.11",
"knip": "^5.27.2",
"lefthook": "^1.7.12",
"prettier": "^3.3.3",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
Expand Down
10 changes: 8 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@nihalgonsalves/esconfig",
"extends": "@nihalgonsalves/esconfig/tsconfig.shared.json",
"compilerOptions": {
"target": "es2020",
// TODO: Also publish as ES Module?
Expand All @@ -12,5 +12,11 @@
"outDir": "./dist",
"types": ["node"]
},
"files": ["bin/sync.ts", "bin/test.js", "eslint.config.js"]
"files": [
"src/index.ts",
"src/PostgresError.ts",
"bin/sync.ts",
"bin/test.js",
"eslint.config.mjs"
]
}
Loading

0 comments on commit 4164087

Please sign in to comment.