Open History to see the last commit
1import noDisabled from './rules/no-disabled.js'
2import noUnitTest from './rules/no-unit-test.js'
3
4/**
5 * Lint rules for oracle files.
6 *
7 * AGENTS.md lists the shortcuts that make an oracle pass without enforcing
8 * its law ("How oracle work is scored"). These rules report the ones that a
9 * syntactic check can see, in TypeScript and JavaScript files whose names
10 * contain `oracle`. They need no type information, so an agent's post-edit hook
11 * can run them on one file in well under a second. A directive can silence them in the root config, so
12 * scripts/agent-lint-feedback.mjs enforces them in a pass that ignores inline
13 * directives.
14 */
15
16// The same names that scripts/check-oracle-run-counts.mjs `isOracleFile` accepts.
17const oracleFiles = [
18 `**/*oracle*.ts`,
19 `**/*oracle*.tsx`,
20 `**/*oracle*.js`,
21 `**/*oracle*.mjs`,
22 `**/*oracle*.jsx`,
23]
24
25const plugin = {
26 meta: { name: `eslint-plugin-oracle` },
27 rules: {
28 'no-disabled': noDisabled,
29 'no-unit-test': noUnitTest,
30 },
31}
32
33plugin.configs = {
34 recommended: {
35 name: `oracle/recommended`,
36 files: oracleFiles,
37 plugins: { oracle: plugin },
38 rules: {
39 'oracle/no-disabled': `error`,
40 'oracle/no-unit-test': `error`,
41 },
42 },
43}
44
45export default plugin