Skip to content

Commit

Permalink
Add eslint.config.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
ismailsunni committed Aug 12, 2024
1 parent e4d2885 commit 53531e5
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import prettier from "eslint-plugin-prettier";
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: ["node_modules/"],
}, ...compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
prettier,
},

languageOptions: {
globals: {
...globals.browser,
},

parser: tsParser,
ecmaVersion: 2020,
sourceType: "module",
},

rules: {
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-function": "off",

"@typescript-eslint/no-unused-vars": ["error", {
vars: "all",
args: "none",
}],

"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/ban-ts-comment": "off",
},
}];

0 comments on commit 53531e5

Please sign in to comment.