-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
executable file
·118 lines (117 loc) · 4.41 KB
/
eslint.config.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* Monorepo wide eslint config, UI Apps in folder apps-ui have individual
* eslint configs for clean isolated nextjs app builds
*/
module.exports = [
{
files: ['**/*.js'],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
},
},
{
files: ['apps-api/resource-hub-api/**/*.ts'],
parser: '@typescript-eslint/parser',
ignorePatterns: ['resource-hub-api/documentation/**/*'],
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'],
root: true,
env: {
node: true,
jest: true,
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
files: ['packages-ui/mwe-ui-core/**/*.ts, packages-ui/mwe-ui-core/**/*.tsx}'],
env: {
module: 'ESNext',
browser: true,
es2022: true,
},
rules: {
'@typescript-eslint/await-thenable': 'error',
'prettier/prettier': 'error',
'prefer-destructuring': [
'error',
{
array: true,
object: true,
},
{
enforceForRenamedProperties: false,
},
],
},
plugins: ['eslint-plugin-tsdoc'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 2020,
project: 'packages/mwe-ui-core/tsconfig.json',
sourceType: 'module',
createDefaultProgram: true,
},
extends: [
'eslint:recommended',
/* 'next/core-web-vitals', */
'plugin:react/jsx-runtime',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
// 'plugin:prettier/recommended', Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
'plugin:react-hooks/recommended',
],
settings: {
react: {
createClass: 'createReactClass',
// Regex for Component Factory to use,
// default to "createReactClass"
pragma: 'React',
// Pragma to use, default to "React"
fragment: 'Fragment',
// Fragment to use (may be a property of <pragma>), default to "Fragment"
version: 'detect',
// React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// default to latest and warns if missing
// It will default to "detect" in the future
// flowVersion: '0.53', // Flow version
},
propWrapperFunctions: [
// The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
'forbidExtraProps',
{
property: 'freeze',
object: 'Object',
},
{
property: 'myFavoriteWrapper',
},
],
linkComponents: [
// Components used as alternatives to <a> for linking, eg. <Link to={ url } />
'Hyperlink',
{
name: 'Link',
linkAttribute: 'to',
},
],
},
},
];