1f755e8b0d
* feat: add retry logic for lazy import * try again * add tests * refactor: moves retry helper to subfolder * missing-files * fix * doc comment * tsdoc * fake timers * fix * add eslint rule * try again? * try again? * only dynamic * try again * try again * IT WORKS * add retry * fix * add test * warn -> error * lint * lint * lint * add back cache * rm test * try again * real timers but really short intervals * try returning the promise? * try returning the promise? * try this package * retry * Update src/utils/retry.ts Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * Update rules/enforce-retry-on-import.js Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * Update rules/enforce-retry-on-import.js Co-authored-by: Zach Pomerantz <zzmp@uniswap.org> * eslint_rules * test fixes * name * fix --------- Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
62 lines
1.8 KiB
JavaScript
62 lines
1.8 KiB
JavaScript
/* eslint-env node */
|
|
|
|
require('@uniswap/eslint-config/load')
|
|
|
|
const rulesDirPlugin = require('eslint-plugin-rulesdir')
|
|
rulesDirPlugin.RULES_DIR = 'eslint_rules'
|
|
|
|
module.exports = {
|
|
extends: ['@uniswap/eslint-config/react'],
|
|
plugins: ['rulesdir'],
|
|
overrides: [
|
|
{
|
|
files: ['**/*'],
|
|
rules: {
|
|
'multiline-comment-style': ['error', 'separate-lines'],
|
|
'rulesdir/enforce-retry-on-import': 'error',
|
|
},
|
|
},
|
|
{
|
|
// Configuration/typings typically export objects/definitions that are used outside of the transpiled package
|
|
// (eg not captured by the tsconfig). Because it's typical and not exceptional, this is turned off entirely.
|
|
files: ['**/*.config.*', '**/*.d.ts'],
|
|
rules: {
|
|
'import/no-unused-modules': 'off',
|
|
},
|
|
},
|
|
{
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
rules: {
|
|
'import/no-restricted-paths': [
|
|
'error',
|
|
{
|
|
zones: [
|
|
{
|
|
target: ['src/**/*[!.test].ts', 'src/**/*[!.test].tsx'],
|
|
from: 'src/test-utils',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
'no-restricted-imports': [
|
|
'error',
|
|
{
|
|
paths: [
|
|
{
|
|
name: 'moment',
|
|
// tree-shaking for moment is not configured because it degrades performance - see craco.config.cjs.
|
|
message: 'moment is not configured for tree-shaking. If you use it, update the Webpack configuration.',
|
|
},
|
|
{
|
|
name: 'zustand',
|
|
importNames: ['default'],
|
|
message: 'Default import from zustand is deprecated. Import `{ create }` instead.',
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
],
|
|
}
|