Skip to content

Commit

Permalink
Fix eslint.config.mts
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Aug 27, 2024
1 parent a80ddd2 commit 46238ff
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions packages/configs/eslint/src/eslint.config.mts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import js from '@eslint/js'
import type { TSESLint } from '@typescript-eslint/utils'
import prettierConfig from 'eslint-config-prettier'
import globals from 'globals'
import type { ConfigWithExtends } from 'typescript-eslint'
import { config, configs, parser, plugin } from 'typescript-eslint'

const { browser, node, nodeBuiltin } = globals
import { config, configs, parser } from 'typescript-eslint'

/**
* Represents the global variables provided by Vitest.
Expand Down Expand Up @@ -84,22 +81,16 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
languageOptions: {
globals: {
...vitestGlobals,
...nodeBuiltin,
...browser,
...node,
},
parser,
parserOptions: {
projectService: {
allowDefaultProject: ['./*.?(m|c)[tj]s?(x)'],
defaultProject: './tsconfig.json',
},
project: ['./tsconfig.json'],
ecmaVersion: 'latest',
},
},
rules: {
'prefer-const': [2],
'no-undef': [0],
'@typescript-eslint/consistent-type-imports': [
2,
Expand All @@ -109,15 +100,20 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
'@typescript-eslint/no-unused-vars': [0],
'@typescript-eslint/array-type': [2, { default: 'array-simple' }],
'@typescript-eslint/no-explicit-any': [0],
'@typescript-eslint/no-empty-interface': [
'@typescript-eslint/no-empty-object-type': [
2,
{ allowSingleExtends: true },
{ allowInterfaces: 'with-single-extends' },
],
'@typescript-eslint/no-restricted-types': [
2,
{
types: {
'{}': {
suggest: ['AnyNonNullishValue', 'EmptyObject', 'AnyObject'],
},
},
},
],
'@typescript-eslint/no-unsafe-argument': [0],
'@typescript-eslint/no-restricted-types': [2],
'@typescript-eslint/no-empty-object-type': [2],
'@typescript-eslint/no-unsafe-function-type': [2],
'@typescript-eslint/no-wrapper-object-types': [2],
'@typescript-eslint/no-namespace': [
2,
{ allowDeclarations: true, allowDefinitionFiles: true },
Expand All @@ -135,7 +131,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
},
],
},
plugins: { '@typescript-eslint': plugin },
linterOptions: { reportUnusedDisableDirectives: 2 },
},
{
Expand All @@ -146,11 +141,6 @@ export const reduxESLintConfig: TSESLint.FlatConfig.Config[] = config(
'@typescript-eslint/no-require-imports': [0],
},
},
{
name: 'typescript-declaration-files',
files: ['**/*.d.?(c|m)ts'],
rules: { '@typescript-eslint/no-empty-object-type': [0] },
},
)

/**
Expand Down

0 comments on commit 46238ff

Please sign in to comment.