From 962589059ab622e1affef7e3b0df1cd632df61a4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 06:11:29 +0000 Subject: [PATCH] chore(deps): update dependency @types/eslint to v9 (#5591) * 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 --- .eslintrc.js | 166 -- .lintstagedrc.js | 2 +- .prettierrc.json | 3 +- browser/src/initWasm.ts | 1 - browser/src/wasm.ts | 5 +- build-plugins/fs-events-replacement.ts | 2 +- cli/cli.ts | 5 +- cli/run/batchWarnings.ts | 8 +- cli/run/commandPlugins.ts | 2 +- cli/run/getConfigPath.ts | 2 - cli/run/watch-cli.ts | 4 +- docs/.vitepress/theme/index.ts | 2 - docs/repl/components/BundleOptions.vue | 2 +- docs/repl/components/InputHeader.vue | 1 - docs/repl/components/OutputStatus.vue | 2 +- docs/repl/components/ReplEditor.vue | 8 +- docs/repl/components/ReplInput.vue | 2 +- docs/repl/components/ReplModule.vue | 7 +- docs/repl/components/ReplOutput.vue | 2 +- docs/repl/components/RollupVersion.vue | 1 + docs/repl/components/SelectOption.vue | 3 +- docs/repl/components/StatusMessage.vue | 4 +- docs/repl/examples/.eslintrc.json | 5 - docs/repl/examples/01/modules/main.js | 2 +- eslint.config.mjs | 190 ++ package-lock.json | 2273 +++-------------- package.json | 14 +- rollup.config.ts | 5 +- scripts/colors.js | 2 +- scripts/generate-ast-converters.js | 2 +- scripts/helpers.js | 4 +- scripts/perf-report/index.js | 2 +- scripts/perf-report/rollup-artefacts.js | 1 - scripts/postpublish.js | 2 +- scripts/prepare-release.js | 2 +- scripts/release-helpers.js | 2 +- scripts/update-snapshots.js | 2 +- src/Bundle.ts | 1 - src/Chunk.ts | 20 +- src/Graph.ts | 8 +- src/Module.ts | 8 +- src/ModuleLoader.ts | 1 - src/ast/nodes/Literal.ts | 2 +- src/ast/nodes/UnaryExpression.ts | 4 +- src/ast/nodes/index.ts | 4 +- src/ast/nodes/shared/Expression.ts | 2 +- src/ast/nodes/shared/Node.ts | 3 +- src/ast/nodes/shared/ObjectEntity.ts | 4 +- src/ast/utils/checkEffectForNodes.ts | 2 +- src/ast/values.ts | 6 +- src/ast/variables/NamespaceVariable.ts | 6 +- src/browser-entry.ts | 2 +- src/finalisers/amd.ts | 2 +- src/finalisers/cjs.ts | 2 +- src/finalisers/iife.ts | 2 +- src/finalisers/index.ts | 4 +- src/finalisers/umd.ts | 2 +- src/node-entry.ts | 4 +- src/rollup/types.d.ts | 42 +- src/utils/FileEmitter.ts | 4 +- src/utils/PluginContext.ts | 6 +- src/utils/Queue.ts | 4 +- src/utils/chunkAssignment.ts | 26 +- src/utils/collapseSourcemaps.ts | 2 +- src/utils/colors.ts | 2 +- src/utils/interopHelpers.ts | 9 +- src/utils/logs.ts | 1 - src/utils/options/mergeOptions.ts | 2 +- src/utils/options/normalizeInputOptions.ts | 8 +- src/utils/options/normalizeOutputOptions.ts | 5 +- src/utils/options/options.ts | 4 +- src/utils/renderNamePattern.ts | 2 +- src/watch/WatchEmitter.ts | 2 +- src/watch/fileWatcher.ts | 2 +- src/watch/watch.ts | 2 +- test/chunking-form/index.js | 3 - .../rollup-plugin-esm-test/index.mjs | 4 +- .../config-missing-export/rollup.config.js | 1 - .../make-relative-false/_config.js | 1 - .../make-relative-relative/_config.js | 1 - .../make-relative-true/_config.js | 1 - .../import-empty-from-external/_config.js | 2 +- .../_config.js | 2 +- test/incremental/index.js | 1 - test/misc/parse-ast.js | 1 - test/typescript/index.ts | 1 - 86 files changed, 707 insertions(+), 2265 deletions(-) delete mode 100644 .eslintrc.js delete mode 100644 docs/repl/examples/.eslintrc.json create mode 100644 eslint.config.mjs diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 0be3672e2..000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,166 +0,0 @@ -module.exports = { - env: { - browser: true, - es6: true, - node: true - }, - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - 'prettier', - 'plugin:prettier/recommended', - 'plugin:import/recommended', - 'plugin:import/typescript', - 'plugin:unicorn/recommended' - ], - ignorePatterns: [ - 'node_modules', - 'dist', - 'perf', - 'tmp', - 'coverage', - '_tmp', - 'cache', - 'native.d.ts', - '/test/*/samples/**/*.*', - '!/test/*/samples/**/_config.js', - '!/test/*/samples/**/rollup.config.js', - '!.vitepress', - '/wasm/', - '/wasm-node/' - ], - overrides: [ - { - files: ['*.js'], - rules: { - '@typescript-eslint/explicit-module-boundary-types': 'off', - '@typescript-eslint/no-require-imports': 'off', - 'unicorn/no-process-exit': 'off', - 'unicorn/prefer-module': 'off' - } - }, - { - files: ['./*.ts', 'cli/**/*.ts'], - rules: { - 'unicorn/no-process-exit': 'off' - } - }, - { - files: ['*.js', 'cli/**/*.ts'], - rules: { - '@typescript-eslint/no-var-requires': 'off' - } - }, - { - env: { - mocha: true - }, - files: ['test/**/*.js'], - rules: { - 'sort-keys': 'off' - } - }, - { - extends: [ - 'plugin:vue/vue3-essential', - '@vue/eslint-config-typescript/recommended', - '@vue/eslint-config-prettier' - ], - files: ['*.vue'] - }, - { - files: ['docs/repl/examples/**/*.js'], - rules: { - 'import/namespace': 'off', - 'import/no-unresolved': 'off', - 'no-undef': 'off', - 'unicorn/prevent-abbreviations': 'off' - } - }, - { - files: ['test/**/_config.js'], - rules: { - 'no-undef': 'off' - } - } - ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - rules: { - '@typescript-eslint/consistent-type-assertions': [ - 'error', - { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' } - ], - '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], - '@typescript-eslint/consistent-type-imports': 'error', - '@typescript-eslint/member-ordering': [ - 'error', - { - default: { - memberTypes: [], - order: 'alphabetically' - } - } - ], - '@typescript-eslint/no-empty-function': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-unused-vars': [ - 'error', - { argsIgnorePattern: '^_', ignoreRestSiblings: true, varsIgnorePattern: '^_' } - ], - 'arrow-body-style': ['error', 'as-needed'], - 'dot-notation': 'error', - 'import/no-unresolved': [ - 'error', - { - // 'fsevents' is only available on macOS, and not installed on linux/windows - ignore: [ - 'fsevents', - 'help.md', - 'is-reference', - 'package.json', - 'types', - 'examples.json', - 'locate-character' - ] - } - ], - 'import/order': ['error', { alphabetize: { order: 'asc' } }], - 'no-constant-condition': ['error', { checkLoops: false }], - 'no-prototype-builtins': 'off', - 'object-shorthand': 'error', - 'prefer-const': ['error', { destructuring: 'all' }], - 'prefer-object-spread': 'error', - 'sort-imports': [ - 'error', - { - ignoreCase: true, - ignoreDeclarationSort: true, - ignoreMemberSort: false - } - ], - 'sort-keys': ['error', 'asc', { caseSensitive: false }], - 'unicorn/consistent-destructuring': 'off', - 'unicorn/filename-case': 'off', - 'unicorn/no-array-callback-reference': 'off', - 'unicorn/no-array-reduce': 'off', - 'unicorn/no-await-expression-member': 'off', - 'unicorn/no-empty-file': 'off', - 'unicorn/no-for-loop': 'off', - 'unicorn/no-nested-ternary': 'off', - 'unicorn/no-null': 'off', - 'unicorn/no-this-assignment': 'off', - 'unicorn/no-useless-undefined': 'off', - 'unicorn/number-literal-case': 'off', - 'unicorn/prefer-at': 'off', - 'unicorn/prefer-code-point': 'off', - 'unicorn/prefer-math-trunc': 'off', - 'unicorn/prefer-number-properties': 'off', - 'unicorn/prefer-string-raw': 'off', - 'unicorn/prefer-string-replace-all': 'off', - 'unicorn/prefer-structured-clone': 'off', - 'unicorn/prefer-top-level-await': 'off', - 'unicorn/prevent-abbreviations': ['error', { replacements: { dir: false } }] - } -}; diff --git a/.lintstagedrc.js b/.lintstagedrc.js index c2d421426..0eecedc99 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,4 +1,4 @@ module.exports = { - '*.{ts,js}': ['eslint --fix --cache'], '*.md': ['prettier --write'], + '*.{ts,js}': ['eslint --fix --cache'] }; diff --git a/.prettierrc.json b/.prettierrc.json index c1e4a6747..0de43bbd5 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -13,5 +13,6 @@ "proseWrap": "never" } } - ] + ], + "plugins": ["prettier-plugin-organize-imports"] } diff --git a/browser/src/initWasm.ts b/browser/src/initWasm.ts index ccd5e8d56..c39332521 100644 --- a/browser/src/initWasm.ts +++ b/browser/src/initWasm.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line import/no-unresolved import init from '../../wasm/bindings_wasm'; export default async function initWasm() { diff --git a/browser/src/wasm.ts b/browser/src/wasm.ts index e0249605a..c663b8ebd 100644 --- a/browser/src/wasm.ts +++ b/browser/src/wasm.ts @@ -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, diff --git a/build-plugins/fs-events-replacement.ts b/build-plugins/fs-events-replacement.ts index 141c5bd0f..0b8d118d1 100644 --- a/build-plugins/fs-events-replacement.ts +++ b/build-plugins/fs-events-replacement.ts @@ -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')"; diff --git a/cli/cli.ts b/cli/cli.ts index 59476892f..2f4f105a5 100644 --- a/cli/cli.ts +++ b/cli/cli.ts @@ -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'; @@ -17,7 +17,7 @@ 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 @@ -25,7 +25,6 @@ if (command.help || (process.argv.length <= 2 && process.stdin.isTTY)) { const promise = run(command); if (command.forceExit) { - // eslint-disable-next-line unicorn/no-process-exit promise.then(() => process.exit()); } } diff --git a/cli/run/batchWarnings.ts b/cli/run/batchWarnings.ts index ea4961143..7d28da401 100644 --- a/cli/run/batchWarnings.ts +++ b/cli/run/batchWarnings.ts @@ -92,9 +92,7 @@ export default function batchWarnings(command: Record): BatchWarnin }; } -const immediateHandlers: { - [code: string]: (warning: RollupLog) => void; -} = { +const immediateHandlers: Record void> = { MISSING_NODE_BUILTINS(warning) { title(`Missing shims for Node.js built-ins`); @@ -111,9 +109,7 @@ const immediateHandlers: { } }; -const deferredHandlers: { - [code: string]: (warnings: RollupLog[]) => void; -} = { +const deferredHandlers: Record void> = { CIRCULAR_DEPENDENCY(warnings) { title(`Circular dependenc${warnings.length > 1 ? 'ies' : 'y'}`); const displayed = warnings.length > 5 ? warnings.slice(0, 3) : warnings; diff --git a/cli/run/commandPlugins.ts b/cli/run/commandPlugins.ts index bc67edb87..15e5125a1 100644 --- a/cli/run/commandPlugins.ts +++ b/cli/run/commandPlugins.ts @@ -114,7 +114,7 @@ function getCamelizedPluginBaseName(pluginText: string): string { async function requireOrImport(pluginPath: string): Promise { 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); diff --git a/cli/run/getConfigPath.ts b/cli/run/getConfigPath.ts index be72bffb4..6cc1a80bd 100644 --- a/cli/run/getConfigPath.ts +++ b/cli/run/getConfigPath.ts @@ -13,11 +13,9 @@ export async function getConfigPath(commandConfig: string | true): Promise
diff --git a/docs/repl/components/InputHeader.vue b/docs/repl/components/InputHeader.vue index a74148135..451931f5e 100644 --- a/docs/repl/components/InputHeader.vue +++ b/docs/repl/components/InputHeader.vue @@ -11,7 +11,6 @@