@fabriziosalmi/slopless 1.17.0 → 1.17.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.
@@ -13,6 +13,29 @@ interface Violation {
13
13
  };
14
14
  }
15
15
 
16
+ interface SloplessConfig {
17
+ rules?: Record<string, 'error' | 'warning' | 'off'>;
18
+ ignore?: string[];
19
+ customRulesPaths?: string[];
20
+ typeCheck?: boolean;
21
+ /**
22
+ * Words that are this project's domain rather than slop. `blacklist` in a
23
+ * firewall, `master` on an audio bus. Applies to every rule, and the run
24
+ * reports how many findings it excused.
25
+ */
26
+ vocabulary?: string[];
27
+ }
28
+ /**
29
+ * Where a config path resolves to, whether or not anything is there.
30
+ *
31
+ * Separate from `loadConfig` because a relative `customRulesPaths` entry means
32
+ * "relative to the config that named it". Resolving those against
33
+ * `process.cwd()` is right for the CLI and wrong everywhere else: an editor does
34
+ * not run in the directory it is checking.
35
+ */
36
+ declare function configLocation(configPath?: string): string;
37
+ declare function loadConfig(configPath?: string): SloplessConfig;
38
+
16
39
  /**
17
40
  * The rules a run would use: what is on disk, plus whatever the config adds,
18
41
  * with severities overridden, rules turned off removed, and opt-in rules kept
@@ -47,6 +70,7 @@ declare function resolveRules(configPath?: string): {
47
70
  exclude_test_code?: boolean | undefined;
48
71
  exclude_programs?: boolean | undefined;
49
72
  exclude_doc_comments?: boolean | undefined;
73
+ exclude_markdown_code?: boolean | undefined;
50
74
  git_check?: "committed_env" | "private_key" | "binary_file" | "node_modules" | "commit_message_too_short" | "missing_gitignore" | "missing_license" | "missing_readme" | "spaces_in_filenames" | "too_many_staged_files" | "filename_too_long" | "large_file_size" | "committed_ide_settings" | "missing_contributing" | "missing_security" | "missing_changelog" | undefined;
51
75
  ast_check?: {
52
76
  type: "function-params-limit" | "function-length-limit" | "file-length-limit" | "empty-catch" | "nested-blocks-limit" | "empty-block" | "one-liner-limit" | "redundant-if-true" | "lying-function-names" | "empty-interface" | "async-without-await" | "empty-file";
@@ -84,4 +108,4 @@ declare function resolveRules(configPath?: string): {
84
108
  }[];
85
109
  declare function lintText(content: string, filePath: string, configPath?: string): Promise<Violation[]>;
86
110
 
87
- export { lintText, resolveRules };
111
+ export { type SloplessConfig, configLocation, lintText, loadConfig, resolveRules };