Skip to content

Commit 0fde190

Browse files
committed
chore: eslint upgrade and lint fixes
1 parent 6910440 commit 0fde190

File tree

26 files changed

+8398
-6731
lines changed

26 files changed

+8398
-6731
lines changed

benchmark/utils.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import fs from 'fs/promises'
22

3-
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
43
export async function readJson(path) {
54
const data = await fs.readFile(path, 'utf8')
65
return JSON.parse(data)

e2e/helper.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ export function getDom(html: string) {
5151
}
5252

5353
export function getDataFromDom(dom: Document, selector: string) {
54-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
5554
return JSON.parse(
5655
dom.querySelector(selector)!.textContent!.replace('"', '"')
5756
)
@@ -66,7 +65,7 @@ export function assertLocaleHeadWithDom(dom: Document, headSelector: string) {
6665
if (key === 'id') {
6766
continue
6867
}
69-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
68+
7069
const v = tag!.getAttribute(key)
7170
if (v !== value) {
7271
throw new Error(`${key} ${v} !== ${value}`)

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@
9595
"bumpp": "^9.3.0",
9696
"cross-env": "^7.0.3",
9797
"esbuild-register": "^3.5.0",
98-
"eslint": "^8.57.0",
98+
"eslint": "^9.1.0",
9999
"eslint-config-prettier": "^9.1.0",
100-
"eslint-plugin-vue": "^9.24.0",
100+
"eslint-plugin-vue": "^9.25.0",
101101
"execa": "^5.0.0",
102102
"fixpack": "^4.0.0",
103103
"globals": "^15.0.0",
@@ -173,7 +173,7 @@
173173
"secretlint"
174174
]
175175
},
176-
"packageManager": "pnpm@8.9.2",
176+
"packageManager": "pnpm@9.0.4",
177177
"pnpm": {
178178
"overrides": {
179179
"vue": "3.4.20",

packages/core-base/src/context.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export type LocaleMessages<
116116
*
117117
* @VueI18nGeneral
118118
*/
119-
export interface DefineCoreLocaleMessage extends LocaleMessage<string> {} // eslint-disable-line @typescript-eslint/no-empty-interface
119+
export interface DefineCoreLocaleMessage extends LocaleMessage<string> {}
120120

121121
export type DefaultCoreLocaleMessageSchema<
122122
Schema = RemoveIndexSignature<{
@@ -252,7 +252,7 @@ export interface CoreOptions<
252252
export interface CoreInternalOptions {
253253
__datetimeFormatters?: Map<string, Intl.DateTimeFormat>
254254
__numberFormatters?: Map<string, Intl.NumberFormat>
255-
__v_emitter?: VueDevToolsEmitter // eslint-disable-line camelcase
255+
__v_emitter?: VueDevToolsEmitter
256256
__meta?: MetaInfo
257257
}
258258

@@ -327,7 +327,7 @@ export interface CoreInternalContext {
327327
__datetimeFormatters: Map<string, Intl.DateTimeFormat>
328328
__numberFormatters: Map<string, Intl.NumberFormat>
329329
__localeChainCache?: Map<Locale, Locale[]>
330-
__v_emitter?: VueDevToolsEmitter // eslint-disable-line camelcase
330+
__v_emitter?: VueDevToolsEmitter
331331
__meta: MetaInfo // for Intlify DevTools
332332
}
333333

packages/core-base/src/fallbacker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export type LocaleFallbacker = <Message = string>(
8787
export function fallbackWithSimple<Message = string>(
8888
ctx: CoreContext<Message>,
8989
fallback: FallbackLocale,
90-
start: Locale // eslint-disable-line @typescript-eslint/no-unused-vars
90+
start: Locale
9191
): Locale[] {
9292
// prettier-ignore
9393
return [...new Set(

packages/format-explorer/src/shims-vue.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
declare module '*.vue' {
22
import { DefineComponent } from 'vue'
3-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
3+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
44
const component: DefineComponent<{}, {}, any>
55
// @ts-ignore
66
export default component

packages/message-compiler/src/generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function generateNode(generator: CodeGenerator, node: Node): void {
284284
// generate code from AST
285285
export const generate = (
286286
ast: ResourceNode,
287-
options: CodeGenOptions = {} // eslint-disable-line
287+
options: CodeGenOptions = {}
288288
): CodeGenResult => {
289289
const mode = isString(options.mode) ? options.mode : 'normal'
290290
const filename = isString(options.filename)

packages/message-compiler/src/scanner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function createScanner(str: string): Scanner {
7979

8080
function skipToPeek(): void {
8181
const target = _index + _peekOffset
82-
// eslint-disable-next-line no-unmodified-loop-condition
82+
8383
while (target !== _index) {
8484
next()
8585
}

packages/message-compiler/src/tokenizer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ export function createTokenizer(
481481

482482
function readText(scnr: Scanner): string {
483483
let buf = ''
484-
// eslint-disable-next-line no-constant-condition
484+
485485
while (true) {
486486
const ch = scnr.currentChar()
487487
if (

packages/shared/src/messages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isArray, isObject } from './utils'
22

33
const isNotObjectOrIsArray = (val: unknown) => !isObject(val) || isArray(val)
4-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
4+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
55
export function deepCopy(src: any, des: any): void {
66
// src and des should both be objects, and none of them can be a array
77
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {

0 commit comments

Comments
 (0)