-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
66 lines (64 loc) · 2.58 KB
/
Copy patheslint.config.js
File metadata and controls
66 lines (64 loc) · 2.58 KB
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
// @ts-check
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
import reactlint from 'eslint-plugin-react';
import prettier from 'eslint-plugin-prettier';
import * as importPlugin from 'eslint-plugin-import';
export default [
...tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
importPlugin.flatConfigs?.recommended
),
{
plugins: { react: reactlint, prettier: prettier },
rules: {
'prettier/prettier': [
'warn',
{
endOfLine: 'auto',
},
],
'no-constant-condition': ['error', { checkLoops: false }],
// This is a temporary hack and should be removed after I fixed the type error in rmg-components.
'@typescript-eslint/ban-ts-comment': [
'error',
{ 'ts-ignore': false, 'ts-expect-error': false, 'ts-nocheck': false },
],
// This is intended as each station/node/line/edge needs an attribute interface to be registered and currently there is no plan for removal and upgrade.
'@typescript-eslint/no-empty-interface': 'off',
// May be removed after type error in rmg-components.
'@typescript-eslint/no-explicit-any': 'off',
// This is really heady when I'm 100% sure it won't be undefined.
'@typescript-eslint/no-non-null-assertion': 'off',
// We may add `_` to ignore pattern but that will decrease clarity if we later need it.
'@typescript-eslint/no-unused-vars': 'off',
// Allow empty object type for base interfaces.
'@typescript-eslint/no-empty-object-type': ['error', { allowInterfaces: 'always' }],
// Imports need to be sorted.
'import/order': ['warn', { groups: ['builtin', 'external', 'parent', 'index', 'sibling'] }],
'import/no-unassigned-import': 'warn',
},
settings: {
react: {
version: 'detect',
},
// eslint-plugin-import needs this resolver to know the import base path (./src).
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
},
},
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
browser: true,
es6: true,
node: true,
},
},
ignores: ['**/*.json', 'setupProxy.js'],
},
];