1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Tools: Ignore existing components for react-hook rule

This commit is contained in:
Laurent Cozic 2020-01-29 18:03:55 +00:00
parent 73d12e1ed5
commit 759d59c2e6
68 changed files with 139 additions and 20 deletions

View File

@ -6,6 +6,11 @@ module.exports = {
},
"parser": "@typescript-eslint/parser",
'extends': ['eslint:recommended'],
"settings": {
'react': {
'version': '16.12',
},
},
'globals': {
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly',

View File

@ -54,27 +54,9 @@ The tests are under CliClient/tests. To get them running, you first need to buil
cd CliClient
npm i
./build.sh
To run the test units, you must have an instance of the cli app running. In a first window navigate into `CliClient` and run:
```sh
./run.sh
```
> If you get an error like `Error: Cannot find module '../locales/index.js'`, this means you must (a) rebuild translations or (b) take > them from one of the other apps. To do option b, you can run the following command to copy them from the `ReactNativeClient` directory:>
>
> ```sh
> cd .. # Return to the root of the project
> rsync -aP ./ReactNativeClient/locales/ ./CliClient/build/locales/
> ```
> If you get an error like `Error: Cannot find module './path/to/node_sqlite3.node'`, that likely means you need to install sqlite:
>
> ```sh
> npm install sqlite3 --build-from-source
> ```
Then run the tests in a second window. To run all the test units:
To run all the test units:
./run_test.sh

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
import React, { Component } from 'react';
import './App.css';
import led_red from './led_red.png';

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { bridge } = require('electron').remote.require('./bridge');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const styleSelector = require('./style/ConfigMenuBar');
const Setting = require('lib/models/Setting');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const Setting = require('lib/models/Setting.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { _ } = require('lib/locale.js');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { bridge } = require('electron').remote.require('./bridge');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const Setting = require('lib/models/Setting');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { bridge } = require('electron').remote.require('./bridge');
const styleSelector = require('./style/ExtensionBadge');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const Folder = require('lib/models/Folder.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
class ItemList extends React.Component {

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { Header } = require('./Header.min.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const { ItemList } = require('./ItemList.min.js');
const React = require('react');
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { _ } = require('lib/locale.js');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { time } = require('lib/time-utils.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Note = require('lib/models/Note.js');
const BaseItem = require('lib/models/BaseItem.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { reg } = require('lib/registry.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { _ } = require('lib/locale.js');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { render } = require('react-dom');
const { connect, Provider } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
import * as React from 'react';
import { useState, useEffect } from 'react';
import JoplinServerApi from '../lib/JoplinServerApi';

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const shared = require('lib/components/shared/side-menu-shared.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const Setting = require('lib/models/Setting.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { themeStyle } = require('../theme.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { bridge } = require('electron').remote.require('./bridge');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const smalltalk = require('smalltalk');
class Dialogs {

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');
const { _ } = require('lib/locale.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { TouchableOpacity, TouchableWithoutFeedback, Dimensions, Text, Modal, View } = require('react-native');
const { ItemList } = require('lib/components/ItemList.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { View, ScrollView } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { Text, Modal, View, StyleSheet, Button } = require('react-native');
const { themeStyle } = require('lib/components/global-style.js');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { StyleSheet } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { StyleSheet } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { View, TouchableHighlight } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const Setting = require('lib/models/Setting.js');
const { Platform } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { Platform, View, Text } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { StyleSheet, View, Text, FlatList, TouchableOpacity, TextInput } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { Platform, TouchableOpacity, Linking, View, Switch, StyleSheet, Text, Button, ScrollView, TextInput, Alert } = require('react-native');
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { View, Button, Text, TextInput, TouchableOpacity, StyleSheet, ScrollView } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { TextInput, TouchableOpacity, Linking, View, StyleSheet, Text, Button, ScrollView } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { View, TextInput, StyleSheet } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { ListView, View, Text, Button, StyleSheet, Platform } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { Platform, Clipboard, Keyboard, View, TextInput, StyleSheet, Linking, Image, Share } = require('react-native');
const { connect } = require('react-redux');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { AppState, View, StyleSheet } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { View } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { StyleSheet, View, TextInput, FlatList, TouchableHighlight } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { StyleSheet, View, Text, Button, FlatList } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { View, Text, FlatList, StyleSheet, TouchableOpacity } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
import React from 'react';
import { View } from 'react-native';
import PopupDialog, { DialogTitle, DialogButton } from 'react-native-popup-dialog';

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { TouchableOpacity, Text, StyleSheet, ScrollView, View } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const Component = React.Component;
const { Easing, Animated, TouchableOpacity, Text, StyleSheet, ScrollView, View, Alert } = require('react-native');

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const { connect } = require('react-redux');
const SideMenu_ = require('react-native-side-menu').default;

View File

@ -1,3 +1,5 @@
/* eslint-disable enforce-react-hooks/enforce-react-hooks */
const React = require('react');
const { AppState, Keyboard, NativeModules, BackHandler, Platform, Animated } = require('react-native');
const { SafeAreaView } = require('react-navigation');