Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linter warnings #8978

Merged
merged 4 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cypress/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
setupNodeEvents(on) {
on('before:browser:launch', (browser = {}, launchOptions) => {
// Fix for Cypress 4:
// https://docs.cypress.io/api/plugins/browser-launch-api.html#Usage
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/edit.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe('Edit Page', () => {
cy.contains('Required');
// FIXME: We navigate away from the page and confirm the unsaved changes
// This is needed because HashHistory would prevent further navigation
cy.window().then(win => {
cy.window().then(() => {
cy.on('window:confirm', () => true);
});
cy.get('.RaSidebar-fixed [role="menuitem"]:first-child').click();
Expand Down
2 changes: 1 addition & 1 deletion examples/crm/src/dataGenerator/sales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { name, internet } from 'faker/locale/en_US';

import { Db } from './types';

export const generateSales = (db: Db) => {
export const generateSales = (_: Db) => {
const randomSales = Array.from(Array(10).keys()).map(id => {
const first_name = name.firstName();
const last_name = name.lastName();
Expand Down
2 changes: 1 addition & 1 deletion examples/crm/src/dataGenerator/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ const tags = [
{ id: 5, name: 'vip', color: '#dbe7e4' },
];

export const generateTags = (db: Db) => {
export const generateTags = (_: Db) => {
return [...tags];
};
2 changes: 1 addition & 1 deletion examples/crm/src/deals/OnlyMineInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { useListFilterContext, useGetIdentity } from 'react-admin';
import { Box, Switch, FormControlLabel } from '@mui/material';

export const OnlyMineInput = ({ alwaysOn }: { alwaysOn: boolean }) => {
export const OnlyMineInput = (_: { alwaysOn: boolean }) => {
const {
filterValues,
displayedFilters,
Expand Down
7 changes: 1 addition & 6 deletions examples/demo/src/orders/MobileGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ import {
BooleanField,
useTranslate,
useListContext,
RaRecord,
RecordContextProvider,
} from 'react-admin';

import CustomerReferenceField from '../visitors/CustomerReferenceField';
import { Order } from '../types';

interface MobileGridProps {
data?: RaRecord[];
}

const MobileGrid = (props: MobileGridProps) => {
const MobileGrid = () => {
const { data, isLoading } = useListContext<Order>();
const translate = useTranslate();
if (isLoading || data.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/products/ThumbnailField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Img = styled('img')({
verticalAlign: 'middle',
});

const ThumbnailField = (props: { source: string; label?: string }) => {
const ThumbnailField = (_: { source: string; label?: string }) => {
const record = useRecordContext<Product>();
if (!record) return null;
return <Img src={record.thumbnail} alt="" />;
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/visitors/CustomerLinkField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Link, FieldProps, useRecordContext } from 'react-admin';
import FullNameField from './FullNameField';
import { Customer } from '../types';

const CustomerLinkField = (props: FieldProps<Customer>) => {
const CustomerLinkField = (_: FieldProps<Customer>) => {
const record = useRecordContext<Customer>();
if (!record) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion examples/demo/src/visitors/SegmentsField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const segmentsById = segments.reduce((acc, segment) => {
return acc;
}, {} as { [key: string]: any });

const SegmentsField = (props: FieldProps) => {
const SegmentsField = (_: FieldProps) => {
const translate = useTranslate();
const record = useRecordContext<Customer>();
if (!record || !record.groups) {
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/src/posts/PostCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
import { useFormContext, useWatch } from 'react-hook-form';
import { Button, Dialog, DialogActions, DialogContent } from '@mui/material';

const PostCreateToolbar = props => {
const PostCreateToolbar = () => {
const notify = useNotify();
const redirect = useRedirect();
const { reset } = useFormContext();
Expand Down