Skip to content

Commit

Permalink
chore(deps): update dependency @types/eslint to v9 (#5591)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency @types/eslint to v9

* Migrate configuration

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Lukas Taegert-Atkinson <[email protected]>
  • Loading branch information
renovate[bot] and lukastaegert authored Aug 19, 2024
1 parent 916bd62 commit 9625890
Show file tree
Hide file tree
Showing 86 changed files with 707 additions and 2,265 deletions.
166 changes: 0 additions & 166 deletions .eslintrc.js

This file was deleted.

2 changes: 1 addition & 1 deletion .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
'*.{ts,js}': ['eslint --fix --cache'],
'*.md': ['prettier --write'],
'*.{ts,js}': ['eslint --fix --cache']
};
3 changes: 2 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
"proseWrap": "never"
}
}
]
],
"plugins": ["prettier-plugin-organize-imports"]
}
1 change: 0 additions & 1 deletion browser/src/initWasm.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// eslint-disable-next-line import/no-unresolved
import init from '../../wasm/bindings_wasm';

export default async function initWasm() {
Expand Down
5 changes: 2 additions & 3 deletions browser/src/wasm.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// eslint-disable-next-line import/no-unresolved
export { parse, xxhashBase64Url, xxhashBase36, xxhashBase16 } from '../../wasm/bindings_wasm.js';
export { parse, xxhashBase16, xxhashBase36, xxhashBase64Url } from '../../wasm/bindings_wasm.js';

// eslint-disable-next-line import/no-unresolved
import { parse } from '../../wasm/bindings_wasm.js';

export async function parseAsync(
code: string,
allowReturnOutsideFunction: boolean,
Expand Down
2 changes: 1 addition & 1 deletion build-plugins/fs-events-replacement.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { RollupReplaceOptions } from '@rollup/plugin-replace';
import { readFile } from 'node:fs/promises';
import { exit } from 'node:process';
import type { RollupReplaceOptions } from '@rollup/plugin-replace';

const FSEVENTS_HANDLER = 'node_modules/chokidar/lib/fsevents-handler.js';
const FSEVENTS_REQUIRE = "require('fsevents')";
Expand Down
5 changes: 2 additions & 3 deletions cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import process from 'node:process';
import help from 'help.md';
import process from 'node:process';
import { version } from 'package.json';
import argParser from 'yargs-parser';
import { commandAliases } from '../src/utils/options/mergeOptions';
Expand All @@ -17,15 +17,14 @@ if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) {
console.log(`rollup v${version}`);
} else {
try {
// eslint-disable-next-line unicorn/prefer-module, @typescript-eslint/no-require-imports
// eslint-disable-next-line @typescript-eslint/no-require-imports
require('source-map-support').install();
} catch {
// do nothing
}

const promise = run(command);
if (command.forceExit) {
// eslint-disable-next-line unicorn/no-process-exit
promise.then(() => process.exit());
}
}
8 changes: 2 additions & 6 deletions cli/run/batchWarnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ export default function batchWarnings(command: Record<string, any>): BatchWarnin
};
}

const immediateHandlers: {
[code: string]: (warning: RollupLog) => void;
} = {
const immediateHandlers: Record<string, (warning: RollupLog) => void> = {
MISSING_NODE_BUILTINS(warning) {
title(`Missing shims for Node.js built-ins`);

Expand All @@ -111,9 +109,7 @@ const immediateHandlers: {
}
};

const deferredHandlers: {
[code: string]: (warnings: RollupLog[]) => void;
} = {
const deferredHandlers: Record<string, (warnings: RollupLog[]) => void> = {
CIRCULAR_DEPENDENCY(warnings) {
title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`);
const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings;
Expand Down
2 changes: 1 addition & 1 deletion cli/run/commandPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function getCamelizedPluginBaseName(pluginText: string): string {

async function requireOrImport(pluginPath: string): Promise<any> {
try {
// eslint-disable-next-line unicorn/prefer-module, @typescript-eslint/no-require-imports
// eslint-disable-next-line @typescript-eslint/no-require-imports
return require(pluginPath);
} catch {
return import(pluginPath);
Expand Down
2 changes: 0 additions & 2 deletions cli/run/getConfigPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@ export async function getConfigPath(commandConfig: string | true): Promise<strin
if (commandConfig.slice(0, 5) === 'node:') {
const packageName = commandConfig.slice(5);
try {
// eslint-disable-next-line unicorn/prefer-module
return require.resolve(`rollup-config-${packageName}`, { paths: [cwd()] });
} catch {
try {
// eslint-disable-next-line unicorn/prefer-module
return require.resolve(packageName, { paths: [cwd()] });
} catch (error: any) {
if (error.code === 'MODULE_NOT_FOUND') {
Expand Down
4 changes: 2 additions & 2 deletions cli/run/watch-cli.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { readFile } from 'node:fs/promises';
import process from 'node:process';
import type { FSWatcher } from 'chokidar';
import chokidar from 'chokidar';
import dateTime from 'date-time';
import { readFile } from 'node:fs/promises';
import process from 'node:process';
import ms from 'pretty-ms';
import { onExit } from 'signal-exit';
import * as rollup from '../../src/node-entry';
Expand Down
2 changes: 0 additions & 2 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// eslint-disable-next-line import/no-unresolved
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client';
import '@shikijs/vitepress-twoslash/style.css';
import { createPinia } from 'pinia';
// eslint-disable-next-line import/no-unresolved
import defaultTheme from 'vitepress/theme';
import './custom.css';

Expand Down
2 changes: 1 addition & 1 deletion docs/repl/components/BundleOptions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
@input="optionsStore.set(option.name, Number($event.target.value))"
/>
<div
v-else-if="option.type === 'string-mapping'"
v-for="imported in option.keys"
v-else-if="option.type === 'string-mapping'"
:key="imported"
class="input-with-label"
>
Expand Down
1 change: 0 additions & 1 deletion docs/repl/components/InputHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
</template>

<script setup lang="ts">
import examplesById from 'examples.json';
import { useModules } from '../stores/modules';
import { useOptions } from '../stores/options';
Expand Down
2 changes: 1 addition & 1 deletion docs/repl/components/OutputStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<span class="repl-icon-attention"></span>
Loading Rollup...
</span>
<StatusMessage v-else-if="error" :message="error" isError />
<StatusMessage v-else-if="error" :message="error" is-error />
<span v-else-if="hasWarnings">
<span class="repl-icon-attention" />
Rollup completed with warnings:
Expand Down
8 changes: 3 additions & 5 deletions docs/repl/components/ReplEditor.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="codemirror-container" ref="editorContainer"></div>
<div ref="editorContainer" class="codemirror-container"></div>
</template>

<script setup lang="ts">
Expand All @@ -17,18 +17,16 @@ const properties = defineProps<{
moduleName?: string;
readonly?: boolean;
}>();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const emit = defineEmits<{ (event: 'update:code', code: string): void }>();
const emit = defineEmits<(event: 'update:code', code: string) => void>();
let addLogsEffect: AddLogs;
let editor: EditorView;
// eslint-disable-next-line vue/no-setup-props-destructure
let previousCode = properties.code;
onMounted(async () => {
const { createEditor, addLogs } = await import('../helpers/editor');
addLogsEffect = addLogs;
editor = createEditor(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
editorContainer.value!,
properties.code,
({ changedRanges, state: { doc } }) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/repl/components/ReplInput.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<InputHeader />

<div class="modules" ref="modulesReference">
<div ref="modulesReference" class="modules">
<ReplModule
v-for="(module, i) in modulesStore.modules"
:key="i"
Expand Down
7 changes: 3 additions & 4 deletions docs/repl/components/ReplModule.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<article class="module" :class="{ 'entry-module': module.isEntry }">
<header>
<span v-if="editableHeader">
<input ref="input" v-model="module.name" @focus="selectName" placeholder="foo.js" />
<input ref="input" v-model="module.name" placeholder="foo.js" @focus="selectName" />
<button class="repl-button remove" @click="emit('remove')">
<span class="label">remove</span>
<span class="repl-icon-cancel"></span>
Expand All @@ -19,7 +19,7 @@
<span v-if="module.isEntry" class="entry-module-label">(entry module)</span>
</span>
</header>
<ReplEditor v-model:code="module.code" :moduleName="module.name" :readonly="!editable" />
<ReplEditor v-model:code="module.code" :module-name="module.name" :readonly="!editable" />
</article>
</template>

Expand All @@ -34,8 +34,7 @@ defineProps<{
module: Module;
showHeader: boolean;
}>();
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const emit = defineEmits<{ (event: 'remove'): void }>();
const emit = defineEmits<(event: 'remove') => void>();
const input = ref<HTMLInputElement | null>(null);
const selectName = (event: FocusEvent) => {
Expand Down
2 changes: 1 addition & 1 deletion docs/repl/components/ReplOutput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<div v-if="!rollupOutputStore.output.error">
<ReplModule
v-for="chunk in chunkModules"
:module="chunk"
:key="chunk.name"
:module="chunk"
:show-header="rollupOutputStore.output.output.length > 1"
/>
</div>
Expand Down
Loading

0 comments on commit 9625890

Please sign in to comment.