Skip to content

Commit 8c77ea5

Browse files
chore(deps): update devdependency eslint to v9 (#178)
* chore(deps): update devdependency eslint to v9 * up --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Farnabaz <[email protected]>
1 parent bb715b4 commit 8c77ea5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+582
-522
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/scripts/bump-edge.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { execSync } from 'node:child_process'
22
import { inc } from 'semver'
33
import { determineBumpType, loadWorkspace } from './utils'
44

5-
async function main () {
5+
async function main() {
66
const workspace = await loadWorkspace(process.cwd())
77

88
const commit = execSync('git rev-parse --short HEAD').toString('utf-8').trim().slice(0, 8)

.github/scripts/utils.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@ import { execaSync } from 'execa'
55
import { determineSemverChange, getGitDiff, loadChangelogConfig, parseCommits } from 'changelogen'
66

77
export interface Dep {
8-
name: string,
9-
range: string,
8+
name: string
9+
range: string
1010
type: string
1111
}
1212

1313
type ThenArg<T> = T extends PromiseLike<infer U> ? U : T
1414
export type Package = ThenArg<ReturnType<typeof loadPackage>>
1515

16-
export async function loadPackage (dir: string) {
16+
export async function loadPackage(dir: string) {
1717
const pkgPath = resolve(dir, 'package.json')
1818
const data = JSON.parse(await fsp.readFile(pkgPath, 'utf-8').catch(() => '{}'))
1919
const save = () => fsp.writeFile(pkgPath, JSON.stringify(data, null, 2) + '\n')
2020

2121
const updateDeps = (reviver: (dep: Dep) => Dep | void) => {
2222
for (const type of ['dependencies', 'devDependencies', 'optionalDependencies', 'peerDependencies']) {
23-
if (!data[type]) { continue }
23+
if (!data[type]) {
24+
continue
25+
}
2426
for (const e of Object.entries(data[type])) {
2527
const dep: Dep = { name: e[0], range: e[1] as string, type }
2628
delete data[type][dep.name]
@@ -39,15 +41,17 @@ export async function loadPackage (dir: string) {
3941
}
4042
}
4143

42-
export async function loadWorkspace (dir: string) {
44+
export async function loadWorkspace(dir: string) {
4345
const workspacePkg = await loadPackage(dir)
4446
const pkgDirs = (await globby(['packages/*'], { onlyDirectories: true })).sort()
4547

4648
const packages: Package[] = []
4749

4850
for (const pkgDir of pkgDirs) {
4951
const pkg = await loadPackage(pkgDir)
50-
if (!pkg.data.name) { continue }
52+
if (!pkg.data.name) {
53+
continue
54+
}
5155
packages.push(pkg)
5256
}
5357

@@ -73,7 +77,9 @@ export async function loadWorkspace (dir: string) {
7377

7478
const setVersion = (name: string, newVersion: string, opts: { updateDeps?: boolean } = {}) => {
7579
find(name).data.version = newVersion
76-
if (!opts.updateDeps) { return }
80+
if (!opts.updateDeps) {
81+
return
82+
}
7783

7884
for (const pkg of packages) {
7985
pkg.updateDeps((dep) => {
@@ -97,7 +103,7 @@ export async function loadWorkspace (dir: string) {
97103
}
98104
}
99105

100-
export async function determineBumpType () {
106+
export async function determineBumpType() {
101107
const config = await loadChangelogConfig(process.cwd())
102108
const commits = await getLatestCommits()
103109

@@ -106,7 +112,7 @@ export async function determineBumpType () {
106112
return bumpType === 'major' ? 'minor' : bumpType
107113
}
108114

109-
export async function getLatestCommits () {
115+
export async function getLatestCommits() {
110116
const config = await loadChangelogConfig(process.cwd())
111117

112118
let latestRef

build.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
import fs from 'node:fs'
12
import { defineBuildConfig } from 'unbuild'
2-
import fs from 'fs'
33

44
export default defineBuildConfig({
55
entries: [
6-
'src/config.ts',
6+
'src/config.ts'
77
],
88
hooks: {
99
'rollup:done': () => {

docs/.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ module.exports = {
55
'vue/max-attributes-per-line': 'off',
66
'vue/multi-word-component-names': 'off'
77
}
8-
}
8+
}

docs/app.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ export default defineAppConfig({
4343

4444
titleTemplate: 'Nuxt MDC'
4545
}
46-
})
46+
})

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"@nuxt/eslint-config": "^0.3.9",
1818
"@nuxtjs/plausible": "^1.0.0",
1919
"@types/node": "^20.12.7",
20-
"eslint": "^8.57.0",
20+
"eslint": "^9.1.1",
2121
"nuxt": "^3.11.2"
2222
}
2323
}

eslint.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// @ts-check
2+
import { createConfigForNuxt } from '@nuxt/eslint-config/flat'
3+
4+
export default createConfigForNuxt({
5+
features: {
6+
tooling: true,
7+
stylistic: {
8+
quoteProps: 'as-needed',
9+
commaDangle: 'never',
10+
braceStyle: '1tbs'
11+
}
12+
},
13+
dirs: {
14+
src: [
15+
'./playground',
16+
'./docs'
17+
]
18+
}
19+
}).overrideRules({
20+
'@typescript-eslint/no-explicit-any': 'off',
21+
'@typescript-eslint/no-invalid-void-type': 'off',
22+
'@typescript-eslint/no-dynamic-delete': 'off',
23+
'vue/max-attributes-per-line': 'off',
24+
'vue/no-v-html': 'off',
25+
'vue/multi-word-component-names': 'off'
26+
})

nuxt.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { fileURLToPath } from 'url'
1+
import { fileURLToPath } from 'node:url'
22

33
export default defineNuxtConfig({
44
typescript: {
@@ -7,7 +7,7 @@ export default defineNuxtConfig({
77
paths: {
88
'@nuxtjs/mdc/config': [
99
fileURLToPath(new URL('./src/config.ts', import.meta.url))
10-
],
10+
]
1111
}
1212
}
1313
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"@types/mdurl": "^1.0.5",
117117
"@types/node": "^20.12.7",
118118
"changelogen": "^0.5.5",
119-
"eslint": "^8.57.0",
119+
"eslint": "^9.1.1",
120120
"nuxt": "^3.11.2",
121121
"rehype": "^13.0.1",
122122
"release-it": "^17.2.0",

playground/nuxt.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@ export default defineNuxtConfig({
33
'@nuxt/ui',
44
'../src/module'
55
],
6-
// @ts-ignore
76
mdc: {
87
highlight: {
98
theme: {
109
default: 'vitesse-light',
11-
dark: 'material-theme-palenight',
10+
dark: 'material-theme-palenight'
1211
},
1312
preload: [
1413
'sql'

0 commit comments

Comments
 (0)