Skip to content

Commit

Permalink
Merge branch 'edit_eslint_config'
Browse files Browse the repository at this point in the history
  • Loading branch information
tamuratak committed Oct 22, 2024
2 parents 8d415bf + 706f396 commit 1c1dd11
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 15 deletions.
15 changes: 3 additions & 12 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ const commonRules = {
}],
"no-shadow": "off",
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unsafe-argument": "error",
"@typescript-eslint/no-unsafe-assignment": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-return": "error",
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
Expand All @@ -41,15 +35,12 @@ const commonRules = {
"ignoreRestSiblings": true
}
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/no-unsafe-enum-comparison": "off",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-readonly": "error",
"no-return-await": "off",
"@typescript-eslint/return-await": "error",
"require-await": "off",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"@typescript-eslint/unbound-method": "error",
"@typescript-eslint/restrict-template-expressions": "off",
"curly": "error",
"default-case": "error",
"eol-last": "error",
Expand Down Expand Up @@ -109,7 +100,7 @@ export default tseslint.config(
],
},
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.stylistic,
{
languageOptions: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export class LabelDefinitionUpdater {
return this.getRefFromNodeArray(node.args, lines)
}
if (latexParser.isLstlisting(node)) {
const arg = (node as latexParser.Lstlisting).arg
const arg = node.arg
if (arg) {
return this.getRefFromNode(arg, lines)
}
Expand Down
1 change: 1 addition & 0 deletions src/components/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ export class Server {
}
} catch (err: unknown) {
if (err instanceof vscode.FileSystemError || err instanceof Error) {
/* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
const code = (err as any)?.code as unknown
if (code === 'FileNotFound' || code === 'ENOENT') {
response.writeHead(404)
Expand Down
1 change: 1 addition & 0 deletions src/providers/atsuggestionlib/atsuggestion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export class AtSuggestion implements IProvider {
const filteredSuggestions = suggestions.filter(item => item.label === result[0])
if (filteredSuggestions.length > 0) {
return filteredSuggestions.map(item => {
/* eslint-disable-next-line @typescript-eslint/no-base-to-string */
item.range = new vscode.Range(args.position.translate(undefined, -item.label.toString().length), args.position)
return item
})
Expand Down
1 change: 1 addition & 0 deletions src/providers/completionlib/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface CmdSignature {
}

function isCmdItemEntry(obj: any): obj is CmdItemEntry {
/* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
return (typeof obj.command === 'string') && (typeof obj.snippet === 'string')
}

Expand Down
1 change: 1 addition & 0 deletions src/providers/completionlib/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface EnvItemEntry {
}

function isEnvItemEntry(obj: any): obj is EnvItemEntry {
/* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access */
return (typeof obj.name === 'string')
}

Expand Down
1 change: 1 addition & 0 deletions test/build.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function run(): Promise<void> {
})
} catch (e) {
console.error(e)
/* eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors */
reject(e)
}
})
Expand Down
1 change: 1 addition & 0 deletions test/completion.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function run(): Promise<void> {
})
} catch (e) {
console.error(e)
/* eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors */
reject(e)
}
})
Expand Down
1 change: 1 addition & 0 deletions test/multiroot-ws.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function run(): Promise<void> {
})
} catch (e) {
console.error(e)
/* eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors */
reject(e)
}
})
Expand Down
1 change: 1 addition & 0 deletions test/rootfile.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function run(): Promise<void> {
})
} catch (e) {
console.error(e)
/* eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors */
reject(e)
}
})
Expand Down
1 change: 1 addition & 0 deletions test/unittest.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function run(): Promise<void> {
})
} catch (e) {
console.error(e)
/* eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors */
reject(e)
}
})
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/components/linter.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access */

import * as vscode from 'vscode'
import * as fs from 'node:fs'
Expand Down
2 changes: 1 addition & 1 deletion test/unittests/providers/structure.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access */

import * as vscode from 'vscode'
import * as path from 'node:path'
Expand Down
1 change: 1 addition & 0 deletions test/viewer.index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export function run(): Promise<void> {
})
} catch (e) {
console.error(e)
/* eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors */
reject(e)
}
})
Expand Down
1 change: 1 addition & 0 deletions viewer/components/extensionconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ class ConnectionPort {
const server = `${scheme}://${window.location.hostname}:${window.location.port}`
const sock = new WebSocket(server)
sock.addEventListener('open', () => this.socketPromise.resolve(sock) )
/* eslint-disable-next-line @typescript-eslint/no-base-to-string */
sock.addEventListener('error', (ev) => this.socketPromise.reject(new Error(`Failed to connect to ${server}: ${ev}`)) )
this.startConnectionKeeper()
}
Expand Down

0 comments on commit 1c1dd11

Please sign in to comment.