diff --git a/services/API-service/.eslintrc.js b/services/API-service/.eslintrc.js deleted file mode 100644 index 145d53f25..000000000 --- a/services/API-service/.eslintrc.js +++ /dev/null @@ -1,31 +0,0 @@ -module.exports = { - parser: '@typescript-eslint/parser', // Specifies the ESLint parser - extends: [ - 'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin - // 'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier - 'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array. - 'plugin:jest/recommended', - ], - parserOptions: { - ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features - sourceType: 'module', // Allows for the use of imports - }, - rules: { - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-var-requires': 'off', - '@typescript-eslint/no-unused-vars': [ - 'error', - { - varsIgnorePattern: '^_', - argsIgnorePattern: '^_', - }, - ], - '@typescript-eslint/camelcase': 'off', - 'prettier/prettier': [ - 'error', - { - endOfLine: 'auto', - }, - ], - }, -}; diff --git a/services/API-service/eslint.config.js b/services/API-service/eslint.config.js new file mode 100644 index 000000000..3020caee7 --- /dev/null +++ b/services/API-service/eslint.config.js @@ -0,0 +1,47 @@ +// @ts-check +const { FlatCompat } = require('@eslint/eslintrc'); +const typescriptEslintParser = require('@typescript-eslint/parser'); +const eslintPluginPrettier = require('eslint-plugin-prettier'); +const eslintPluginJest = require('eslint-plugin-jest'); +const tsEslintPlugin = require('@typescript-eslint/eslint-plugin'); + +const compat = new FlatCompat({ + baseDirectory: __dirname, +}); + +module.exports = [ + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features + sourceType: 'module', // Allows for the use of imports + parser: typescriptEslintParser, + }, + plugins: { + '@typescript-eslint': tsEslintPlugin, + prettier: eslintPluginPrettier, + jest: eslintPluginJest, + }, + rules: { + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + varsIgnorePattern: '^_', + argsIgnorePattern: '^_', + }, + ], + '@typescript-eslint/camelcase': 'off', + 'prettier/prettier': [ + 'error', + { + endOfLine: 'auto', + }, + ], + }, + }, + ...compat.extends('plugin:@typescript-eslint/recommended'), + ...compat.extends('plugin:prettier/recommended'), + ...compat.extends('plugin:jest/recommended'), +];