-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.shared.js
More file actions
86 lines (81 loc) · 2.32 KB
/
Copy patheslint.config.shared.js
File metadata and controls
86 lines (81 loc) · 2.32 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// @ts-check
import eslint from '@eslint/js';
import { importX } from 'eslint-plugin-import-x';
import simpleImportSort from 'eslint-plugin-simple-import-sort';
import { defineConfig, globalIgnores } from 'eslint/config';
import globals from 'globals';
import { configs } from 'typescript-eslint';
export default defineConfig(
eslint.configs.recommended,
...configs.stylisticTypeChecked,
...configs.strictTypeChecked,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
project: true,
},
},
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-import-type-side-effects': 'error',
'@typescript-eslint/no-deprecated': 'error',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowBoolean: true,
allowNumber: true,
allowRegExp: true,
},
],
'@typescript-eslint/no-unnecessary-condition': 'off',
// Allow passing `() => Promise<void>` to a React prop that expects `() => void`. Mostly for Primereact
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: {
attributes: false,
},
},
],
},
},
{
rules: {
'import-x/newline-after-import': 'error',
'simple-import-sort/exports': 'error',
'simple-import-sort/imports': 'error',
eqeqeq: 'error',
},
plugins: {
'simple-import-sort': simpleImportSort,
},
},
{
// Test-specific rules
files: ['src/integration/**/*.ts', 'src/**/*.{spec,test}.{ts,tsx}'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
files: ['*.js', '*.config.{js,ts}', 'tasks/*.{js,ts}', '.husky/**/*.{js,ts}', 'src/**/*.graphql'],
...configs.disableTypeChecked,
},
{
files: ['*.js', '*.config.{js,ts}'],
languageOptions: {
globals: {
...globals.node,
},
},
},
globalIgnores(['node_modules', 'dist', 'public', 'reports', 'src/gql/*/gen', 'src/*/gen']),
);