eb310f7821
* feat(reader): swipe down to re-fetch a chapter, never cache empty responses - pull down at the top of a chapter to re-fetch it, recovering from transient empty responses without leaving the reader - empty responses are evicted from the chapter cache so a refresh re-fetches instead of replaying the empty message - add a refresh button to the reader's bottom bar and a 'Refresh chapter' link on the empty-chapter message - register the typescript-eslint plugin and ignore assets/ in the eslint flat config so lint-staged can lint core.js * feat(reader): move refresh option to appbar menu
68 lines
1.6 KiB
JavaScript
68 lines
1.6 KiB
JavaScript
const { defineConfig, globalIgnores } = require('eslint/config');
|
|
const expoConfig = require('eslint-config-expo/flat');
|
|
const { FlatCompat } = require('@eslint/eslintrc');
|
|
const tseslint = require('@typescript-eslint/eslint-plugin');
|
|
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
});
|
|
|
|
const testFiles = [
|
|
'**/__tests__/**/*.[jt]s?(x)',
|
|
'**/?(*.)+(spec|test).[jt]s?(x)',
|
|
];
|
|
|
|
module.exports = defineConfig([
|
|
globalIgnores([
|
|
'android/**',
|
|
'ios/**',
|
|
'node_modules/**',
|
|
'.expo/**',
|
|
'dist/**',
|
|
'coverage/**',
|
|
'assets/**',
|
|
]),
|
|
expoConfig,
|
|
...compat
|
|
.extends('plugin:testing-library/react', 'plugin:jest/recommended')
|
|
.map(config => ({
|
|
...config,
|
|
files: testFiles,
|
|
})),
|
|
|
|
{
|
|
files: ['**/*.{js,jsx,ts,tsx}'],
|
|
plugins: {
|
|
'@typescript-eslint': tseslint,
|
|
},
|
|
rules: {
|
|
'no-shadow': 'off',
|
|
'no-undef': 'off',
|
|
'no-console': 'error',
|
|
|
|
'@typescript-eslint/no-shadow': 'warn',
|
|
|
|
'react-hooks/exhaustive-deps': 'warn',
|
|
'react-hooks/static-components': 'warn',
|
|
'react-hooks/purity': 'warn',
|
|
'react-hooks/set-state-in-effect': 'warn',
|
|
'react-hooks/refs': 'warn',
|
|
'react-hooks/immutability': 'warn',
|
|
'react/no-children-prop': 'warn',
|
|
|
|
'react/display-name': 'off',
|
|
|
|
curly: ['error', 'multi-line', 'consistent'],
|
|
'no-useless-return': 'error',
|
|
'block-scoped-var': 'error',
|
|
'no-var': 'error',
|
|
'prefer-const': 'error',
|
|
'no-dupe-else-if': 'error',
|
|
'no-duplicate-imports': 'error',
|
|
|
|
'@react-native/no-deep-imports': 'off',
|
|
'@typescript-eslint/no-require-imports': 'off',
|
|
},
|
|
},
|
|
]);
|