Skip to content

Commit

Permalink
feat: migrate eslintrc
Browse files Browse the repository at this point in the history
  • Loading branch information
LhonRafaat committed Sep 25, 2024
1 parent 1c5718c commit dd9c7b2
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
62 changes: 62 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [{
ignores: [
"**/lib",
"**/node_modules",
"**/.eslintrc.cjs",
"**/vitest.config.ts",
"**/.eslintrc.js",
"**/test",
],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"eslint-config-prettier",
"prettier",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
globals: {
...globals.node,
...globals.jest,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "commonjs",

parserOptions: {
project: ["./tsconfig.json"],
},
},

rules: {
"@typescript-eslint/adjacent-overload-signatures": "error",

"@typescript-eslint/array-type": ["error", {
default: "generic",
}],

"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/class-literal-property-style": "error",
"@typescript-eslint/explicit-function-return-type": "error",
},
}];
1 change: 0 additions & 1 deletion src/cron.provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { createCron } from "./utils";
import { CronJob } from "cron";
import cronDB from "./db/cron.db";
import { EXPRESSOTS_CRON } from "./constants";
/* eslint-disable @typescript-eslint/no-explicit-any */

@injectable()
export class CronProvider implements IProvider, ICron {
Expand Down

0 comments on commit dd9c7b2

Please sign in to comment.