Skip to content

Commit 40b0731

Browse files
committed
autofix remaining issues
1 parent a9dcc27 commit 40b0731

42 files changed

Lines changed: 67 additions & 86 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

examples/crm/src/deals/DealEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export const DealEdit = ({ open, id }: { open: boolean; id?: string }) => {
4545
},
4646
}}
4747
>
48-
{!!id ? (
48+
{id ? (
4949
<EditBase
5050
id={id}
5151
mutationMode="pessimistic"

examples/crm/src/deals/DealShow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const DealShow = ({ open, id }: { open: boolean; id?: string }) => {
5454
}}
5555
>
5656
<DialogContent sx={{ padding: 0 }}>
57-
{!!id ? (
57+
{id ? (
5858
<ShowBase id={id}>
5959
<DealShowContent handleClose={handleClose} />
6060
</ShowBase>

examples/crm/src/layout/Header.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ const Header = () => {
2626
const location = useLocation();
2727

2828
let currentPath: string | boolean = '/';
29-
if (!!matchPath('/', location.pathname)) {
29+
if (matchPath('/', location.pathname)) {
3030
currentPath = '/';
31-
} else if (!!matchPath('/contacts/*', location.pathname)) {
31+
} else if (matchPath('/contacts/*', location.pathname)) {
3232
currentPath = '/contacts';
33-
} else if (!!matchPath('/companies/*', location.pathname)) {
33+
} else if (matchPath('/companies/*', location.pathname)) {
3434
currentPath = '/companies';
35-
} else if (!!matchPath('/deals/*', location.pathname)) {
35+
} else if (matchPath('/deals/*', location.pathname)) {
3636
currentPath = '/deals';
3737
} else {
3838
currentPath = false;

examples/crm/src/providers/commons/activity.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ export async function getActivityLog(
2222
companyId?: Identifier,
2323
salesId?: Identifier
2424
) {
25-
let companyFilter = {} as any;
25+
const companyFilter = {} as any;
2626
if (companyId) {
2727
companyFilter.id = companyId;
2828
} else if (salesId) {
2929
companyFilter['sales_id@in'] = `(${salesId})`;
3030
}
3131

32-
let filter = {} as any;
32+
const filter = {} as any;
3333
if (companyId) {
3434
filter.company_id = companyId;
3535
} else if (salesId) {
@@ -85,7 +85,7 @@ async function getNewContactsAndNotes(
8585
sort: { field: 'first_seen', order: 'DESC' },
8686
});
8787

88-
let recentContactNotesFilter = {} as any;
88+
const recentContactNotesFilter = {} as any;
8989
if (filter.sales_id) {
9090
recentContactNotesFilter.sales_id = filter.sales_id;
9191
}
@@ -135,7 +135,7 @@ async function getNewDealsAndNotes(
135135
sort: { field: 'created_at', order: 'DESC' },
136136
});
137137

138-
let recentDealNotesFilter = {} as any;
138+
const recentDealNotesFilter = {} as any;
139139
if (filter.sales_id) {
140140
recentDealNotesFilter.sales_id = filter.sales_id;
141141
}

examples/crm/src/providers/commons/getContactAvatar.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import { Contact } from '../../types';
99
import { getContactAvatar, hash } from './getContactAvatar';
1010

11-
// eslint-disable-next-line no-global-assign
1211
import { webcrypto } from 'node:crypto';
1312

1413
Object.defineProperty(globalThis, 'crypto', {

examples/crm/src/tasks/Task.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const Task = ({
160160
</ListItemIcon>
161161
<ListItemText
162162
sx={{
163-
textDecoration: !!task.done_date
163+
textDecoration: task.done_date
164164
? 'line-through'
165165
: 'none',
166166
}}

examples/data-generator/src/finalize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { weightedBoolean } from './utils';
44
export default function (db: Db) {
55
// set latest purchase date
66
db.orders.forEach(order => {
7-
let customer = db.customers[order.customer_id];
7+
const customer = db.customers[order.customer_id];
88
if (
99
!customer.latest_purchase ||
1010
customer.latest_purchase < order.date
@@ -64,7 +64,7 @@ export default function (db: Db) {
6464

6565
// add 'reviewer' group
6666
db.reviews.forEach(review => {
67-
let customer = db.customers[review.customer_id];
67+
const customer = db.customers[review.customer_id];
6868
if (customer.groups.indexOf('reviewer') === -1) {
6969
customer.groups.push('reviewer');
7070
}

examples/demo/src/dataProvider/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fakeServerFactory from '../fakeServer';
44
export default (type: string) => {
55
// The fake servers require to generate data, which can take some time.
66
// Here we start the server initialization but we don't wait for it to finish
7-
let dataProviderPromise = getDataProvider(type);
7+
const dataProviderPromise = getDataProvider(type);
88

99
// Instead we return this proxy which may be called immediately by react-admin if the
1010
// user is already signed-in. In this case, we simply wait for the dataProvider promise

examples/demo/src/reviews/ReviewList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const ReviewList = () => {
6060
theme.transitions.create(['all'], {
6161
duration: theme.transitions.duration.enteringScreen,
6262
}),
63-
marginRight: !!match ? '400px' : 0,
63+
marginRight: match ? '400px' : 0,
6464
}}
6565
filters={reviewFilters}
6666
perPage={25}
@@ -73,7 +73,7 @@ const ReviewList = () => {
7373
) : (
7474
<ReviewListDesktop
7575
selectedRow={
76-
!!match
76+
match
7777
? parseInt((match as any).params.id, 10)
7878
: undefined
7979
}

packages/ra-core/src/controller/edit/useEditController.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ describe('useEditController', () => {
11201120
});
11211121

11221122
it('should return errors from the update call in pessimistic mode', async () => {
1123-
let post = { id: 12 };
1123+
const post = { id: 12 };
11241124
jest.spyOn(console, 'error').mockImplementationOnce(() => {});
11251125
const update = jest.fn().mockImplementationOnce(() => {
11261126
return Promise.reject({ body: { errors: { foo: 'invalid' } } });

0 commit comments

Comments
 (0)