Skip to content

Commit 565c72f

Browse files
cmdcolinclaude
andcommitted
Replace eslint-plugin-import with eslint-plugin-import-x
Modern fork with better performance and fewer dependencies. Updates eslint config to use import-x rules. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 84139dd commit 565c72f

7 files changed

Lines changed: 284 additions & 1194 deletions

File tree

eslint.config.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import eslint from '@eslint/js'
22
import { defineConfig } from 'eslint/config'
3-
import importPlugin from 'eslint-plugin-import'
3+
import importPlugin from 'eslint-plugin-import-x'
44
import eslintPluginUnicorn from 'eslint-plugin-unicorn'
55
import tseslint from 'typescript-eslint'
66

@@ -98,9 +98,9 @@ export default defineConfig(
9898
// keep off: non-null assertions are used intentionally on bounds-checked array access
9999
'@typescript-eslint/no-non-null-assertion': 'off',
100100

101-
'import/no-unresolved': 'off',
102-
'import/extensions': ['error', 'ignorePackages'],
103-
'import/order': [
101+
'import-x/no-unresolved': 'off',
102+
'import-x/extensions': ['error', 'ignorePackages'],
103+
'import-x/order': [
104104
'error',
105105
{
106106
named: true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"@typescript-eslint/parser": "^8.59.0",
5151
"@vitest/coverage-v8": "^4.1.5",
5252
"eslint": "^10.2.1",
53-
"eslint-plugin-import": "^2.32.0",
53+
"eslint-plugin-import-x": "^4.16.2",
5454
"eslint-plugin-unicorn": "^64.0.0",
5555
"prettier": "^3.8.3",
5656
"puppeteer": "^24.42.0",

pnpm-lock.yaml

Lines changed: 262 additions & 1172 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bgzFilehandle.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ export default class BgzFilehandle {
5555
blockNum += 1
5656
) {
5757
const uncompressedBuffer = await this._readAndUncompressBlock(
58-
blockPositions[blockNum]![0],
59-
blockPositions[blockNum + 1]![0],
58+
blockPositions[blockNum][0],
59+
blockPositions[blockNum + 1][0],
6060
)
61-
const [, uncompressedPosition] = blockPositions[blockNum]!
61+
const [, uncompressedPosition] = blockPositions[blockNum]
6262
const sourceOffset =
6363
uncompressedPosition >= position ? 0 : position - uncompressedPosition
6464
const sourceEnd =

src/gziIndex.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default class GziIndex {
9393

9494
let comparison = compare(
9595
position,
96-
entries[searchPosition]!,
96+
entries[searchPosition],
9797
entries[searchPosition + 1],
9898
)
9999
while (comparison !== 0) {
@@ -105,17 +105,17 @@ export default class GziIndex {
105105
searchPosition = Math.ceil((upperBound - lowerBound) / 2) + lowerBound
106106
comparison = compare(
107107
position,
108-
entries[searchPosition]!,
108+
entries[searchPosition],
109109
entries[searchPosition + 1],
110110
)
111111
}
112112

113113
// here's where we read forward
114-
relevant.push(entries[searchPosition]!)
114+
relevant.push(entries[searchPosition])
115115
let i = searchPosition + 1
116116
for (; i < entries.length; i += 1) {
117-
relevant.push(entries[i]!)
118-
if (entries[i]![UNCOMPRESSED_POSITION] >= endPosition) {
117+
relevant.push(entries[i])
118+
if (entries[i][UNCOMPRESSED_POSITION] >= endPosition) {
119119
break
120120
}
121121
}

src/long.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL
33

44
export function longFromBytesToUnsigned(source: Uint8Array, i = 0) {
55
const low =
6-
source[i]! |
7-
(source[i + 1]! << 8) |
8-
(source[i + 2]! << 16) |
9-
(source[i + 3]! << 24)
6+
source[i] |
7+
(source[i + 1] << 8) |
8+
(source[i + 2] << 16) |
9+
(source[i + 3] << 24)
1010
const high =
11-
source[i + 4]! |
12-
(source[i + 5]! << 8) |
13-
(source[i + 6]! << 16) |
14-
(source[i + 7]! << 24)
11+
source[i + 4] |
12+
(source[i + 5] << 8) |
13+
(source[i + 6] << 16) |
14+
(source[i + 7] << 24)
1515
return (high >>> 0) * TWO_PWR_32_DBL + (low >>> 0)
1616
}

test/unzip.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ test('cpositions increment correctly from large starting position', async () =>
171171

172172
// Subsequent positions should be increasing
173173
for (let i = 1; i < cpositions.length; i++) {
174-
expect(cpositions[i]).toBeGreaterThan(cpositions[i - 1]!)
174+
expect(cpositions[i]).toBeGreaterThan(cpositions[i - 1])
175175
}
176176

177177
// All positions should be large (>5TB)

0 commit comments

Comments
 (0)