forked from flybywiresim/aircraft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
93 lines (89 loc) · 2.58 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Copyright (c) 2021-2023 FlyByWire Simulations
//
// SPDX-License-Identifier: GPL-3.0
'use strict';
const path = require('path');
module.exports = {
env: { browser: true },
root: true,
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
// 'plugin:@typescript-eslint/recommended', -- Disabled as it is complex to fix, needs to be done bit by bit
'plugin:@typescript-eslint/eslint-recommended',
// 'plugin:react-hooks/recommended', -- Disabled as it is complex to fix, needs to be done bit by bit, and we are moving away from react
// 'plugin:react/recommended', -- Disabled as it is complex to fix, needs to be done bit by bit, and we are moving away from react
],
plugins: ['@typescript-eslint', 'prettier', 'react-hooks', 'react', 'tailwindcss'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2021,
sourceType: 'script',
requireConfigFile: false,
},
overrides: [
{
files: [
'.eslintrc.js',
'scripts/**/*.js',
'**/mach.config.js',
'**/rollup.config.js',
'**/tailwind.config.js',
'**/jest.config.js',
],
env: {
node: true,
},
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
{
files: ['fbw-common/src/jest/**/*.js'],
env: {
node: true,
},
plugins: ['jest'],
extends: ['plugin:jest/recommended'],
},
],
settings: {
tailwindcss: {
groupByResponsive: true,
config: path.join(__dirname, 'fbw-common/src/systems/instruments/src/EFB/tailwind.config.js'),
},
react: { version: 'detect' },
},
ignorePatterns: [
'fbw-common/src/typings/*',
'fbw-a380x/*',
'fbw-ingamepanels-checklist-fix/*',
'!fbw-a380x/src/systems/instruments/src/PFD/*',
'!fbw-a380x/src/systems/instruments/src/MFD/*',
],
rules: {
'prettier/prettier': ['error', {}, { usePrettierrc: true }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: 'FSComponent|_.*',
argsIgnorePattern: '_.*',
},
],
'tailwindcss/classnames-order': 'error',
'tailwindcss/enforces-negative-arbitrary-values': 'error',
'tailwindcss/enforces-shorthand': 'error',
'tailwindcss/migration-from-tailwind-2': 'error',
'tailwindcss/no-contradicting-classname': 'error',
},
globals: {
Simplane: 'readonly',
SimVar: 'readonly',
Utils: 'readonly',
JSX: 'readonly',
Coherent: 'readonly',
ViewListener: 'readonly',
RegisterViewListener: 'readonly',
},
};