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

Add eslint rule for unnecessary backticks #470

Merged
merged 1 commit into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
},
"plugins": ["simple-import-sort", "no-only-tests", "unused-imports"],
"rules": {
"quotes": [
"error",
"single",
{ "avoidEscape": true, "allowTemplateLiterals": false }
],
"@typescript-eslint/ban-tslint-comment": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-extra-semi": "off",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ describe(ForcedTradeOfferController.name, () => {

expect(await controller.cancelOffer(1, '123')).toEqual({
type: 'not found',
message: `Offer #1 does not exist`,
message: 'Offer #1 does not exist',
})
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export class TransactionSubmitController {
return fetched.controllerResult
}
if (!tradeMatchesOffer(offer, fetched.data)) {
return { type: 'bad request', message: `Trade does not match offer` }
return { type: 'bad request', message: 'Trade does not match offer' }
}

// TODO: cross repository transaction
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/core/FreezeCheckService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ export class FreezeCheckService {
'function FREEZE_GRACE_PERIOD() view returns (uint256)'
)
if (err) {
this.logger.error(`Failed calling FREEZE_GRACE_PERIOD()`)
this.logger.error('Failed calling FREEZE_GRACE_PERIOD()')
throw err
}
if (freezeGracePeriod === undefined) {
throw new Error(
`Failed calling FREEZE_GRACE_PERIOD(): received undefined`
'Failed calling FREEZE_GRACE_PERIOD(): received undefined'
)
}
return freezeGracePeriod.toNumber()
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/TransactionHistory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ describe(TransactionHistory.name, () => {
)
})

it(`returns [INCLUDED, ...previousRegularTransactionHistoryResults] if userTransaction is included`, () => {
it('returns [INCLUDED, ...previousRegularTransactionHistoryResults] if userTransaction is included', () => {
const forcedTradeOffer = fakeOffer()
const sentTransaction = fakeSentTransaction()
const userTransaction = fakeUserTransaction({
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/core/TransactionValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class TransactionValidator {
isSuccess: false,
controllerResult: {
type: 'bad request',
message: `Invalid transaction`,
message: 'Invalid transaction',
},
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { LogTokenRegistered } from './events'
const ETH_SELECTOR = '0x8322fff2'
const ERC20_SELECTOR = '0xf47261b0'
const ERC721_SELECTOR = '0x02571792'
const ERC1155_SELECTOR = `0x3348691d`
const ERC1155_SELECTOR = '0x3348691d'
const MINTABLE_ERC721_SELECTOR = '0xb8b86672'
const MINTABLE_ERC20_SELECTOR = '0x68646e2d'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class FeederGatewayCollector {
throw new Error(`State update ${stateUpdateId} not found`)
}

this.logger.info(`Collecting transactions from Feeder Gateway`, {
this.logger.info('Collecting transactions from Feeder Gateway', {
stateUpdateId: stateUpdate.id,
})

Expand Down
2 changes: 1 addition & 1 deletion packages/encoding/src/encoding/encodeState.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(encodeStateAsInt256Array.name, () => {
// encodeState is tested in encodeOnchainData.test.ts
})

it(`properly serialized state`, () => {
it('properly serialized state', () => {
const result = encodeStateAsInt256Array(newState)
expect(result).toEqual([
4855295734011000137694901532041540081493925748614200896918173841152119144448n,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function PerpetualL2TransactionsTable(
props: PerpetualL2TransactionsTableProps
) {
const columns: Column[] = [
{ header: `ID` },
{ header: 'ID' },
{ header: 'Type' },
{ header: 'Status' },
{ header: 'Age' },
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/old/FinalizeExitData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function encodeFinalizeExitRequest(starkKey: StarkKey) {
return coder.encodeFunctionData('withdraw', [
starkKey.toString(),
//hardcoded just because it will take time to pass collateral asset to this function and it is going to be removed soon
`0x02893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d`,
'0x02893294412a4c8f915f75892b395ebbf6859ec246ec365c3b1f56f47c3a0a5d',
])
}

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/toSignableCancelOffer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { toSignableCancelOffer } from './toSignableCancelOffer'
describe(toSignableCancelOffer.name, () => {
it('works properly', () => {
expect(toSignableCancelOffer(1)).toEqual(
['{', ` "cancel": true,`, ` "offerId": 1`, '}'].join('\n')
['{', ' "cancel": true,', ' "offerId": 1', '}'].join('\n')
)
})
})