Two passes over the repo, one editorial and one for accuracy. Prose (the avoid-ai-writing pass) - Replace ~250 em-dash-shaped " - " splices in comments, docs and UI copy with real punctuation. Paired dashes reading as parentheticals become parentheses. - Remove the remaining em dashes from code comments, CI and compose files, CLAUDE.md, and the legal pages. Bolded-lead-term list items keep theirs: there the dash is typography, not a splice. - Drop the Tier-1 filler: "actionable", "genuinely", "genuine", "deep dive", "showcase". Each one is now the specific thing it was standing in for. - Remove the coffee emoji from the README, the support modal and the landing page nav. - Relabel the "Deep dive" buttons in Archive and Research as "Object dossier", which is what the destination is called everywhere else. API docs, checked against the code rather than from memory - nox/docs/reference/http-api.md said the Nox routes need no auth. They do: real mode requires a bearer token AND confirmed: true. Documented both gates, the 401/403/404/503 responses, the /run summary field, the 200 parse-error diagnostic, and the two endpoints missing entirely (docs-search, docs/<path>). - cli.md conflated exit 1 and exit 3, and never documented --help/-h. - runtime-api.md implied every run() option was required and showed a diagnostic without suggest/seeAlso. - routes/nox.js listed 3 of its 6 endpoints, and its run-stream comment described a GET with the source in a query string. It is a POST. Standardization - Module header with a purpose line and an endpoint map on the 17 route files that had none. The 10 that already had one set the format. - engines: node >=22 on server and client, matching root, parser, runtime. - CLAUDE.md pointed at server/src/db/ and server/src/drivers/, neither of which exists, and claimed no linter is wired. Fixed all three, plus the stale 42-test count. - README's Node 20+ table row contradicted every engines field and its own quick start. Its Testing section omitted the server and client suites. - The client suite ran nowhere in CI. It now rides along in client-build. - The sqlite server-test leg is waived for a failure that no longer reproduces; noted in the job, left advisory pending runner confirmation. Verified: lint clean, SPA builds, 127 server + 10 client + parser + runtime suites pass, and both compose files plus .gitlab-ci.yml still parse as YAML. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
147 lines
5.9 KiB
JavaScript
147 lines
5.9 KiB
JavaScript
// Caelum lint config: minimal on purpose.
|
|
//
|
|
// CLAUDE.md says "no over-engineering." This config exists to catch the
|
|
// drift that bit us tonight (unused vars, unreachable branches, broken
|
|
// template references in Vue), NOT to enforce style. There is no
|
|
// formatter; do not add one.
|
|
//
|
|
// Run: npm run lint # report
|
|
// npm run lint -- --fix # auto-fix what's safe (mostly nothing)
|
|
|
|
import js from '@eslint/js';
|
|
import vue from 'eslint-plugin-vue';
|
|
import vueParser from 'vue-eslint-parser';
|
|
|
|
// Single shared rule set across server (.js) and client (.vue/.js). We
|
|
// deliberately keep this short so the team doesn't fight the linter.
|
|
const baseRules = {
|
|
// Catches the dead-code class of bugs found in the maintainability sweep.
|
|
'no-unused-vars': ['warn', {
|
|
args: 'none', // many Express handlers take (req,res,next)
|
|
varsIgnorePattern: '^_', // underscore-prefix = intentional
|
|
argsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
}],
|
|
'no-unreachable': 'error',
|
|
'no-empty': ['warn', { allowEmptyCatch: true }],
|
|
// The exact bug from Research.vue: `if (a = b)` instead of `===`.
|
|
// `except-parens` allows the intentional `while ((m = re.exec(s)))` form
|
|
// (you have to wrap the assignment in parens to silence the rule).
|
|
'no-cond-assign': ['error', 'except-parens'],
|
|
// Stop the `==` vs `===` foot-gun.
|
|
'eqeqeq': ['warn', 'always', { null: 'ignore' }],
|
|
// Catches `await` inside a sync function, common when refactoring.
|
|
'no-async-promise-executor': 'error',
|
|
// Catches dead promises (no .then/.catch and not awaited).
|
|
'no-unused-expressions': ['warn', {
|
|
allowShortCircuit: true,
|
|
allowTernary: true,
|
|
}],
|
|
// Off: Node 22 introduced this and it nags about every `throw new Error(msg)`
|
|
// unless you adopt the `cause` option. Not worth a codebase-wide retrofit.
|
|
'preserve-caught-error': 'off',
|
|
// Treat as warning: usually fine but sometimes you legitimately reassign
|
|
// before an early return; the lint produces a lot of false positives on
|
|
// multi-branch route handlers.
|
|
'no-useless-assignment': 'off',
|
|
};
|
|
|
|
// Vue-specific rules: catch broken template references like the ones the
|
|
// dead-code report found (`@click="addMentionedTarget(name)"` where the fn
|
|
// doesn't exist). vue/no-undef-components catches typo'd component names.
|
|
const vueRules = {
|
|
...vue.configs['flat/recommended'].rules,
|
|
// Allow multi-word component names: view-style names ("Research") are fine.
|
|
'vue/multi-word-component-names': 'off',
|
|
// We use very long template lines for grid/inline forms; don't bikeshed.
|
|
'vue/max-attributes-per-line': 'off',
|
|
'vue/singleline-html-element-content-newline': 'off',
|
|
'vue/html-self-closing': 'off',
|
|
'vue/html-indent': 'off',
|
|
'vue/attributes-order': 'off',
|
|
// This is the rule that would have caught addMentionedTarget being typo'd.
|
|
'vue/no-undef-properties': 'warn',
|
|
};
|
|
|
|
export default [
|
|
// Files to skip entirely. No point linting build output, vendor dumps,
|
|
// generated SQL, or the Nox grammar (which uses Chevrotain DSL).
|
|
{
|
|
ignores: [
|
|
'**/node_modules/**',
|
|
'**/dist/**',
|
|
'**/build/**',
|
|
'client/dist/**',
|
|
'sql/**',
|
|
'db.sqlite3',
|
|
'**/*.min.js',
|
|
'nox/parser/src/grammar/**', // chevrotain DSL: false positives galore
|
|
],
|
|
},
|
|
|
|
// Plain JS files (server, scripts, nox runtime).
|
|
{
|
|
files: ['**/*.js', '**/*.mjs'],
|
|
languageOptions: {
|
|
ecmaVersion: 2024,
|
|
sourceType: 'module',
|
|
globals: {
|
|
// Node + browser builtins we use in either runtime.
|
|
console: 'readonly', process: 'readonly', Buffer: 'readonly',
|
|
setTimeout: 'readonly', setInterval: 'readonly', clearTimeout: 'readonly', clearInterval: 'readonly',
|
|
setImmediate: 'readonly',
|
|
fetch: 'readonly', AbortSignal: 'readonly', AbortController: 'readonly',
|
|
URL: 'readonly', URLSearchParams: 'readonly',
|
|
crypto: 'readonly',
|
|
__dirname: 'readonly', __filename: 'readonly',
|
|
global: 'readonly', globalThis: 'readonly',
|
|
// Browser
|
|
window: 'readonly', document: 'readonly', navigator: 'readonly',
|
|
localStorage: 'readonly', sessionStorage: 'readonly',
|
|
HTMLElement: 'readonly', Element: 'readonly', Image: 'readonly', Event: 'readonly',
|
|
getComputedStyle: 'readonly',
|
|
// Test runner (node --test)
|
|
describe: 'readonly', it: 'readonly', before: 'readonly', after: 'readonly',
|
|
beforeEach: 'readonly', afterEach: 'readonly',
|
|
},
|
|
},
|
|
rules: {
|
|
...js.configs.recommended.rules,
|
|
...baseRules,
|
|
},
|
|
},
|
|
|
|
// Vue SFCs.
|
|
{
|
|
files: ['**/*.vue'],
|
|
languageOptions: {
|
|
parser: vueParser,
|
|
ecmaVersion: 2024,
|
|
sourceType: 'module',
|
|
globals: {
|
|
// Standard browser globals: the Vue files run in the DOM.
|
|
console: 'readonly', setTimeout: 'readonly', setInterval: 'readonly',
|
|
clearTimeout: 'readonly', clearInterval: 'readonly',
|
|
fetch: 'readonly', AbortController: 'readonly', AbortSignal: 'readonly',
|
|
URL: 'readonly', URLSearchParams: 'readonly', Blob: 'readonly', File: 'readonly', FormData: 'readonly',
|
|
TextEncoder: 'readonly', TextDecoder: 'readonly',
|
|
window: 'readonly', document: 'readonly', navigator: 'readonly', location: 'readonly',
|
|
localStorage: 'readonly', sessionStorage: 'readonly',
|
|
Image: 'readonly', Event: 'readonly', CustomEvent: 'readonly',
|
|
HTMLElement: 'readonly', Element: 'readonly', Node: 'readonly',
|
|
requestAnimationFrame: 'readonly', cancelAnimationFrame: 'readonly',
|
|
getComputedStyle: 'readonly',
|
|
// Yes, these are dialogs we shouldn't really use, but the codebase does.
|
|
confirm: 'readonly', prompt: 'readonly', alert: 'readonly',
|
|
},
|
|
},
|
|
plugins: { vue },
|
|
processor: vue.processors['.vue'],
|
|
rules: {
|
|
...js.configs.recommended.rules,
|
|
...baseRules,
|
|
...vueRules,
|
|
},
|
|
},
|
|
];
|