2022-12-21 03:08:20 +04:00
|
|
|
/* eslint-env node */
|
|
|
|
|
|
|
|
require('@uniswap/eslint-config/load')
|
|
|
|
|
2023-05-16 16:53:22 -04:00
|
|
|
const rulesDirPlugin = require('eslint-plugin-rulesdir')
|
|
|
|
rulesDirPlugin.RULES_DIR = 'eslint_rules'
|
|
|
|
|
2022-12-21 03:08:20 +04:00
|
|
|
module.exports = {
|
2023-05-16 16:53:22 -04:00
|
|
|
extends: ['@uniswap/eslint-config/react'],
|
|
|
|
plugins: ['rulesdir'],
|
2023-03-29 13:25:30 -07:00
|
|
|
overrides: [
|
2023-05-02 08:26:07 -07:00
|
|
|
{
|
|
|
|
files: ['**/*'],
|
|
|
|
rules: {
|
|
|
|
'multiline-comment-style': ['error', 'separate-lines'],
|
2023-05-16 16:53:22 -04:00
|
|
|
'rulesdir/enforce-retry-on-import': 'error',
|
2023-05-02 08:26:07 -07:00
|
|
|
},
|
|
|
|
},
|
2023-04-13 12:43:47 -07:00
|
|
|
{
|
|
|
|
// 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',
|
|
|
|
},
|
|
|
|
},
|
2023-03-29 13:25:30 -07:00
|
|
|
{
|
|
|
|
files: ['**/*.ts', '**/*.tsx'],
|
|
|
|
rules: {
|
2023-04-20 13:43:31 -07:00
|
|
|
'import/no-restricted-paths': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
zones: [
|
|
|
|
{
|
|
|
|
target: ['src/**/*[!.test].ts', 'src/**/*[!.test].tsx'],
|
|
|
|
from: 'src/test-utils',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2023-03-29 13:25:30 -07:00
|
|
|
'no-restricted-imports': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
paths: [
|
2023-04-20 14:12:43 -07:00
|
|
|
{
|
|
|
|
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.',
|
|
|
|
},
|
2023-03-29 13:25:30 -07:00
|
|
|
{
|
|
|
|
name: 'zustand',
|
|
|
|
importNames: ['default'],
|
|
|
|
message: 'Default import from zustand is deprecated. Import `{ create }` instead.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
2022-12-21 03:08:20 +04:00
|
|
|
}
|