NEAR MCP

by nearai
Verified
import typescriptEslint from '@typescript-eslint/eslint-plugin'; import simpleImportSort from 'eslint-plugin-simple-import-sort'; 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 [ // Ignore patterns { ignores: [ 'prettier.config.cjs', 'eslint.config.mjs', 'node_modules/**', '.next/**', 'dist/**', 'build/**', 'out/**', '.near-keystore/**' ] }, ...compat.extends( 'prettier', 'plugin:@typescript-eslint/recommended-type-checked', 'plugin:@typescript-eslint/stylistic-type-checked', ), { plugins: { '@typescript-eslint': typescriptEslint, 'simple-import-sort': simpleImportSort, }, languageOptions: { parser: tsParser, ecmaVersion: 5, sourceType: 'script', parserOptions: { project: './tsconfig.json', EXPERIMENTAL_useProjectService: true, }, }, rules: { '@typescript-eslint/prefer-nullish-coalescing': 'off', '@typescript-eslint/no-unnecessary-type-assertion': 'off', '@typescript-eslint/array-type': 'off', '@typescript-eslint/consistent-type-definitions': 'off', '@typescript-eslint/consistent-type-imports': [ 'warn', { prefer: 'type-imports', fixStyle: 'inline-type-imports', }, ], '@typescript-eslint/no-unused-vars': [ 'warn', { args: 'all', argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_', }, ], '@typescript-eslint/require-await': 'off', '@typescript-eslint/no-misused-promises': [ 'error', { checksVoidReturn: { arguments: false, attributes: false, }, }, ], '@typescript-eslint/no-empty-interface': [ 'error', { allowSingleExtends: true, }, ], 'simple-import-sort/imports': 'warn', }, } ];