diff --git a/eslint.config.mjs b/eslint.config.mjs index ace1883..aee750d 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,58 +1,64 @@ -import typescriptEslint from "@typescript-eslint/eslint-plugin"; -import prettier from "eslint-plugin-prettier"; -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); +import typescriptEslint from '@typescript-eslint/eslint-plugin' +import prettier from 'eslint-plugin-prettier' +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 [...compat.extends( - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-type-checked", - "plugin:@typescript-eslint/stylistic-type-checked", - "prettier", -), { + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) + +export default [ + ...compat.extends( + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-type-checked', + 'plugin:@typescript-eslint/stylistic-type-checked', + 'prettier', + ), + { plugins: { - "@typescript-eslint": typescriptEslint, - prettier, + '@typescript-eslint': typescriptEslint, + prettier, }, languageOptions: { - parser: tsParser, - ecmaVersion: 5, - sourceType: "script", + parser: tsParser, + ecmaVersion: 5, + sourceType: 'script', - parserOptions: { - tsconfigRootDir: "/home/cdiesh/src/gmod/vcf-js", - project: "./tsconfig.lint.json", - }, + parserOptions: { + project: './tsconfig.lint.json', + }, }, rules: { - curly: "error", - - "@typescript-eslint/no-unused-vars": ["warn", { - argsIgnorePattern: "^_", - ignoreRestSiblings: true, - }], - - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-this-alias": "off", - "@typescript-eslint/no-unsafe-member-access": "off", - "@typescript-eslint/no-unsafe-argument": "off", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unsafe-assignment": "off", - "@typescript-eslint/no-unsafe-call": "off", - "@typescript-eslint/no-unsafe-return": "off", - "prettier/prettier": "error", + curly: 'error', + + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + ignoreRestSiblings: true, + }, + ], + + '@typescript-eslint/ban-ts-comment': 'off', + '@typescript-eslint/no-this-alias': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + 'prettier/prettier': 'error', }, -}]; \ No newline at end of file + }, +] +