@@ -5,6 +5,7 @@ import prettierExtends from "eslint-config-prettier";
55import { fixupPluginRules } from "@eslint/compat" ;
66import globals from "globals" ;
77import tseslint from "typescript-eslint" ;
8+ import promisePlugin from "eslint-plugin-promise" ;
89
910const globalToUse = {
1011 ...globals . browser ,
@@ -14,64 +15,64 @@ const globalToUse = {
1415 ...globals . node ,
1516} ;
1617
17- export default tseslint . config ( {
18- extends : [
19- {
20- ignores : [
21- "client/cypress/plugins/index.js" ,
22- ".lintstagedrc.js" ,
23- ".next/**/*" ,
24- "public/js/*" ,
25- ".yarn/js/*" ,
26- "ui/out/**/*" ,
27- "apps/expo/ios/**/*" ,
28- "apps/expo/android/**/*" ,
29- "electron/build/**/*" ,
30- "public/*.js" ,
31- "public/*.map" ,
18+ const ignores = [
19+ ".lintstagedrc.js" ,
20+ "**/.yarn/**/*" ,
21+ "**/dist/**/*" ,
22+ "public/js/*" ,
23+ ".yarn/js/*" ,
24+ "dist/**/*" ,
25+ "coverage/**/*" ,
26+ ] ;
27+ /** @type {import('@typescript-eslint/utils').FlatConfig.ConfigArray } */
28+ const configs = tseslint . config (
29+ {
30+ ignores,
31+
32+ extends : [
33+ eslint . configs . recommended ,
34+ ...tseslint . configs . recommended ,
35+ promisePlugin . configs [ "flat/recommended" ] ,
36+ prettierExtends ,
37+ ] ,
38+ plugins : {
39+ promise : promisePlugin ,
40+ prettierPlugin,
41+ "unused-imports" : fixupPluginRules ( unusedImportsPlugin ) ,
42+ } ,
43+ rules : {
44+ "prefer-rest-params" : "off" ,
45+ "prefer-const" : "error" ,
46+ "prefer-spread" : "off" ,
47+ "no-case-declarations" : "off" ,
48+ curly : [ "error" , "all" ] ,
49+ "@typescript-eslint/no-non-null-assertion" : "off" ,
50+ "@typescript-eslint/consistent-type-definitions" : [ "error" , "interface" ] ,
51+ "@typescript-eslint/consistent-type-imports" : [
52+ "error" ,
53+ {
54+ prefer : "type-imports" ,
55+ } ,
3256 ] ,
57+ "@typescript-eslint/ban-ts-comment" : "off" ,
58+ "@typescript-eslint/no-explicit-any" : "off" ,
59+ "@typescript-eslint/no-use-before-define" : [ "off" ] ,
60+ "object-shorthand" : "error" ,
61+ "@typescript-eslint/no-unused-vars" : [
62+ "warn" ,
63+ { varsIgnorePattern : "^_" , argsIgnorePattern : "^_" , ignoreRestSiblings : true } ,
64+ ] ,
65+ "unused-imports/no-unused-imports" : "error" ,
3366 } ,
34- prettierExtends ,
35- eslint . configs . recommended ,
36- ...tseslint . configs . recommended ,
37- ] ,
38- settings : {
39- react : { version : "detect" } ,
40- } ,
41- plugins : {
42- prettierPlugin,
43- "unused-imports" : fixupPluginRules ( unusedImportsPlugin ) ,
44- } ,
45- rules : {
46- "prefer-rest-params" : "off" ,
47- "prefer-const" : "error" ,
48- "prefer-spread" : "off" ,
49- "no-case-declarations" : "off" ,
50- curly : [ "error" , "all" ] ,
51- "@typescript-eslint/no-non-null-assertion" : "off" ,
52- "@typescript-eslint/consistent-type-definitions" : [ "error" , "interface" ] ,
53- "@typescript-eslint/consistent-type-imports" : [
54- "error" ,
55- {
56- prefer : "type-imports" ,
57- } ,
58- ] ,
59- "@typescript-eslint/ban-ts-comment" : "off" ,
60- "@typescript-eslint/no-explicit-any" : "off" ,
61- "@typescript-eslint/no-use-before-define" : [ "off" ] ,
62- "object-shorthand" : "error" ,
63- "@typescript-eslint/no-unused-vars" : [
64- "warn" ,
65- { varsIgnorePattern : "^_" , argsIgnorePattern : "^_" , ignoreRestSiblings : true } ,
66- ] ,
67- "unused-imports/no-unused-imports" : "error" ,
68- } ,
69- languageOptions : {
70- globals : globalToUse ,
71- parserOptions : {
72- ecmaFeatures : {
73- jsx : true ,
67+ languageOptions : {
68+ globals : globalToUse ,
69+ parserOptions : {
70+ ecmaFeatures : {
71+ jsx : true ,
72+ } ,
7473 } ,
7574 } ,
7675 } ,
77- } ) ;
76+ { ignores } ,
77+ ) ;
78+ export default configs ;
0 commit comments