-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy patheslint.config.js
More file actions
33 lines (32 loc) · 1.12 KB
/
Copy patheslint.config.js
File metadata and controls
33 lines (32 loc) · 1.12 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
// Flat ESLint config: TS + Astro + islands (React hooks, a11y).
// Formatting is Prettier's job — no stylistic rules here.
import tseslint from 'typescript-eslint'
import astro from 'eslint-plugin-astro'
import jsxA11y from 'eslint-plugin-jsx-a11y'
import reactHooks from 'eslint-plugin-react-hooks'
export default tseslint.config(
{
ignores: ['dist/', '.astro/', '.yarn/', 'screenshots/'],
},
...tseslint.configs.recommended,
...astro.configs.recommended,
{
files: ['**/*.tsx'],
plugins: { 'jsx-a11y': jsxA11y, 'react-hooks': reactHooks },
rules: {
...jsxA11y.flatConfigs.recommended.rules,
...reactHooks.configs.recommended.rules,
},
},
{
rules: {
// `_`-prefixed args are intentionally unused (express middleware etc.)
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
},
{
// Astro generates this file with a triple-slash reference — leave it be.
files: ['src/env.d.ts'],
rules: { '@typescript-eslint/triple-slash-reference': 'off' },
},
)