coffee-core
Version:
Coffee IT API core library
130 lines (123 loc) • 3.52 kB
JavaScript
/* eslint-disable no-underscore-dangle */
/* eslint-disable @typescript-eslint/no-require-imports */
const { defineConfig } = require('eslint/config');
const tsParser = require('@typescript-eslint/parser');
const typescriptEslintEslintPlugin = require('@typescript-eslint/eslint-plugin');
const _import = require('eslint-plugin-import');
const prettier = require('eslint-plugin-prettier');
const { fixupPluginRules } = require('@eslint/compat');
const globals = require('globals');
const js = require('@eslint/js');
const { FlatCompat } = require('@eslint/eslintrc');
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
module.exports = defineConfig([
...compat.extends(
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
),
{
languageOptions: {
parser: tsParser,
sourceType: 'module',
ecmaVersion: 'latest',
parserOptions: {
project: 'tsconfig.json',
},
globals: {
...globals.node,
...globals.jest,
...globals.browser,
},
},
plugins: {
'@typescript-eslint': typescriptEslintEslintPlugin,
import: fixupPluginRules(_import),
prettier: fixupPluginRules(prettier),
},
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_|err',
varsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
},
],
'no-restricted-imports': [
'error',
{
patterns: ['**/-service/**', '**/-gateway/**', '**/dist/**'],
},
],
'no-console': ['warn'],
'max-len': [
'warn',
{
code: 200,
},
],
'comma-dangle': ['error', 'always-multiline'],
camelcase: ['off'],
'import/no-extraneous-dependencies': ['off'],
'no-new': ['off'],
'lines-between-class-members': [
'error',
'always',
{
exceptAfterSingleLine: true,
},
],
'object-curly-newline': ['off'],
'import/no-absolute-path': ['off'],
'no-multiple-empty-lines': [
'error',
{
max: 1,
maxEOF: 0,
},
],
'import/prefer-default-export': ['off'],
'@typescript-eslint/no-use-before-define': ['off'],
'consistent-return': ['off'],
'object-shorthand': ['off'],
'prefer-exponentiation-operator': ['off'],
'no-restricted-properties': ['off'],
'no-param-reassign': [
'error',
{
props: false,
},
],
'arrow-body-style': ['off'],
'no-shadow': ['off'],
'@typescript-eslint/no-shadow': ['error'],
'import/no-useless-path-segments': ['off'],
'max-classes-per-file': ['off'],
'no-underscore-dangle': [
'error',
{
allow: ['_id'],
},
],
'@typescript-eslint/indent': ['off'],
indent: ['off'],
'@typescript-eslint/no-empty-object-type': ['off'],
},
settings: {
'import/resolver': {
typescript: {},
},
},
},
]);