-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
34 lines (32 loc) · 922 Bytes
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import typescriptParser from '@typescript-eslint/parser'
import js from '@eslint/js'
import jest from 'eslint-plugin-jest'
import tseslint from 'typescript-eslint'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
// Following this article: https://www.raulmelo.me/en/blog/migration-eslint-to-flat-config
export default tseslint.config(
{
ignores: ['dist/**', 'node_modules/**'],
},
js.configs.recommended,
{
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: typescriptParser,
globals: {
document: 'readonly',
},
},
rules: {
'no-console': ['error', { allow: ['warn', 'error'] }],
},
},
{
files: ['**/*.{test,spec}.tsx?'],
...jest.configs['flat/recommended'],
},
...tseslint.configs.recommended,
eslintPluginPrettierRecommended,
)