1- import { defineConfig } from 'eslint/config' ;
21import globals from 'globals' ;
2+ import * as js from '@eslint/js' ;
3+ import prettierPlugin from 'eslint-plugin-prettier' ;
4+ import * as prettierConfig from 'eslint-config-prettier' ;
35import path from 'node:path' ;
46import { fileURLToPath } from 'node:url' ;
5- import jsxA11y from 'eslint-plugin-jsx-a11y' ;
6- import * as airbnbExtendedModule from 'eslint-config-airbnb-extended' ;
77
88const __filename = fileURLToPath ( import . meta. url ) ;
99const __dirname = path . dirname ( __filename ) ;
1010
11- export default defineConfig ( [
11+ export default [
1212 {
13- ...( airbnbExtendedModule . default || [ ] ) ,
13+ ...( js . configs && js . configs . recommended ? js . configs . recommended : { } ) ,
1414
1515 languageOptions : {
1616 globals : {
@@ -23,11 +23,17 @@ export default defineConfig([
2323 } ,
2424 } ,
2525
26- plugins : {
27- 'jsx-a11y' : jsxA11y , // Explicitly define the plugin namespace
28- } ,
26+ plugins : { prettier : prettierPlugin } ,
2927
3028 rules : {
29+ ...( prettierConfig &&
30+ prettierConfig . configs &&
31+ prettierConfig . configs . recommended &&
32+ prettierConfig . configs . recommended . rules
33+ ? prettierConfig . configs . recommended . rules
34+ : { } ) ,
35+ 'prettier/prettier' : 'error' ,
36+
3137 'no-use-before-define' : 0 ,
3238 'func-names' : 0 ,
3339 'prefer-arrow-callback' : 0 ,
@@ -39,17 +45,9 @@ export default defineConfig([
3945 'prefer-template' : 0 ,
4046 'import/no-amd' : 0 ,
4147 'space-before-function-paren' : 0 ,
42- 'jsx-a11y/href-no-hash' : 'off' ,
43-
44- 'jsx-a11y/anchor-is-valid' : [
45- 'warn' ,
46- {
47- aspects : [ 'invalidHref' ] ,
48- } ,
49- ] ,
5048
5149 'import/no-unresolved' : 0 ,
5250 'import/extensions' : 0 ,
5351 } ,
5452 } ,
55- ] ) ;
53+ ] ;
0 commit comments