Skip to content

Commit 638e437

Browse files
authoredMar 11, 2021
feat(ts): update to typescript 4 (#4654)
* feat(ts): update to typescript 4 - replace all ts-ignore by ts-expect-error - remove ignores that were no longer needed - make ignored imports work more efficiently * fix(ts): use inferred type for search client * fix(ts): keep comments on imports * chore(ci): update linting dependencies * chore(lint): add dep * chore(ts): make all lint rules pass * chore(tsc): fix nits * chore(ts): nicer v3 interop * consistent naming * chore: improve types * chore: update test * chore(e2e): undo free shipping change * chore: avoid global * chore: avoid ignore * chore: avoid {} * chore: avoid ignores
1 parent c113e29 commit 638e437

File tree

96 files changed

+497
-329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+497
-329
lines changed
 

‎.eslintrc.js

+33-8
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,39 @@ module.exports = {
1616
'react-hooks/rules-of-hooks': 'error',
1717
'react-hooks/exhaustive-deps': 'warn',
1818
'jest/no-test-callback': 'off',
19+
'eslint-comments/disable-enable-pair': ['error', { allowWholeFile: true }],
1920
'@typescript-eslint/no-unused-vars': [
2021
'error',
2122
{ argsIgnorePattern: '^_', ignoreRestSiblings: true },
2223
],
23-
'@typescript-eslint/camelcase': [
24+
'@typescript-eslint/naming-convention': [
2425
'error',
2526
{
26-
allow: [
27-
'instant_search',
28-
'instant_search_movies',
29-
'free_shipping',
30-
'facets_stats',
31-
'^EXPERIMENTAL_',
32-
],
27+
"selector": "variable",
28+
"modifiers": ["destructured"],
29+
"format": null
30+
},
31+
{
32+
selector: 'variable',
33+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
34+
leadingUnderscore: 'allow',
35+
filter: {
36+
regex: '^EXPERIMENTAL_|__DEV__',
37+
match: false,
38+
},
39+
},
40+
{
41+
selector: 'typeParameter',
42+
format: ['PascalCase'],
43+
prefix: ['T', 'K'],
44+
},
45+
{
46+
selector: 'interface',
47+
format: ['PascalCase'],
48+
custom: {
49+
regex: '^I[A-Z]',
50+
match: false,
51+
},
3352
},
3453
],
3554
},
@@ -40,6 +59,12 @@ module.exports = {
4059
'valid-jsdoc': 'off',
4160
},
4261
},
62+
{
63+
files: ['*.js'],
64+
rules: {
65+
'@typescript-eslint/explicit-member-accessibility': 'off',
66+
},
67+
},
4368
],
4469
settings: {
4570
react: {

‎examples/e-commerce/.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
rules: {
44
'valid-jsdoc': 'off',
55
// The "no-unresolved" rule is needed for the CI
6-
// because it runs ESLint without installating the
6+
// because it runs ESLint without installing the
77
// examples' dependencies first.
88
'import/no-unresolved': 'off',
99
'import/extensions': 'off',

0 commit comments

Comments
 (0)
Please sign in to comment.