Skip to content

Commit 13f6121

Browse files
authored
ref(eslint): Set no-unsafe-return and no-var-requires to error (#890)
* ref(eslint): Set `no-unsafe-return` and `no-var-requires` to `error` * additional fix
1 parent e246565 commit 13f6121

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ module.exports = {
6161
'@typescript-eslint/no-unsafe-member-access': 'warn',
6262
'@typescript-eslint/no-unsafe-assignment': 'warn',
6363
'@typescript-eslint/no-unsafe-argument': 'warn',
64-
'@typescript-eslint/no-unsafe-return': 'warn',
65-
'@typescript-eslint/no-var-requires': 'off',
64+
'@typescript-eslint/no-unsafe-return': 'error',
65+
'@typescript-eslint/no-var-requires': 'error',
6666
// '@typescript-eslint/restrict-template-expressions': 'warn',
6767
'@typescript-eslint/no-unused-vars': [
6868
'error',

lib/Helper/File.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ const IGNORE_PATTERN = ['node_modules/**', 'ios/Pods/**', '**/Pods/**'];
55

66
export function patchMatchingFile(
77
globPattern: string,
8-
func: any,
9-
...args: any[]
8+
func: (content: string, match: string, ...args: unknown[]) => void,
9+
...args: unknown[]
1010
): Promise<void> {
1111
const matches = glob.sync(globPattern, {
1212
ignore: IGNORE_PATTERN,

src/telemetry.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ function createSentryInstance(enabled: boolean, integration: string) {
109109
hub.setTag('platform', process.platform);
110110

111111
try {
112+
// The `require` call here is fine because the binary node versions
113+
// support `require` and we try/catch the call anyway for any other
114+
// version of node.
115+
// eslint-disable-next-line @typescript-eslint/no-var-requires
112116
const sea = require('node:sea') as { isSea: () => boolean };
113117
hub.setTag('is_binary', sea.isSea());
114118
} catch {

0 commit comments

Comments
 (0)