@sybelblue/prairielearn-navigator 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -1
- package/dist/cli.cjs +6 -6
- package/dist/core/config.d.ts +36 -2
- package/dist/core/diagnostic.d.ts +13 -1
- package/dist/core/questionDirs.d.ts +13 -0
- package/dist/core/referenceIndex.d.ts +14 -1
- package/dist/core/rules/impls.d.ts +4 -0
- package/dist/core/rules/registry.d.ts +6 -0
- package/dist/core/rules/run.d.ts +7 -0
- package/dist/core/rules/types.d.ts +6 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,6 +20,10 @@ npx -y @sybelblue/prairielearn-navigator check [options] [paths...]
|
|
|
20
20
|
| `--pl-version <version>` | PrairieLearn version to check against (overrides the config) |
|
|
21
21
|
| `--schema-cache <dir>` | Where downloaded schemas are cached (overrides the config) |
|
|
22
22
|
| `--exclude <glob>` | Skip matching files, relative to the current directory. Repeatable; adds to the config's `excludes`. |
|
|
23
|
+
| `--unused-questions <level>` | Severity for questions no assessment uses: `ignored`, `info` (default), `warning`, or `error` (overrides the config) |
|
|
24
|
+
| `--unused-tags <level>` | Severity for `infoCourse.json` tags no question uses: `ignored`, `info`, `warning` (default), or `error` (overrides the config) |
|
|
25
|
+
| `--unused-assessment-sets <level>` | Severity for `infoCourse.json` assessment sets no assessment uses: `ignored`, `info`, `warning` (default), or `error` (overrides the config) |
|
|
26
|
+
| `--missing-question-info <level>` | Severity for directories in `questions/` with files but no `info.json`: `ignored`, `info`, `warning`, or `error` (default) (overrides the config) |
|
|
23
27
|
|
|
24
28
|
## Rules
|
|
25
29
|
|
|
@@ -30,6 +34,10 @@ Each diagnostic ends with its rule id, e.g. `[schema]`.
|
|
|
30
34
|
| `json-syntax` | all | JSON syntax errors, including comments and trailing commas, which PrairieLearn's `JSON.parse` rejects |
|
|
31
35
|
| `schema` | all | Violations of PrairieLearn's own JSON schema for the selected version. Unknown properties are warnings. |
|
|
32
36
|
| `duplicate-question-id` | `infoAssessment.json` | Question ids used more than once (warning) |
|
|
37
|
+
| `unused-question` | question `info.json` | Questions no assessment uses, on their `title` (info). Set with `unusedQuestions`. |
|
|
38
|
+
| `unused-tag` | `infoCourse.json` | Tags no question lists in its `tags`, on their `name` (warning). Set with `unusedTags`. |
|
|
39
|
+
| `unused-assessment-set` | `infoCourse.json` | Assessment sets no assessment names as its `set`, on their `name` (warning). Set with `unusedAssessmentSets`. |
|
|
40
|
+
| `question-info-missing` | directories in `questions/` | Directories with files but no `info.json` and no question below them, which PrairieLearn fails to load from disk. Shown at the start of the directory's `question.html`, or else its first file. Set with `missingQuestionInfo`. |
|
|
33
41
|
| `question-exists` | `infoAssessment.json`, question `info.json` (`template`) | Question ids with no directory, `info.json`, or `question.html` |
|
|
34
42
|
| `client-files-course-exist` | question, element, and element extension `info.json` | `clientFilesCourseStyles`/`Scripts` missing from `clientFilesCourse/` |
|
|
35
43
|
| `client-files-question-exist` | question `info.json` | `clientFilesQuestionStyles`/`Scripts` missing from `clientFilesQuestion/`; deprecated `clientFiles` (warning) |
|
|
@@ -53,8 +61,15 @@ Put a `.pl-navigator.jsonc` (JSON with comments) next to `infoCourse.json`:
|
|
|
53
61
|
// Relative to this file. Default: $XDG_CACHE_HOME/prairielearn-navigator/schemas
|
|
54
62
|
// or ~/.cache/prairielearn-navigator/schemas
|
|
55
63
|
"schemaCacheDir": ".cache/pl-schemas",
|
|
56
|
-
// Turn rules off or change their severity
|
|
64
|
+
// Turn rules off or change their severity: "off", "info", "warning", or "error"
|
|
57
65
|
"rules": { "duplicate-question-id": "error" },
|
|
66
|
+
// Questions no assessment uses: "ignored", "info" (default), "warning", or "error"
|
|
67
|
+
"unusedQuestions": "warning",
|
|
68
|
+
// Tags and assessment sets no question or assessment uses (default "warning")
|
|
69
|
+
"unusedTags": "info",
|
|
70
|
+
"unusedAssessmentSets": "error",
|
|
71
|
+
// Directories in questions/ with files but no info.json (default "error")
|
|
72
|
+
"missingQuestionInfo": "warning",
|
|
58
73
|
// Files never checked, relative to this file
|
|
59
74
|
"excludes": ["courseInstances/Archive/**", "questions/drafts/**"]
|
|
60
75
|
}
|