Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
51 lines (47 loc) · 1.62 KB
/
Copy patheslint.config.js
File metadata and controls
51 lines (47 loc) · 1.62 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { fileURLToPath } from 'node:url'
import { includeIgnoreFile } from '@eslint/compat'
import js from '@eslint/js'
import stylistic from '@stylistic/eslint-plugin'
import { defineConfig } from 'eslint/config'
import jsdoc from 'eslint-plugin-jsdoc'
import reactDom from 'eslint-plugin-react-dom'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import reactX from 'eslint-plugin-react-x'
import simpleImportSort from 'eslint-plugin-simple-import-sort'
import globals from 'globals'
import tseslint from 'typescript-eslint'
const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url))
export default defineConfig([
includeIgnoreFile(gitignorePath, 'Imported .gitignore patterns'),
{
files: ['**/*.{ts,tsx,js}'],
plugins: { js, '@stylistic': stylistic },
extends: ['js/recommended'],
languageOptions: { globals: { ...globals.browser, ...globals.node } },
},
tseslint.configs.recommended,
stylistic.configs.recommended,
jsdoc.configs['flat/recommended-error'],
reactHooks.configs.flat['recommended-latest'],
reactRefresh.configs.vite,
reactX.configs['recommended-typescript'],
reactDom.configs.recommended,
{
files: ['**/*.{ts,tsx,js}'],
plugins: { 'simple-import-sort': simpleImportSort, jsdoc },
rules: {
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'jsdoc/require-yields-type': 'off',
'jsdoc/require-param-type': 'off',
'jsdoc/require-returns-type': 'off',
},
},
{
files: ['tests/*.ts'],
rules: {
'jsdoc/require-jsdoc': 'off',
},
},
])