@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.
- package/dist/engine/api.d.ts +25 -1
- package/dist/engine/api.js +154 -153
- package/dist/index.d.ts +1 -0
- package/dist/index.js +186 -185
- package/package.json +20 -3
- package/rules/VBC-010.yaml +5 -1
- package/rules/VBC-017-B.yaml +4 -1
- package/rules/VBC-035.yaml +7 -1
- package/rules/VBC-051.yaml +6 -1
- package/rules/VBC-104.yaml +14 -1
- package/rules/VBC-901.yaml +45 -2
- package/rules/VBC-920.yaml +28 -1
- package/rules/VBC-936.yaml +4 -1
package/dist/engine/api.d.ts
CHANGED
|
@@ -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 };
|