Files
oikos/web/node_modules/eslint/lib/services/warning-service.js
dtoro d4d99a7473
Some checks failed
ci / build-test (push) Has been cancelled
ci / docker-build (push) Has been cancelled
feat: Phase 1 — extract the client (web SPA + desktop) to dtoro/oikos-web
Problem: the hexagonal refactor churns the backend tree for nine more
phases; the UI delivery stack (web/ SPA, cmd/desktop Wails wrapper,
compose/web image) must move to its own repo first so doc/layout
rewrites land once on a backend-only tree.

Change:
- New repo git.hubris.network/dtoro/oikos-web (v0.33.0): web/, desktop/
  (updateURL repointed to oikos-web releases), compose/, own CI (web +
  desktop jobs), own deploy script (CI-green gate, TOCTOU guard,
  version-tagged images, prune-to-3), own webhook receiver on :9798 +
  launchd unit, own compose project publishing the same 8091:80.
- Cutover executed on mac-mini in order: oikos stack's web service
  stopped+removed, oikos-web project brought up on 8091; outer Caddy
  untouched (targets the published port) — serving + Authentik flow +
  /wails 404 quirk verified post-cutover.
- Stripped from oikos: web/, cmd/desktop/, compose/web/, desktop CI
  workflow, ci.yml web job, Makefile ui/desktop/desktop-package/install
  targets, the compose web service, oikos-web from deploy.sh's fallback
  prune list; wails + go-keyring dropped from go.mod, vendor synced.
- README / CONTRIBUTING / AGENTS.md / .agents dev+operations docs now
  point at the new repo; mbse + mascot design docs carry a path note.

Risk: production SPA serving depends on the new pipeline now; rollback
is versioned-image re-up of the old web service from a pre-split
checkout (port 8091). Desktop builds installed before the split still
check dtoro/oikos releases — one manual reinstall, noted in the
oikos-web release notes.

Verification: go vet, make test (race), make generate-check, golangci
(no new findings; baseline down 400→365); post-cutover curls —
localhost:8091 200, /wails/runtime.js 404, outer Caddy 302 Authentik.
2026-08-15 22:27:52 +02:00

112 lines
4.1 KiB
JavaScript

/**
* @fileoverview Emits warnings for ESLint.
* @author Francesco Trotta
*/
"use strict";
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
* A service that emits warnings for ESLint.
*/
class WarningService {
/**
* Creates a new instance of the service.
* @param {{ emitWarning?: ((warning: string, type: string) => void) | undefined }} [options] A function called internally to emit warnings using API provided by the runtime.
*/
constructor({
emitWarning = globalThis.process?.emitWarning ?? (() => {}),
} = {}) {
this.emitWarning = emitWarning;
}
/**
* Emits a warning when circular fixes are detected while fixing a file.
* This method is used by the Linter and is safe to call outside Node.js.
* @param {string} filename The name of the file being fixed.
* @returns {void}
*/
emitCircularFixesWarning(filename) {
this.emitWarning(
`Circular fixes detected while fixing ${filename}. It is likely that you have conflicting rules in your configuration.`,
"ESLintCircularFixesWarning",
);
}
/**
* Emits a warning when an empty config file has been loaded.
* @param {string} configFilePath The path to the config file.
* @returns {void}
*/
emitEmptyConfigWarning(configFilePath) {
this.emitWarning(
`Running ESLint with an empty config (from ${configFilePath}). Please double-check that this is what you want. If you want to run ESLint with an empty config, export [{}] to remove this warning.`,
"ESLintEmptyConfigWarning",
);
}
/**
* Emits a warning when an ".eslintignore" file is found.
* @returns {void}
*/
emitESLintIgnoreWarning() {
this.emitWarning(
'The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files',
"ESLintIgnoreWarning",
);
}
/**
* Emits a warning when the ESLINT_USE_FLAT_CONFIG environment variable is set to "false".
* @returns {void}
*/
emitESLintRCWarning() {
this.emitWarning(
"You are using an eslintrc configuration file, which is deprecated and support will be removed in v10.0.0. Please migrate to an eslint.config.js file. See https://eslint.org/docs/latest/use/configure/migration-guide for details. An eslintrc configuration file is used because you have the ESLINT_USE_FLAT_CONFIG environment variable set to false. If you want to use an eslint.config.js file, remove the environment variable. If you want to find the location of the eslintrc configuration file, use the --debug flag.",
"ESLintRCWarning",
);
}
/**
* Emits a warning when an inactive flag is used.
* This method is used by the Linter and is safe to call outside Node.js.
* @param {string} flag The name of the flag.
* @param {string} message The warning message.
* @returns {void}
*/
emitInactiveFlagWarning(flag, message) {
this.emitWarning(message, `ESLintInactiveFlag_${flag}`);
}
/**
* Emits a warning when a suboptimal concurrency setting is detected.
* Currently, this is only used to warn when the net linting ratio is low.
* @param {string} notice A notice about how to improve performance.
* @returns {void}
*/
emitPoorConcurrencyWarning(notice) {
this.emitWarning(
`You may ${notice} to improve performance.`,
"ESLintPoorConcurrencyWarning",
);
}
/**
* Emits a warning when eslint-env configuration comments are found.
* @param {string} filename The name of the file being linted.
* @param {number} line The line number of the comment.
* @returns {void}
*/
emitESLintEnvWarning(filename, line) {
this.emitWarning(
`/* eslint-env */ comments are no longer recognized when linting with flat config and will be reported as errors as of v10.0.0. Replace them with /* global */ comments or define globals in your config file. See https://eslint.org/docs/latest/use/configure/migration-guide#eslint-env-configuration-comments for details. Found in ${filename} at line ${line}.`,
"ESLintEnvWarning",
);
}
}
module.exports = { WarningService };