Skip to content

Commit

Permalink
chore: upgrade eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nihalgonsalves committed Aug 9, 2024
1 parent 70ab96f commit 6161ec7
Show file tree
Hide file tree
Showing 7 changed files with 394 additions and 367 deletions.
10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ updates:
- dependency-name: "@types/node"
update-types:
- "version-update:semver-major"
- dependency-name: "eslint"
update-types:
- "version-update:semver-major"

- package-ecosystem: github-actions
directory: "/"
Expand Down
2 changes: 0 additions & 2 deletions bin/test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-env node */

// eslint-disable-next-line @typescript-eslint/no-var-requires
const { PostgresError } = require("../dist");

Expand Down
41 changes: 41 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { fixupConfigRules } = require("@eslint/compat");
const { FlatCompat } = require("@eslint/eslintrc");
const js = require("@eslint/js");
const tseslint = require("typescript-eslint");

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
});

module.exports = tseslint.config(
{ ignores: ["dist"] },
// @ts-expect-error type mismatch
...fixupConfigRules(
compat.extends("./node_modules/@nihalgonsalves/esconfig/.eslintrc"),
),
{
languageOptions: {
parserOptions: {
project: undefined,
projectService: true,
},
},
rules: {
"@typescript-eslint/no-duplicate-enum-values": "off",
"@typescript-eslint/restrict-template-expressions": [
"error",
{ allowNumber: true },
],
"import/no-extraneous-dependencies": [
"error",
{
devDependencies: ["**/*.test.{js,jsx,ts,tsx}", "eslint.config.js"],
},
],
// typescript
"no-undef": "off",
},
},
);
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"clean": "rm -rf ./dist/",
"typecheck": "tsc --noEmit --project tsconfig.json && tsc --noEmit --project tsconfig.build.json",
"build": "tsc --build tsconfig.build.json",
"lint:check": "eslint --report-unused-disable-directives ./src/ ./bin/ --ext .js,.ts,.jsx,.tsx,.mjs,.mts,.cjs,.cts",
"lint:check": "eslint",
"format:check": "prettier . --check",
"format:write": "prettier . --write",
"test": "node bin/test.js",
Expand All @@ -30,16 +30,20 @@
"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",
"@types/node": "^18",
"@typescript-eslint/eslint-plugin": "^8.0.0",
"@typescript-eslint/parser": "^8.0.0",
"eslint": "^8.57.0",
"eslint": "^9.8.0",
"eslint-plugin-import": "^2.29.1",
"lefthook": "^1.7.11",
"prettier": "^3.3.3",
"tsx": "^4.16.5",
"tsx": "^4.17.0",
"typescript": "^5.5.4",
"typescript-eslint": "^8.0.1",
"zod": "^3.23.8"
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
"verbatimModuleSyntax": false,
"allowJs": true,
"checkJs": true,
"skipLibCheck": true,
"outDir": "./dist",
"types": ["node"]
},
"files": ["bin/sync.ts", "bin/test.js"]
"files": ["bin/sync.ts", "bin/test.js", "eslint.config.js"]
}
Loading

0 comments on commit 6161ec7

Please sign in to comment.