Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
sallesma committed Dec 3, 2023
1 parent 6252a7b commit 0d818f0
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
6 changes: 2 additions & 4 deletions scripts/annotationsExtractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ pdfExtract.extract(
let currentAnnotationNumber = ';';
fileContentArray.forEach((rule) => {
try {
let indentation, header;
if (rule.match(/^\d+\.\d+/)) {
// New annotation
const annotationNumber = rule.match(/^\d+\.\d+/)[0];
Expand Down Expand Up @@ -100,9 +99,8 @@ pdfExtract.extract(

const lastContentIndex = fileContentHash[currentRuleNumber][currentAnnotationNumber].content.length - 1;
if (fileContentHash[currentRuleNumber][currentAnnotationNumber].content[lastContentIndex])
fileContentHash[currentRuleNumber][currentAnnotationNumber].content[
lastContentIndex
].text += `\n\n${rule}\n\n`;
fileContentHash[currentRuleNumber][currentAnnotationNumber].content[lastContentIndex].text +=
`\n\n${rule}\n\n`;
}
});

Expand Down
2 changes: 1 addition & 1 deletion src/components/rules/NestedPressableHighlighter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Text, TouchableOpacity } from 'react-native';
import { Text } from 'react-native';
import { findAll } from 'highlight-words-core';

import Highlighter from '../shared/Highlighter.js';
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/BottomSheet.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { StyleSheet, View, Pressable } from 'react-native';
import { StyleSheet, Pressable } from 'react-native';
import { BottomSheet, Button } from 'react-native-elements';
import { MaterialCommunityIcons } from '@expo/vector-icons';

Expand Down
10 changes: 5 additions & 5 deletions src/screens/QuizzScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import I18n from '../utils/i18n';
// Taken from https://stackoverflow.com/a/19270021
function getRandomElementsFromArray(arr, n) {
let number = Math.min(n, arr.length);
let result = new Array(number),
len = arr.length,
taken = new Array(len);
const result = new Array(number);
let length = arr.length;
const taken = new Array(length);
while (number--) {
const x = Math.floor(Math.random() * len);
const x = Math.floor(Math.random() * length);
result[number] = arr[x in taken ? taken[x] : x];
taken[x] = --len in taken ? taken[len] : len;
taken[x] = --length in taken ? taken[length] : length;
}
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/screens/__tests__/AboutScreen.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { render } from '@testing-library/react-native';
import AboutScreen from '../AboutScreen';

describe('<AboutScreen />', () => {
it('renders correctly', async () => {
it('renders correctly', () => {
const { toJSON } = render(<AboutScreen />);

expect(toJSON()).toMatchSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion src/screens/__tests__/HomeScreen.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { render } from '@testing-library/react-native';
import HomeScreen from '../HomeScreen';

describe('<HomeScreen />', () => {
it('renders correctly', async () => {
it('renders correctly', () => {
const { toJSON } = render(<HomeScreen />);

expect(toJSON()).toMatchSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion src/screens/__tests__/OptionsScreen.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { render } from '@testing-library/react-native';
import OptionsScreen from '../OptionsScreen';

describe('<OptionsScreen />', () => {
it('renders correctly', async () => {
it('renders correctly', () => {
const { toJSON } = render(<OptionsScreen />);

expect(toJSON()).toMatchSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion src/screens/__tests__/RulesScreen.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { render } from '@testing-library/react-native';
import RulesScreen from '../RulesScreen';

describe('<RulesScreen />', () => {
it('renders correctly', async () => {
it('renders correctly', () => {
const navigation = { setOptions: jest.fn() };

const { toJSON } = render(<RulesScreen navigation={navigation} />);
Expand Down

0 comments on commit 0d818f0

Please sign in to comment.