Skip to content

Commit a2e9477

Browse files
committed
lint
1 parent 8e757bb commit a2e9477

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

src/ast-resolver.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { ContractDefinition } from 'solidity-ast';
2-
import { findAll, astDereferencer, ASTDereferencer, ASTDereferencerError } from 'solidity-ast/utils';
2+
import {
3+
astDereferencer,
4+
ASTDereferencer,
5+
ASTDereferencerError,
6+
} from 'solidity-ast/utils';
37
import { NodeType, NodeTypeMap } from 'solidity-ast/node';
48

59
import { SolcOutput } from './solc/input-output';

src/transformations/purge-var-inits.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { hasConstructorOverride, hasOverride } from '../utils/upgrades-overrides
66

77
import { Transformation } from './type';
88

9-
export function* removeStateVarInits(sourceUnit: SourceUnit, { resolver }: TransformerTools): Generator<Transformation> {
9+
export function* removeStateVarInits(
10+
sourceUnit: SourceUnit,
11+
{ resolver }: TransformerTools,
12+
): Generator<Transformation> {
1013
for (const contractNode of findAll('ContractDefinition', sourceUnit)) {
1114
if (hasConstructorOverride(contractNode)) {
1215
continue;

src/transformations/remove-immutable.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import { hasOverride } from '../utils/upgrades-overrides';
66

77
import { Transformation } from './type';
88

9-
export function* removeImmutable(sourceUnit: SourceUnit, { resolver }: TransformerTools): Generator<Transformation> {
9+
export function* removeImmutable(
10+
sourceUnit: SourceUnit,
11+
{ resolver }: TransformerTools,
12+
): Generator<Transformation> {
1013
for (const varDecl of findAll('VariableDeclaration', sourceUnit)) {
1114
if (varDecl.mutability === 'immutable') {
1215
if (hasOverride(varDecl, 'state-variable-immutable', resolver)) {

src/transformations/utils/get-initializer-items.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ export function getInitializerItems(contract: ContractDefinition, resolver: ASTR
88
const constructorNode = getConstructor(contract);
99

1010
const varInitNodes = [...findAll('VariableDeclaration', contract)].filter(
11-
v => v.stateVariable && v.value && !v.constant && !hasOverride(v, 'state-variable-assignment', resolver),
11+
v =>
12+
v.stateVariable &&
13+
v.value &&
14+
!v.constant &&
15+
!hasOverride(v, 'state-variable-assignment', resolver),
1216
);
1317

1418
const modifiers =

src/utils/upgrades-overrides.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ const errorKinds = [
1818

1919
type ValidationErrorKind = (typeof errorKinds)[number];
2020

21-
export function hasOverride(node: Node, override: ValidationErrorKind, resolver: ASTResolver): boolean {
21+
export function hasOverride(
22+
node: Node,
23+
override: ValidationErrorKind,
24+
resolver: ASTResolver,
25+
): boolean {
2226
return getOverrides(node, resolver).includes(override);
2327
}
2428

0 commit comments

Comments
 (0)