Skip to content

Commit 903e83f

Browse files
committed
chore: some lint fixes
Signed-off-by: Tomás Migone <[email protected]>
1 parent f129d36 commit 903e83f

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

eslint.config.mjs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ export function getGitignorePatterns(customGitignorePath = null) {
126126
return translateGitignorePatterns(gitignorePath, repoRoot)
127127
}
128128

129-
export default [
129+
/** @type {import('eslint').Linter.Config[]} */
130+
const eslintConfig = [
130131
// Include .gitignore patterns
131132
includeGitignore(),
132133

@@ -270,4 +271,6 @@ export default [
270271
{
271272
files: ['packages/**/*.{js,ts,cjs,mjs,jsx,tsx}'],
272273
},
273-
]
274+
]
275+
276+
export default eslintConfig

packages/solhint-plugin-graph/index.js

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ function isUpperSnakeCase(text) {
1515
}
1616

1717
class Base {
18-
constructor(reporter, config, source, fileName) {
19-
this.ignoreDeprecated = true;
20-
this.deprecatedPrefix = '__DEPRECATED_';
21-
this.underscorePrefix = '__';
22-
this.reporter = reporter;
23-
this.ignored = this.constructor.global;
24-
this.ruleId = this.constructor.ruleId;
18+
constructor(reporter, _config, _source, _fileName) {
19+
this.ignoreDeprecated = true
20+
this.deprecatedPrefix = '__DEPRECATED_'
21+
this.underscorePrefix = '__'
22+
this.reporter = reporter
23+
this.ignored = this.constructor.global
24+
this.ruleId = this.constructor.ruleId
2525
if (this.ruleId === undefined) {
26-
throw Error('missing ruleId static property');
26+
throw Error('missing ruleId static property')
2727
}
2828
}
2929

3030
error(node, message, fix) {
3131
if (!this.ignored) {
32-
this.reporter.error(node, this.ruleId, message, fix);
32+
this.reporter.error(node, this.ruleId, message, fix)
3333
}
3434
}
3535
}
3636

3737
module.exports = [
3838
class extends Base {
39-
static ruleId = 'leading-underscore';
39+
static ruleId = 'leading-underscore'
4040

4141
ContractDefinition(node) {
4242
if (node.kind === 'library') {
@@ -65,7 +65,6 @@ module.exports = [
6565

6666
this.validateName(node, 'variable')
6767
}
68-
6968
}
7069

7170
FunctionDefinition(node) {
@@ -78,7 +77,6 @@ module.exports = [
7877
}
7978

8079
this.validateName(node, 'function')
81-
8280
}
8381
}
8482

@@ -104,7 +102,7 @@ module.exports = [
104102

105103
fixStatement(node, shouldHaveLeadingUnderscore, type) {
106104
let range
107-
105+
108106
if (type === 'function') {
109107
range = node.range
110108
range[0] += 8
@@ -114,42 +112,42 @@ module.exports = [
114112
range = node.identifier.range
115113
range[0] -= 1
116114
}
117-
115+
118116
return (fixer) =>
119117
shouldHaveLeadingUnderscore
120118
? fixer.insertTextBeforeRange(range, ' _')
121119
: fixer.removeRange([range[0] + 1, range[0] + 1])
122120
}
123121

124-
_error(node, name, shouldHaveLeadingUnderscore, type) {
122+
_error(node, name, shouldHaveLeadingUnderscore, _type) {
125123
this.error(
126124
node,
127-
`'${name}' ${shouldHaveLeadingUnderscore ? 'should' : 'should not'} start with _`,
125+
`'${name}' ${shouldHaveLeadingUnderscore ? 'should' : 'should not'} start with _`,
128126
// this.fixStatement(node, shouldHaveLeadingUnderscore, type)
129127
)
130128
}
131129
},
132130
class extends Base {
133-
static ruleId = 'func-name-mixedcase';
131+
static ruleId = 'func-name-mixedcase'
134132

135133
FunctionDefinition(node) {
136134
// Allow __DEPRECATED_ prefixed functions and __ prefixed functions
137135
if (node.name.startsWith(this.deprecatedPrefix) || node.name.startsWith(this.underscorePrefix)) {
138136
return
139137
}
140138

141-
if (!isMixedCase(node.name) && !node.isConstructor) {
139+
if (!isMixedCase(node.name) && !node.isConstructor) {
142140
// Allow external functions to be in UPPER_SNAKE_CASE - for immutable state getters
143141
if (node.visibility === 'external' && isUpperSnakeCase(node.name)) {
144142
return
145143
}
146-
this.error(node, 'Function name must be in mixedCase',)
144+
this.error(node, 'Function name must be in mixedCase')
147145
}
148146
}
149147
},
150148
class extends Base {
151-
static ruleId = 'var-name-mixedcase';
152-
149+
static ruleId = 'var-name-mixedcase'
150+
153151
VariableDeclaration(node) {
154152
if (node.name.startsWith(this.deprecatedPrefix)) {
155153
return
@@ -158,7 +156,7 @@ module.exports = [
158156
this.validateVariablesName(node)
159157
}
160158
}
161-
159+
162160
validateVariablesName(node) {
163161
if (node.name.startsWith(this.deprecatedPrefix)) {
164162
return
@@ -167,6 +165,5 @@ module.exports = [
167165
this.error(node, 'Variable name must be in mixedCase')
168166
}
169167
}
170-
}
171-
172-
];
168+
},
169+
]

packages/token-distribution/scripts/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const path = require('path')
1818

1919
// Check for STUDIO_API_KEY
2020
if (!process.env.STUDIO_API_KEY) {
21-
console.log('Warning: STUDIO_API_KEY is not set. Skipping build steps. Some functionality may be limited.')
22-
process.exit(0)
21+
console.log('Warning: STUDIO_API_KEY is not set. Skipping build steps. Some functionality may be limited.')
22+
process.exit(0)
2323
}
2424

2525
// Get the directory name

0 commit comments

Comments
 (0)