1
+ 'use strict' ;
2
+
3
+ module . exports = {
4
+ root : true ,
5
+ env : { browser : true } ,
6
+ extends : [
7
+ '@flybywiresim/eslint-config' ,
8
+ 'plugin:jest/recommended' ,
9
+ 'plugin:jest/style' ,
10
+ 'plugin:tailwindcss/recommended' ,
11
+ ] ,
12
+ plugins : [
13
+ '@typescript-eslint' ,
14
+ 'tailwindcss' ,
15
+ ] ,
16
+ parser : '@typescript-eslint/parser' ,
17
+ ignorePatterns : [
18
+ 'mcdu-server/client/build/**' ,
19
+ ] ,
20
+ parserOptions : {
21
+ ecmaVersion : 2021 ,
22
+ sourceType : 'script' ,
23
+ requireConfigFile : false ,
24
+ } ,
25
+ settings : {
26
+ 'tailwindcss' : { groupByResponsive : true } ,
27
+ 'import/resolver' : { node : { extensions : [ '.js' , '.mjs' , '.jsx' , '.ts' , '.tsx' ] } } ,
28
+ } ,
29
+ overrides : [
30
+ {
31
+ files : [ '*.jsx' , '*.tsx' ] ,
32
+ parserOptions : {
33
+ sourceType : 'module' ,
34
+ ecmaFeatures : { jsx : true } ,
35
+ } ,
36
+ } ,
37
+ {
38
+ files : [ '*.mjs' , '*.ts' , '*.d.ts' ] ,
39
+ parserOptions : { sourceType : 'module' } ,
40
+ } ,
41
+ ] ,
42
+ // overrides airbnb, use sparingly
43
+ rules : {
44
+ 'tailwindcss/no-custom-classname' : 'off' ,
45
+ 'no-bitwise' : 'off' ,
46
+ 'no-mixed-operators' : 'off' ,
47
+ 'arrow-parens' : [ 'error' , 'always' ] ,
48
+ 'brace-style' : [ 'error' , '1tbs' , { allowSingleLine : false } ] ,
49
+ 'class-methods-use-this' : 'off' ,
50
+ 'curly' : [ 'error' , 'multi-line' ] ,
51
+ 'import/prefer-default-export' : 'off' ,
52
+ 'import/no-extraneous-dependencies' : [ 'error' , { devDependencies : true } ] ,
53
+ 'indent' : [ 'error' , 4 ] ,
54
+ 'react/jsx-filename-extension' : [ 2 , { extensions : [ '.jsx' , '.tsx' ] } ] ,
55
+ 'react/jsx-indent' : [ 'error' , 4 ] ,
56
+ 'no-restricted-syntax' : 'off' ,
57
+ 'quote-props' : [ 'error' , 'consistent-as-needed' ] ,
58
+ 'strict' : [ 'error' , 'global' ] ,
59
+
60
+ 'no-case-declarations' : 'off' ,
61
+
62
+ 'no-plusplus' : 'off' ,
63
+ 'no-shadow' : 'off' ,
64
+ 'no-continue' : 'off' ,
65
+ 'no-return-assign' : 'off' ,
66
+ 'radix' : 'off' ,
67
+ 'max-classes-per-file' : 'off' ,
68
+ 'no-useless-constructor' : 'off' ,
69
+ '@typescript-eslint/no-useless-constructor' : [ 'error' ] ,
70
+ 'no-empty-function' : [ 'error' , { allow : [ 'constructors' , 'arrowFunctions' ] } ] ,
71
+ '@typescript-eslint/no-empty-function' : 'off' ,
72
+
73
+ // buggy
74
+ 'prefer-destructuring' : 'off' ,
75
+
76
+ // Avoid typescript-eslint conflicts
77
+ 'no-unused-vars' : 'off' ,
78
+ 'import/no-unresolved' : 'off' ,
79
+ '@typescript-eslint/no-unused-vars' : [ 'error' , {
80
+ vars : 'all' ,
81
+ varsIgnorePattern : '^_|^FSComponent$' ,
82
+ args : 'after-used' ,
83
+ argsIgnorePattern : '^_|^node$|^deltaTime$' ,
84
+ } ] ,
85
+
86
+ 'no-use-before-define' : 'off' ,
87
+
88
+ 'react/jsx-indent-props' : 'off' ,
89
+
90
+ // not relevant now
91
+ 'react/no-unused-state' : 'off' ,
92
+
93
+ // useless
94
+ 'react/prop-types' : 'off' ,
95
+ 'react/require-default-props' : 'off' ,
96
+ 'react/no-unused-prop-types' : 'off' ,
97
+ 'react/destructuring-assignment' : 'off' ,
98
+ 'react/jsx-props-no-spreading' : 'off' ,
99
+ 'react/no-unescaped-entities' : 'off' ,
100
+
101
+ // Not needed with react 17+
102
+ 'react/jsx-uses-react' : 'off' ,
103
+ 'react/react-in-jsx-scope' : 'off' ,
104
+
105
+ 'import/extensions' : 'off' ,
106
+ 'no-param-reassign' : 'off' ,
107
+ 'no-undef-init' : 'off' ,
108
+ 'no-undef' : 'off' ,
109
+ 'max-len' : [ 'error' , { code : 192 } ] ,
110
+
111
+ // Irrelevant for our use
112
+ 'jsx-a11y/alt-text' : 'off' ,
113
+ 'jsx-a11y/no-static-element-interactions' : 'off' ,
114
+ 'jsx-a11y/click-events-have-key-events' : 'off' ,
115
+ 'jsx-a11y/anchor-is-valid' : 'off' ,
116
+ 'object-curly-newline' : [ 'error' , { multiline : true } ] ,
117
+ 'linebreak-style' : 'off' ,
118
+
119
+ // allow typescript overloads
120
+ 'no-redeclare' : 'off' ,
121
+ '@typescript-eslint/no-redeclare' : [ 'error' ] ,
122
+ 'lines-between-class-members' : 'off' ,
123
+ '@typescript-eslint/lines-between-class-members' : [ 'error' ] ,
124
+ 'no-dupe-class-members' : 'off' ,
125
+ '@typescript-eslint/no-dupe-class-members' : [ 'error' ] ,
126
+
127
+ // allow console logging
128
+ 'no-console' : 'off' ,
129
+ } ,
130
+ globals : {
131
+ Simplane : 'readonly' ,
132
+ SimVar : 'readonly' ,
133
+ Utils : 'readonly' ,
134
+ JSX : 'readonly' ,
135
+ Coherent : 'readonly' ,
136
+ ViewListener : 'readonly' ,
137
+ RegisterViewListener : 'readonly' ,
138
+ } ,
139
+ } ;
0 commit comments