diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e019f3c..0000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ - -main.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 0807290..0000000 --- a/.eslintrc +++ /dev/null @@ -1,23 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "env": { "node": true }, - "plugins": [ - "@typescript-eslint" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" - ], - "parserOptions": { - "sourceType": "module" - }, - "rules": { - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], - "@typescript-eslint/ban-ts-comment": "off", - "no-prototype-builtins": "off", - "@typescript-eslint/no-empty-function": "off" - } - } \ No newline at end of file diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..fc6f790 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,25 @@ +const typescriptEslintParser = require("@typescript-eslint/parser"); +const typescriptEslintPlugin = require("@typescript-eslint/eslint-plugin"); + +module.exports = [ + { + ignores: ["node_modules", "main.js"], // Ignoring the default generated files and directories + }, + { + files: ["**/*.ts"], // Apply the configuration to TypeScript files + languageOptions: { + parser: typescriptEslintParser, + ecmaVersion: "latest", // Always using the latest ECMAScript version + sourceType: "module", // Modern JavaScript uses module import/export syntax + }, + plugins: { + "@typescript-eslint": typescriptEslintPlugin, // Using TypeScript-specific plugin + }, + rules: { + "@typescript-eslint/no-unused-vars": ["error", { "args": "none" }], // Replacing 'no-unused-vars' with TS-specific version + "@typescript-eslint/ban-ts-comment": "off", // Allowing use of ts comments if needed + "@typescript-eslint/no-empty-function": "off", // Allowing empty functions for flexibility + "no-prototype-builtins": "off", // Allowing direct calls to object's prototype functions + }, + }, +];