Skip to content

Commit

Permalink
fix: No unused vars & correct linting script in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
LautaroPetaccio committed Mar 12, 2024
1 parent 3fb61c6 commit 63c915b
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: Install
run: npm install --legacy-peer-deps
- name: Lint
run: npm run lint
run: npm run check:code
1 change: 0 additions & 1 deletion webapp/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = {
'@typescript-eslint/no-floating-promises': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-floating-promises
'@typescript-eslint/no-unsafe-return': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unsafe-return
'@typescript-eslint/naming-convention': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/naming-convention/
'@typescript-eslint/no-unused-vars': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unused-vars
'@typescript-eslint/no-unnecessary-type-assertion': 'error', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/no-unnecessary-type-assertion
'@typescript-eslint/explicit-module-boundary-types': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/explicit-module-boundary-types
'@typescript-eslint/restrict-template-expressions': 'off', // TODO: migrate code progressively to remove this line. https://typescript-eslint.io/rules/restrict-template-expressions
Expand Down
1 change: 0 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"build": "tsc && node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build",
"test": "jest",
"test:coverage": "npm run test -- --coverage",
"lint": "eslint -c .eslintrc.cjs --ext .ts src",
"check:code": "eslint -c .eslintrc.cjs src",
"fix:code": "npm run check:code -- --fix",
"pre-commit:fix:code": "eslint -c .eslintrc.cjs --fix",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ const AssetCell = ({ asset, link: linkProp }: Props) => {
let subtitle: string | undefined

switch (asset.category) {
case NFTCategory.ESTATE:
case NFTCategory.ESTATE: {
subtitle = t('global.parcel_count', {
count: asset.data.estate!.parcels.length
})
break
case NFTCategory.PARCEL:
}
case NFTCategory.PARCEL: {
const { x, y } = asset.data.parcel!
subtitle = `${x},${y}`
break
}
}

const link = linkProp
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/lib/timer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('when the timer is running', () => {
describe("and the timer hasn't finished", () => {
it('should return isRunning as true', async () => {
const { result } = renderHook(() => useTimer(1200))
const [_, startTimer] = result.current
const [, startTimer] = result.current

act(() => {
startTimer()
Expand All @@ -38,7 +38,7 @@ describe('when the timer is running', () => {
it('should return isRunning as false', async () => {
runTimerAutomaticallyOnce()
const { result } = renderHook(() => useTimer(1200))
const [_, startTimer] = result.current
const [, startTimer] = result.current

act(() => {
startTimer()
Expand All @@ -53,7 +53,7 @@ describe('when the timer is running', () => {
describe('and the timer is re-started', () => {
it('should re-start the timeout procedure', () => {
const { result } = renderHook(() => useTimer(1200))
const [_, startTimer] = result.current
const [, startTimer] = result.current

act(() => {
startTimer()
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/modules/nft/hooks.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ describe('when the nft is not an estate', () => {

it('should return contractFingerprint as undefined', () => {
const { result } = renderHook(() => useFingerprint(nft))
const [_contract, _isLoading, contractFingerprint] = result.current
const [, , contractFingerprint] = result.current
expect(contractFingerprint).toBe(undefined)
})

it('should return loading as false', () => {
const { result } = renderHook(() => useFingerprint(nft))
const [_contract, isLoading] = result.current
const [, isLoading] = result.current
expect(isLoading).toBe(false)
})
})
Expand Down
3 changes: 3 additions & 0 deletions webapp/src/modules/vendor/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface NFTService<V extends VendorName> {
) => Promise<readonly [NFT<V>, Order | null, RentalListing | null]>
transfer: (wallet: Wallet | null, toAddress: string, nft: NFT<V>) => Promise<string>
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export class NFTService<V> {}

export interface OrderService<V extends VendorName> {
Expand All @@ -40,6 +41,7 @@ export interface OrderService<V extends VendorName> {
cancel: (wallet: Wallet | null, order: Order) => Promise<string>
canSell(): boolean
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export class OrderService<V> {}

export interface BidService<V extends VendorName> {
Expand All @@ -50,6 +52,7 @@ export interface BidService<V extends VendorName> {
accept: (wallet: Wallet | null, bid: Bid) => Promise<string>
cancel: (wallet: Wallet | null, bid: Bid) => Promise<string>
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export class BidService<V> {}

export interface ContractService {
Expand Down

0 comments on commit 63c915b

Please sign in to comment.