Skip to content

Commit 61e358b

Browse files
Eslint v9
1 parent 30d97b5 commit 61e358b

File tree

3 files changed

+389
-199
lines changed

3 files changed

+389
-199
lines changed

eslint.config.mjs

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import globals from 'globals';
2+
import path from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
import reactPlugin from 'eslint-plugin-react';
5+
import jsxA11y from 'eslint-plugin-jsx-a11y';
6+
import pluginJs from '@eslint/js';
7+
import { includeIgnoreFile } from '@eslint/compat';
8+
9+
const __filename = fileURLToPath(import.meta.url);
10+
const __dirname = path.dirname(__filename);
11+
const gitignorePath = path.resolve(__dirname, '.gitignore');
12+
13+
export default [
14+
pluginJs.configs.recommended,
15+
reactPlugin.configs.flat.recommended,
16+
reactPlugin.configs.flat['jsx-runtime'],
17+
jsxA11y.flatConfigs.recommended,
18+
includeIgnoreFile(gitignorePath),
19+
{
20+
languageOptions: {
21+
globals: {
22+
...globals.browser,
23+
},
24+
sourceType: 'module',
25+
},
26+
27+
settings: {
28+
react: {
29+
version: 'detect',
30+
},
31+
},
32+
33+
rules: {
34+
'import/no-named-as-default': 0,
35+
'import/no-named-as-default-member': 0,
36+
'import/first': 0,
37+
38+
'react/prop-types': [
39+
2,
40+
{
41+
skipUndeclared: true,
42+
},
43+
],
44+
45+
'arrow-parens': [2, 'as-needed'],
46+
47+
'jsx-a11y/anchor-is-valid': [
48+
'error',
49+
{
50+
components: ['Link'],
51+
specialLink: ['to'],
52+
aspects: ['noHref', 'invalidHref', 'preferButton'],
53+
},
54+
],
55+
},
56+
},
57+
];

0 commit comments

Comments
 (0)