1+ import reduxSaga from "eslint-plugin-redux-saga" ;
2+ import react from "eslint-plugin-react" ;
3+ import jsxA11Y from "eslint-plugin-jsx-a11y" ;
4+ import importPlugin from "eslint-plugin-import" ;
5+ //import { fixupPluginRules } from "@eslint/compat";
6+ import globals from "globals" ;
7+ import babelParser from "@babel/eslint-parser" ;
8+ import path from "node:path" ;
9+ import { fileURLToPath } from "node:url" ;
10+ import js from "@eslint/js" ;
11+ import { FlatCompat } from "@eslint/eslintrc" ;
12+
13+ const __filename = fileURLToPath ( import . meta. url ) ;
14+ const __dirname = path . dirname ( __filename ) ;
15+
16+ const compat = new FlatCompat ( {
17+ baseDirectory : __dirname ,
18+ recommendedConfig : js . configs . recommended ,
19+ allConfig : js . configs . all
20+ } ) ;
21+
22+ export default [
23+ ...compat . extends ( "airbnb" ) ,
24+ {
25+ plugins : {
26+ "redux-saga" : reduxSaga ,
27+ react,
28+ "jsx-a11y" : jsxA11Y ,
29+ "import" : importPlugin ,
30+ } ,
31+
32+ languageOptions : {
33+ globals : {
34+ ...globals . browser ,
35+ ...globals . node ,
36+ ...globals . jest ,
37+ } ,
38+
39+ parser : babelParser ,
40+ ecmaVersion : "latest" ,
41+ sourceType : "module" ,
42+
43+ parserOptions : {
44+ ecmaFeatures : {
45+ jsx : true ,
46+ } ,
47+
48+ requireConfigFile : false ,
49+
50+ babelOptions : {
51+ presets : [ "@babel/preset-react" ] ,
52+ } ,
53+ } ,
54+ } ,
55+
56+ settings : {
57+ "import/resolver" : {
58+ webpack : {
59+ config : "./internals/webpack/webpack.prod.babel.js" ,
60+ } ,
61+ } ,
62+ "react" : {
63+ "version" : "detect"
64+ }
65+ } ,
66+
67+ rules : {
68+ "arrow-parens" : [ "error" , "always" ] ,
69+ "arrow-body-style" : [ 2 , "as-needed" ] ,
70+ camelcase : 0 ,
71+ "comma-dangle" : [ "error" , {
72+ arrays : 'always-multiline' ,
73+ objects : 'always-multiline' ,
74+ imports : 'always-multiline' ,
75+ exports : 'always-multiline' ,
76+ functions : 'only-multiline' ,
77+ } ] ,
78+ "import/imports-first" : 0 ,
79+ "import/newline-after-import" : 0 ,
80+ "import/no-dynamic-require" : 0 ,
81+ "import/no-extraneous-dependencies" : 0 ,
82+ "import/no-named-as-default" : 0 ,
83+ "import/no-unresolved" : 2 ,
84+ "import/prefer-default-export" : 0 ,
85+
86+ indent : [ 2 , 2 , {
87+ SwitchCase : 1 ,
88+ } ] ,
89+
90+ "jsx-a11y/aria-props" : 2 ,
91+ "jsx-a11y/heading-has-content" : 0 ,
92+ "jsx-a11y/label-has-for" : 2 ,
93+ "jsx-a11y/mouse-events-have-key-events" : 2 ,
94+ "jsx-a11y/role-has-required-aria-props" : 2 ,
95+ "jsx-a11y/role-supports-aria-props" : 2 ,
96+ "max-len" : 0 ,
97+ "newline-per-chained-call" : 0 ,
98+ "no-confusing-arrow" : 0 ,
99+ "no-console" : 1 ,
100+ "no-use-before-define" : 0 ,
101+
102+ "no-unused-vars" : "error" ,
103+
104+ "prefer-template" : 2 ,
105+ "class-methods-use-this" : 0 ,
106+ "react/forbid-prop-types" : 0 ,
107+ "react/jsx-first-prop-new-line" : [ 2 , "multiline" ] ,
108+ "react/jsx-filename-extension" : 0 ,
109+ "react/jsx-no-target-blank" : 0 ,
110+
111+ "react/jsx-uses-react" : "error" ,
112+ "react/jsx-uses-vars" : "error" ,
113+
114+ "react/no-array-index-key" : 0 ,
115+ "react/require-default-props" : 0 ,
116+ "react/require-extension" : 0 ,
117+ "react/destructuring-assignment" : 0 ,
118+ "react/self-closing-comp" : 0 ,
119+ "react/sort-comp" : 0 ,
120+ "redux-saga/no-yield-in-race" : 2 ,
121+ "redux-saga/yield-effects" : 2 ,
122+ "require-yield" : 0 ,
123+ "import/no-webpack-loader-syntax" : 0 ,
124+ } ,
125+ } ] ;
0 commit comments