@api3/commons 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/blockchain-utilities/derivation.d.ts.map +1 -1
- package/dist/blockchain-utilities/derivation.js +3 -3
- package/dist/blockchain-utilities/derivation.js.map +1 -1
- package/dist/config-parsing/index.d.ts.map +1 -1
- package/dist/config-parsing/index.js +2 -2
- package/dist/config-parsing/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/logger/async-storage.d.ts +0 -1
- package/dist/logger/async-storage.d.ts.map +1 -1
- package/dist/logger/index.d.ts.map +1 -1
- package/dist/node-index.d.ts.map +1 -1
- package/dist/node-index.js +0 -1
- package/dist/node-index.js.map +1 -1
- package/dist/processing/processing.d.ts.map +1 -1
- package/dist/processing/unsafe-evaluate.d.ts.map +1 -1
- package/dist/processing/unsafe-evaluate.js +1 -3
- package/dist/processing/unsafe-evaluate.js.map +1 -1
- package/dist/processing/vm-timers.d.ts +0 -5
- package/dist/processing/vm-timers.d.ts.map +1 -1
- package/package.json +11 -32
- package/src/logger/index.test.ts +0 -1
- package/src/node-index.ts +0 -1
- package/src/processing/unsafe-evaluate.ts +0 -1
- package/dist/eslint/internal.d.ts +0 -15
- package/dist/eslint/internal.d.ts.map +0 -1
- package/dist/eslint/internal.js +0 -24
- package/dist/eslint/internal.js.map +0 -1
- package/dist/eslint/jest.d.ts +0 -29
- package/dist/eslint/jest.d.ts.map +0 -1
- package/dist/eslint/jest.js +0 -38
- package/dist/eslint/jest.js.map +0 -1
- package/dist/eslint/next-js.d.ts +0 -27
- package/dist/eslint/next-js.d.ts.map +0 -1
- package/dist/eslint/next-js.js +0 -33
- package/dist/eslint/next-js.js.map +0 -1
- package/dist/eslint/react.d.ts +0 -90
- package/dist/eslint/react.d.ts.map +0 -1
- package/dist/eslint/react.js +0 -85
- package/dist/eslint/react.js.map +0 -1
- package/dist/eslint/universal.d.ts +0 -173
- package/dist/eslint/universal.d.ts.map +0 -1
- package/dist/eslint/universal.js +0 -203
- package/dist/eslint/universal.js.map +0 -1
- package/src/eslint/README.md +0 -87
- package/src/eslint/internal.js +0 -24
- package/src/eslint/jest.js +0 -36
- package/src/eslint/next-js.js +0 -31
- package/src/eslint/react.js +0 -88
- package/src/eslint/universal.js +0 -209
package/src/eslint/next-js.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
parser: '@typescript-eslint/parser',
|
|
3
|
-
parserOptions: {
|
|
4
|
-
ecmaVersion: 2022, // Enable parsing of modern ECMAScript features.
|
|
5
|
-
ecmaFeatures: {
|
|
6
|
-
jsx: true, // Support JSX syntax.
|
|
7
|
-
},
|
|
8
|
-
sourceType: 'module', // Enable ES6 import/export syntax.
|
|
9
|
-
},
|
|
10
|
-
settings: {
|
|
11
|
-
react: {
|
|
12
|
-
version: 'detect',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
env: {
|
|
16
|
-
node: true,
|
|
17
|
-
browser: true,
|
|
18
|
-
},
|
|
19
|
-
extends: [
|
|
20
|
-
'next/core-web-vitals', // Enforce Next.js performance best practices. See: https://nextjs.org/docs/basic-features/eslint.
|
|
21
|
-
],
|
|
22
|
-
overrides: [
|
|
23
|
-
{
|
|
24
|
-
files: ['pages/**/*'],
|
|
25
|
-
rules: {
|
|
26
|
-
'import/no-default-export': 'off',
|
|
27
|
-
'import/prefer-default-export': 'error', // Next.js expects default exports in the pages directory.
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
};
|
package/src/eslint/react.js
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires, lodash/import-scope
|
|
2
|
-
const { merge } = require('lodash');
|
|
3
|
-
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
5
|
-
const { universalRestrictedImportsConfig, universalImportOrderConfig } = require('./internal');
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
parser: '@typescript-eslint/parser',
|
|
9
|
-
parserOptions: {
|
|
10
|
-
ecmaVersion: 2022, // Enable parsing of modern ECMAScript features.
|
|
11
|
-
ecmaFeatures: {
|
|
12
|
-
jsx: true, // Support JSX syntax.
|
|
13
|
-
},
|
|
14
|
-
sourceType: 'module', // Enable ES6 import/export syntax.
|
|
15
|
-
},
|
|
16
|
-
settings: {
|
|
17
|
-
react: {
|
|
18
|
-
version: 'detect', // Automatically detect the version of React.
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
env: {
|
|
22
|
-
node: true,
|
|
23
|
-
browser: true,
|
|
24
|
-
},
|
|
25
|
-
extends: ['plugin:react/all', 'plugin:react-hooks/recommended'],
|
|
26
|
-
plugins: ['react', '@typescript-eslint', 'import', 'lodash'],
|
|
27
|
-
rules: {
|
|
28
|
-
'import/order': [
|
|
29
|
-
'error',
|
|
30
|
-
merge({}, universalImportOrderConfig, {
|
|
31
|
-
// Prioritize react imports.
|
|
32
|
-
pathGroups: [
|
|
33
|
-
{
|
|
34
|
-
pattern: 'react',
|
|
35
|
-
group: 'builtin',
|
|
36
|
-
position: 'before',
|
|
37
|
-
},
|
|
38
|
-
],
|
|
39
|
-
}),
|
|
40
|
-
],
|
|
41
|
-
/* Overrides for "react" plugin */
|
|
42
|
-
'react/destructuring-assignment': ['error', 'always', { destructureInSignature: 'ignore' }],
|
|
43
|
-
'react/forbid-component-props': ['error', { forbid: [] }],
|
|
44
|
-
'react/forbid-dom-props': ['error', { forbid: [] }],
|
|
45
|
-
'react/jsx-curly-brace-presence': ['error', { props: 'never', children: 'never', propElementValues: 'always' }],
|
|
46
|
-
'react/jsx-curly-newline': 'off', // Conflicts with prettier.
|
|
47
|
-
'react/jsx-filename-extension': 'off', // We use .tsx extension.
|
|
48
|
-
'react/jsx-handler-names': 'off',
|
|
49
|
-
'react/jsx-indent': 'off', // Conflicts with prettier.
|
|
50
|
-
'react/jsx-indent-props': 'off', // Conflicts with prettier.
|
|
51
|
-
'react/jsx-max-depth': 'off', // Conflicts with prettier.
|
|
52
|
-
'react/jsx-max-props-per-line': 'off', // Conflicts with prettier.
|
|
53
|
-
'react/jsx-newline': 'off', // Conflicts with prettier.
|
|
54
|
-
'react/jsx-no-bind': 'off', // Conflicts with prettier.
|
|
55
|
-
'react/jsx-no-leaked-render': 'off',
|
|
56
|
-
'react/jsx-no-literals': 'off',
|
|
57
|
-
'react/jsx-one-expression-per-line': 'off', // Conflicts with prettier.
|
|
58
|
-
'react/jsx-props-no-spreading': 'off',
|
|
59
|
-
'react/jsx-sort-props': 'off',
|
|
60
|
-
'react/no-multi-comp': 'off',
|
|
61
|
-
'react/no-unescaped-entities': 'off',
|
|
62
|
-
'react/no-unused-prop-types': 'off',
|
|
63
|
-
'react/prefer-read-only-props': 'off',
|
|
64
|
-
'react/prop-types': 'off',
|
|
65
|
-
'react/react-in-jsx-scope': 'off',
|
|
66
|
-
'react/require-default-props': 'off',
|
|
67
|
-
'react/self-closing-comp': ['error', { component: true, html: true }],
|
|
68
|
-
'react/void-dom-elements-no-children': 'error',
|
|
69
|
-
|
|
70
|
-
/* Overrides for "@typescript-eslint" plugin */
|
|
71
|
-
'@typescript-eslint/no-restricted-imports': [
|
|
72
|
-
'error',
|
|
73
|
-
merge({}, universalRestrictedImportsConfig, {
|
|
74
|
-
paths: [
|
|
75
|
-
{
|
|
76
|
-
name: 'react',
|
|
77
|
-
importNames: ['default'],
|
|
78
|
-
message:
|
|
79
|
-
'Starting from React version 17, there is no need to globally import React. Use named imports for specific React APIs.',
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
}),
|
|
83
|
-
],
|
|
84
|
-
|
|
85
|
-
/* Overrides for "lodash" plugin */
|
|
86
|
-
'lodash/import-scope': ['error', 'method'],
|
|
87
|
-
},
|
|
88
|
-
};
|
package/src/eslint/universal.js
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
2
|
-
const { universalRestrictedImportsConfig, universalImportOrderConfig } = require('./internal');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
parser: '@typescript-eslint/parser',
|
|
6
|
-
parserOptions: {
|
|
7
|
-
ecmaVersion: 2022, // Allows for the parsing of modern ECMAScript features.
|
|
8
|
-
sourceType: 'module', // Allows for the use of imports.
|
|
9
|
-
},
|
|
10
|
-
env: {
|
|
11
|
-
node: true,
|
|
12
|
-
browser: true,
|
|
13
|
-
},
|
|
14
|
-
extends: [
|
|
15
|
-
'eslint:recommended',
|
|
16
|
-
'plugin:@typescript-eslint/all',
|
|
17
|
-
'plugin:import/recommended',
|
|
18
|
-
'plugin:import/typescript',
|
|
19
|
-
'plugin:unicorn/recommended',
|
|
20
|
-
'plugin:promise/recommended',
|
|
21
|
-
'plugin:lodash/recommended',
|
|
22
|
-
],
|
|
23
|
-
plugins: ['@typescript-eslint', 'deprecation', 'functional', 'unicorn', 'check-file', 'import', 'lodash'],
|
|
24
|
-
rules: {
|
|
25
|
-
/* Rule definitions and overrides for standard ESLint rules */
|
|
26
|
-
camelcase: 'error',
|
|
27
|
-
curly: ['error', 'multi-line', 'consistent'],
|
|
28
|
-
eqeqeq: 'error',
|
|
29
|
-
'no-await-in-loop': 'off', // Too restrictive, often false yields to more verbose code.
|
|
30
|
-
'no-console': ['error', { allow: ['info', 'groupCollapsed', 'groupEnd'] }],
|
|
31
|
-
'no-constant-condition': 'off', // Writing a "while(true)"" loop is often the most readable way to express the intent.
|
|
32
|
-
'no-fallthrough': 'off', // Does not work well with typescript exhaustive enums.
|
|
33
|
-
'no-inline-comments': 'off',
|
|
34
|
-
'no-lonely-if': 'error',
|
|
35
|
-
'no-nested-ternary': 'error',
|
|
36
|
-
'no-new-wrappers': 'error',
|
|
37
|
-
'no-return-await': 'off', // Superceded by @typescript-eslint/return-await.
|
|
38
|
-
'no-unexpected-multiline': 'off', // Conflicts with prettier.
|
|
39
|
-
'no-unused-expressions': 'off', // Superceded by @typescript-eslint/no-unused-expressions.
|
|
40
|
-
'object-shorthand': 'error',
|
|
41
|
-
'prefer-destructuring': [
|
|
42
|
-
'error',
|
|
43
|
-
{
|
|
44
|
-
array: false, // For arrays it is often confusing to use destructuring.
|
|
45
|
-
object: true,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
enforceForRenamedProperties: false,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
'prefer-exponentiation-operator': 'error',
|
|
52
|
-
'prefer-named-capture-group': 'error',
|
|
53
|
-
'prefer-object-spread': 'error',
|
|
54
|
-
'prefer-spread': 'error',
|
|
55
|
-
'prefer-template': 'error',
|
|
56
|
-
radix: 'error',
|
|
57
|
-
// Sort keys does not have a fixer, but sorting lines can be trivially done by IDE (or some plugin). This rule has a
|
|
58
|
-
// nice configuration option "minKeys" which can specify how many keys should be present in an object before sorting
|
|
59
|
-
// is enforced. This is useful for small objects, where sorting is not necessary. Also, it allows creating groups
|
|
60
|
-
// (separated by newlines) which are sorted independently.
|
|
61
|
-
'sort-keys': ['error', 'asc', { caseSensitive: true, natural: true, minKeys: 10, allowLineSeparatedGroups: true }],
|
|
62
|
-
'spaced-comment': [
|
|
63
|
-
'error',
|
|
64
|
-
'always',
|
|
65
|
-
{
|
|
66
|
-
line: {
|
|
67
|
-
markers: ['/'],
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
|
|
72
|
-
/* Rules to enforce kebab-case folder structure */
|
|
73
|
-
'check-file/folder-naming-convention': [
|
|
74
|
-
'error',
|
|
75
|
-
{
|
|
76
|
-
'**/': 'KEBAB_CASE',
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
'unicorn/filename-case': [
|
|
80
|
-
'error',
|
|
81
|
-
{
|
|
82
|
-
case: 'kebabCase',
|
|
83
|
-
ignore: [],
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
|
|
87
|
-
/* Rule overrides for "unicorn" plugin */
|
|
88
|
-
'unicorn/consistent-function-scoping': 'off', // Disabling due to the rule's constraints conflicting with established patterns, especially in test suites where local helper or mocking functions are prevalent and do not necessitate exports.
|
|
89
|
-
'unicorn/no-abusive-eslint-disable': 'off', // Already covered by different ruleset.
|
|
90
|
-
'unicorn/no-array-callback-reference': 'error', // Explicitly turned on, because it was initially disabled and "point free" notation was enforced using "functional/prefer-tacit". That said, the point free pattern is dangerous in JS. See: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md.
|
|
91
|
-
'unicorn/no-array-reduce': 'off', // We are OK with using reduce occasionally, but I agree with the author that the code using reduce can easily get complex.
|
|
92
|
-
'unicorn/no-nested-ternary': 'off', // This rule is smarter than the standard ESLint rule, but conflicts with prettier so it needs to be turned off. Nested ternaries are very unreadable so it's OK if all of them are flagged.
|
|
93
|
-
'unicorn/no-null': 'off', // We use both null and undefined for representing three state objects. We could use a string union instead, but using combination of null and undefined is less verbose.
|
|
94
|
-
'unicorn/no-object-as-default-parameter': 'off', // Too restrictive. TypeScript can ensure that the default value matches the type.
|
|
95
|
-
'unicorn/no-useless-undefined': ['error', { checkArguments: false }], // We need to disable "checkArguments", because if a function expects a value of type "T | undefined" the undefined value needs to be passed explicitly.
|
|
96
|
-
'unicorn/prefer-module': 'off', // We use CJS for configuration files and tests. There is no rush to migrate to ESM and the configuration files are probably not yet ready for ESM yet.
|
|
97
|
-
'unicorn/prevent-abbreviations': 'off', // This rule reports many false positives and leads to more verbose code.
|
|
98
|
-
|
|
99
|
-
/* Rule overrides for "import" plugin */
|
|
100
|
-
'import/no-default-export': 'error',
|
|
101
|
-
'import/no-duplicates': 'error',
|
|
102
|
-
'import/no-named-as-default': 'off',
|
|
103
|
-
'import/no-unresolved': 'off', // Does not accept exports keyword. See: https://github.com/import-js/eslint-plugin-import/issues/1810.
|
|
104
|
-
'import/order': ['error', universalImportOrderConfig],
|
|
105
|
-
|
|
106
|
-
/* Rule overrides for "@typescript-eslint" plugin */
|
|
107
|
-
'@typescript-eslint/comma-dangle': 'off', // Conflicts with prettier.
|
|
108
|
-
'@typescript-eslint/consistent-type-exports': [
|
|
109
|
-
'error',
|
|
110
|
-
{
|
|
111
|
-
fixMixedExportsWithInlineTypeSpecifier: true,
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
'@typescript-eslint/consistent-type-imports': [
|
|
115
|
-
'error',
|
|
116
|
-
{
|
|
117
|
-
prefer: 'type-imports',
|
|
118
|
-
disallowTypeAnnotations: false, // It is quite common to do so. See: https://typescript-eslint.io/rules/consistent-type-imports/#disallowtypeannotations.
|
|
119
|
-
fixStyle: 'inline-type-imports',
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
'@typescript-eslint/explicit-function-return-type': 'off', // Prefer inferring types to explicit annotations.
|
|
123
|
-
'@typescript-eslint/explicit-module-boundary-types': 'off', // We export lot of functions in order to test them. Typing them all is not a good idea.
|
|
124
|
-
'@typescript-eslint/indent': 'off', // Conflicts with prettier.
|
|
125
|
-
'@typescript-eslint/init-declarations': 'off', // Too restrictive, TS is able to infer if value is initialized or not. This pattern does not work with declaring a variable and then initializing it conditionally (or later).
|
|
126
|
-
'@typescript-eslint/lines-around-comment': 'off', // Do not agree with this rule.
|
|
127
|
-
'@typescript-eslint/member-delimiter-style': 'off', // Conflicts with prettier.
|
|
128
|
-
'@typescript-eslint/member-ordering': 'off', // Does not have a fixer. Also, sometimes it's beneficial to group related members together.
|
|
129
|
-
'@typescript-eslint/naming-convention': 'off',
|
|
130
|
-
'@typescript-eslint/no-confusing-void-expression': [
|
|
131
|
-
'error',
|
|
132
|
-
{
|
|
133
|
-
ignoreArrowShorthand: true, // See: https://typescript-eslint.io/rules/no-confusing-void-expression/#ignorearrowshorthand.
|
|
134
|
-
},
|
|
135
|
-
],
|
|
136
|
-
'@typescript-eslint/no-empty-function': 'off', // Too restrictive, often false yields to more verbose code.
|
|
137
|
-
'@typescript-eslint/no-explicit-any': 'off', // Using "any" is sometimes necessary.
|
|
138
|
-
'@typescript-eslint/no-extra-parens': 'off', // Conflicts with prettier.
|
|
139
|
-
'@typescript-eslint/no-magic-numbers': 'off', // Too restrictive. There is often nothing wrong with inlining numbers.
|
|
140
|
-
'@typescript-eslint/no-misused-promises': [
|
|
141
|
-
'error',
|
|
142
|
-
{
|
|
143
|
-
checksVoidReturn: {
|
|
144
|
-
arguments: false, // It's common to pass async function where one expects a function returning void.
|
|
145
|
-
attributes: false, // It's common to pass async function where one expects a function returning void.
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
],
|
|
149
|
-
'@typescript-eslint/no-non-null-assertion': 'off', // Too restrictive. The inference is often not powerful enough or there is not enough context.
|
|
150
|
-
'@typescript-eslint/no-require-imports': 'off', // We use a similar rule called "@typescript-eslint/no-var-imports" which bans require imports alltogether.
|
|
151
|
-
'@typescript-eslint/no-restricted-imports': ['error', universalRestrictedImportsConfig],
|
|
152
|
-
'@typescript-eslint/no-shadow': 'off', // It is often valid to shadow variable (e.g. for the lack of a better name).
|
|
153
|
-
'@typescript-eslint/no-type-alias': 'off', // The rule is deprecated and "@typescript-eslint/consistent-type-definitions" is used instead.
|
|
154
|
-
'@typescript-eslint/no-unnecessary-condition': 'off', // Suggests removing useful conditionals for index signatures and arrays. Would require enabling additional strict checks in TS, which is hard to ask.
|
|
155
|
-
'@typescript-eslint/no-unsafe-argument': 'off', // Too restrictive, often false yields to more verbose code.
|
|
156
|
-
'@typescript-eslint/no-unsafe-assignment': 'off', // Too restrictive, often false yields to more verbose code.
|
|
157
|
-
'@typescript-eslint/no-unsafe-member-access': 'off', // Too restrictive, often false yields to more verbose code.
|
|
158
|
-
'@typescript-eslint/no-unsafe-return': 'off', // Too restrictive, often false yields to more verbose code.
|
|
159
|
-
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_', vars: 'all' }],
|
|
160
|
-
'@typescript-eslint/no-use-before-define': 'off', // Too restrictive, does not have a fixer and is not important.
|
|
161
|
-
'@typescript-eslint/object-curly-spacing': 'off', // Conflicts with prettier.
|
|
162
|
-
'@typescript-eslint/prefer-nullish-coalescing': [
|
|
163
|
-
'error',
|
|
164
|
-
{
|
|
165
|
-
ignoreConditionalTests: true, // Its more intuitive to use logical operators in conditionals.
|
|
166
|
-
},
|
|
167
|
-
],
|
|
168
|
-
'@typescript-eslint/prefer-readonly-parameter-types': 'off', // Too restrictive, often false yields to more verbose code.
|
|
169
|
-
'@typescript-eslint/quotes': 'off', // Conflicts with prettier.
|
|
170
|
-
'@typescript-eslint/semi': 'off', // Conflicts with prettier.
|
|
171
|
-
'@typescript-eslint/space-before-function-paren': 'off', // Conflicts with prettier.
|
|
172
|
-
'@typescript-eslint/strict-boolean-expressions': 'off', // While the rule is reasonable, it is often convenient and intended to just check whether the value is not null or undefined. Enabling this rule would make the code more verbose. See: https://typescript-eslint.io/rules/strict-boolean-expressions/
|
|
173
|
-
'@typescript-eslint/unbound-method': 'off', // Reports issues for common patterns in tests (e.g. "expect(logger.warn)..."). Often the issue yields false positives.
|
|
174
|
-
|
|
175
|
-
/* Rule overrides for "functional" plugin */
|
|
176
|
-
'functional/no-classes': 'error', // Functions are all we need.
|
|
177
|
-
'functional/no-promise-reject': 'error',
|
|
178
|
-
'functional/no-try-statements': 'error', // Use go utils instead.
|
|
179
|
-
'functional/prefer-tacit': 'off', // The rule is dangerous. See: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-callback-reference.md.
|
|
180
|
-
|
|
181
|
-
/* Overrides for "lodash" plugin */
|
|
182
|
-
'lodash/import-scope': ['error', 'member'], // We prefer member imports in node.js code. This is not recommended for FE projects, because lodash can't be tree shaken (written in CJS not ESM). This rule should be overridden for FE projects (and we do so in React ruleset).
|
|
183
|
-
'lodash/path-style': 'off', // Can potentially trigger TS errors. Both variants have use cases when they are more readable.
|
|
184
|
-
'lodash/prefer-lodash-method': 'off', // Disagree with this rule. Using the native method is often simpler.
|
|
185
|
-
|
|
186
|
-
/* Rule overrides for other plugins and rules */
|
|
187
|
-
// This rule unfortunately does not detect deprecated properties. See:
|
|
188
|
-
// https://github.com/gund/eslint-plugin-deprecation/issues/13/
|
|
189
|
-
'deprecation/deprecation': 'error',
|
|
190
|
-
},
|
|
191
|
-
overrides: [
|
|
192
|
-
// Overrides for Jest tests.
|
|
193
|
-
{
|
|
194
|
-
files: ['**/*.test.ts', '**/*.test.tsx'],
|
|
195
|
-
env: {
|
|
196
|
-
jest: true,
|
|
197
|
-
},
|
|
198
|
-
plugins: ['jest'],
|
|
199
|
-
extends: ['plugin:jest/all', 'plugin:jest-formatting/recommended'],
|
|
200
|
-
rules: {
|
|
201
|
-
'jest/prefer-expect-assertions': 'off', // Enabling this option would result in excessively verbose code.
|
|
202
|
-
'jest/prefer-each': 'off', // We prefer the traditional for loop.
|
|
203
|
-
'jest/require-top-level-describe': 'off', // This is not a good pattern. There is nothing wrong with having multiple top level describe blocks or tests.
|
|
204
|
-
'jest/max-expects': 'off', // It's good to limit the number of expects in a test, but this rule is too strict.
|
|
205
|
-
'jest/valid-title': 'off', // Prevents using "<function-name>.name" as a test name
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
};
|