@ttsc/lint 0.18.4 → 0.19.1
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 +125 -43
- package/go.mod +5 -4
- package/internal/rulecode/rulecode.go +88 -0
- package/lib/index.d.ts +10 -1
- package/lib/index.js +45 -17
- package/lib/index.js.map +1 -1
- package/lib/structures/ITtscLintConfig.d.ts +3 -0
- package/lib/structures/TtscLintRuleSetting.d.ts +3 -2
- package/lib/structures/format/ITtscLintFormat.d.ts +3 -2
- package/lib/structures/format/ITtscLintFormatSortImports.d.ts +20 -4
- package/lib/structures/rules/ITtscLintBoundariesRuleOptions.d.ts +80 -8
- package/lib/structures/rules/ITtscLintBoundariesRules.d.ts +6 -8
- package/lib/structures/rules/ITtscLintContributorRules.d.ts +18 -2
- package/lib/structures/rules/ITtscLintCoreRuleOptions.d.ts +347 -0
- package/lib/structures/rules/ITtscLintCoreRuleOptions.js +3 -0
- package/lib/structures/rules/ITtscLintCoreRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintCoreRules.d.ts +101 -67
- package/lib/structures/rules/ITtscLintRegexpRules.d.ts +7 -2
- package/lib/structures/rules/ITtscLintRuleOptionsMap.d.ts +53 -7
- package/lib/structures/rules/ITtscLintRules.d.ts +6 -2
- package/lib/structures/rules/ITtscLintSolidRules.d.ts +0 -8
- package/lib/structures/rules/ITtscLintTypeScriptRuleOptions.d.ts +206 -0
- package/lib/structures/rules/ITtscLintTypeScriptRuleOptions.js +8 -0
- package/lib/structures/rules/ITtscLintTypeScriptRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintTypeScriptRules.d.ts +55 -42
- package/lib/structures/rules/ITtscLintUnicornRuleOptions.d.ts +276 -0
- package/lib/structures/rules/ITtscLintUnicornRuleOptions.js +3 -0
- package/lib/structures/rules/ITtscLintUnicornRuleOptions.js.map +1 -0
- package/lib/structures/rules/ITtscLintUnicornRules.d.ts +44 -36
- package/lib/structures/rules/index.d.ts +3 -0
- package/lib/structures/rules/index.js +3 -0
- package/lib/structures/rules/index.js.map +1 -1
- package/linthost/ast_helpers.go +521 -23
- package/linthost/ast_selector_matcher.go +1628 -0
- package/linthost/ast_selector_parser.go +628 -0
- package/linthost/comment_scan.go +154 -0
- package/linthost/compile.go +129 -79
- package/linthost/config.go +352 -88
- package/linthost/config_format.go +15 -1
- package/linthost/contrib_adapter.go +47 -8
- package/linthost/declaration_rules.go +12 -11
- package/linthost/directives.go +9 -67
- package/linthost/dispatch.go +37 -3
- package/linthost/engine.go +368 -53
- package/linthost/escape_string.go +77 -0
- package/linthost/fix.go +133 -23
- package/linthost/flags_gen.go +18 -17
- package/linthost/format.go +73 -167
- package/linthost/format_editor_settings.go +134 -26
- package/linthost/grapheme_tables_gen.go +1920 -0
- package/linthost/host.go +159 -61
- package/linthost/literal_escape_scan.go +117 -0
- package/linthost/lsp.go +545 -98
- package/linthost/numeric_literal_precision.go +228 -0
- package/linthost/polyfill_browserslist.go +1439 -0
- package/linthost/polyfill_browserslist_config.go +603 -0
- package/linthost/polyfill_corejs.go +750 -0
- package/linthost/polyfill_data.go +113 -0
- package/linthost/polyfill_data_gen.json +39868 -0
- package/linthost/print_nodes_array.go +7 -1
- package/linthost/print_nodes_object.go +7 -1
- package/linthost/project_engine.go +231 -0
- package/linthost/project_rules.go +78 -0
- package/linthost/regex_clean.go +191 -0
- package/linthost/regex_tree.go +1544 -0
- package/linthost/regex_tree_optimizer.go +1685 -0
- package/linthost/regexp_cache.go +44 -0
- package/linthost/rule_codes.go +105 -0
- package/linthost/rule_codes.json +745 -0
- package/linthost/rules_ban_ts_comment.go +312 -0
- package/linthost/rules_boundaries.go +128 -43
- package/linthost/rules_boundaries_dependencies.go +1013 -0
- package/linthost/rules_core_extra.go +62 -92
- package/linthost/rules_cypress.go +1 -1
- package/linthost/rules_default_case.go +87 -11
- package/linthost/rules_dupes.go +38 -13
- package/linthost/rules_empty.go +188 -20
- package/linthost/rules_escape.go +62 -48
- package/linthost/rules_format_arrow_parens.go +19 -5
- package/linthost/rules_format_bracket_spacing.go +1 -1
- package/linthost/rules_format_clause_join.go +1 -1
- package/linthost/rules_format_declaration_header.go +31 -19
- package/linthost/rules_format_indent.go +1 -1
- package/linthost/rules_format_jsdoc.go +1 -1
- package/linthost/rules_format_orphan_semi.go +1 -1
- package/linthost/rules_format_parameter_properties.go +17 -7
- package/linthost/rules_format_print_width.go +1 -1
- package/linthost/rules_format_quote_props.go +1 -1
- package/linthost/rules_format_quotes.go +1 -1
- package/linthost/rules_format_semi.go +106 -79
- package/linthost/rules_format_sort_imports.go +79 -45
- package/linthost/rules_format_statement_split.go +1 -1
- package/linthost/rules_format_ternary_nullish_parens.go +1 -1
- package/linthost/rules_format_trailing_comma.go +64 -1
- package/linthost/rules_format_whitespace.go +1 -1
- package/linthost/rules_functional.go +21 -22
- package/linthost/rules_gap.go +80 -3
- package/linthost/rules_grouped_accessor_pairs.go +84 -25
- package/linthost/rules_guard_for_in.go +64 -147
- package/linthost/rules_jsx_a11y.go +232 -22
- package/linthost/rules_logic.go +84 -38
- package/linthost/rules_nextjs.go +105 -16
- package/linthost/rules_no_class_assign.go +70 -0
- package/linthost/rules_no_duplicate_imports.go +266 -0
- package/linthost/rules_no_else_return.go +156 -38
- package/linthost/rules_no_extend_native.go +113 -17
- package/linthost/rules_no_fallthrough.go +1013 -0
- package/linthost/rules_no_func_assign.go +70 -0
- package/linthost/rules_no_import_assign.go +278 -86
- package/linthost/rules_no_inner_declarations.go +186 -0
- package/linthost/rules_no_loop_func.go +438 -53
- package/linthost/rules_no_mixed_operators.go +208 -52
- package/linthost/rules_no_param_reassign.go +376 -61
- package/linthost/rules_no_promise_executor_return.go +156 -0
- package/linthost/rules_no_restricted_imports.go +1013 -57
- package/linthost/rules_no_restricted_syntax.go +190 -26
- package/linthost/rules_no_useless_constructor.go +6 -36
- package/linthost/rules_problems.go +154 -311
- package/linthost/rules_promise.go +2578 -109
- package/linthost/rules_react_extras.go +71 -45
- package/linthost/rules_react_hooks.go +18 -2
- package/linthost/rules_react_perf.go +1 -0
- package/linthost/rules_react_refresh.go +1 -1
- package/linthost/rules_regexp.go +230 -14
- package/linthost/rules_security.go +45 -19
- package/linthost/rules_self.go +21 -1
- package/linthost/rules_solid.go +13 -7
- package/linthost/rules_storybook.go +1 -1
- package/linthost/rules_suggestions.go +490 -84
- package/linthost/rules_testing_library.go +12 -1
- package/linthost/rules_ts.go +227 -54
- package/linthost/rules_ts_async.go +0 -131
- package/linthost/rules_ts_no_base_to_string.go +3 -4
- package/linthost/rules_ts_no_misused_promises.go +817 -0
- package/linthost/rules_ts_no_restricted_types.go +320 -34
- package/linthost/rules_ts_no_unnecessary_qualifier.go +132 -55
- package/linthost/rules_ts_no_unsafe_assignment.go +608 -60
- package/linthost/rules_ts_require_array_sort_compare.go +5 -5
- package/linthost/rules_ts_switch_exhaustiveness_check.go +556 -86
- package/linthost/rules_unicorn_better_regex.go +224 -16
- package/linthost/rules_unicorn_consistent_destructuring.go +1002 -7
- package/linthost/rules_unicorn_consistent_existence_index_check.go +208 -29
- package/linthost/rules_unicorn_consistent_function_scoping.go +1041 -8
- package/linthost/rules_unicorn_consistent_template_literal_escape.go +178 -7
- package/linthost/rules_unicorn_escape_case.go +30 -19
- package/linthost/rules_unicorn_filename_case.go +763 -16
- package/linthost/rules_unicorn_import_style.go +783 -17
- package/linthost/rules_unicorn_isolated_functions.go +934 -14
- package/linthost/rules_unicorn_no_hex_escape.go +26 -11
- package/linthost/rules_unicorn_no_typeof_undefined.go +234 -25
- package/linthost/rules_unicorn_no_unnecessary_polyfills.go +376 -21
- package/linthost/rules_unicorn_no_unused_properties.go +756 -19
- package/linthost/rules_unicorn_number_literal_case.go +58 -39
- package/linthost/rules_unicorn_prefer_at.go +7 -3
- package/linthost/rules_unicorn_prefer_number_properties.go +381 -48
- package/linthost/rules_unicorn_prefer_optional_catch_binding.go +24 -24
- package/linthost/rules_unicorn_prefer_simple_condition_first.go +597 -19
- package/linthost/rules_unicorn_prefer_string_raw.go +147 -16
- package/linthost/rules_unicorn_prevent_abbreviations.go +1963 -95
- package/linthost/rules_unicorn_string_content.go +611 -15
- package/linthost/rules_unicorn_switch_case_break_position.go +172 -15
- package/linthost/rules_unicorn_template_indent.go +923 -18
- package/linthost/rules_unicorn_text_encoding_identifier_case.go +202 -42
- package/linthost/rules_unicorn_throw_new_error.go +218 -26
- package/linthost/rules_var.go +829 -142
- package/linthost/string_length.go +222 -0
- package/package.json +4 -3
- package/rule/project.go +206 -0
- package/rule/rule.go +58 -1
- package/src/index.ts +58 -17
- package/src/structures/ITtscLintConfig.ts +3 -0
- package/src/structures/TtscLintRuleSetting.ts +3 -2
- package/src/structures/format/ITtscLintFormat.ts +3 -2
- package/src/structures/format/ITtscLintFormatSortImports.ts +21 -4
- package/src/structures/rules/ITtscLintBoundariesRuleOptions.ts +122 -8
- package/src/structures/rules/ITtscLintBoundariesRules.ts +6 -8
- package/src/structures/rules/ITtscLintContributorRules.ts +18 -2
- package/src/structures/rules/ITtscLintCoreRuleOptions.ts +465 -0
- package/src/structures/rules/ITtscLintCoreRules.ts +122 -67
- package/src/structures/rules/ITtscLintRegexpRules.ts +7 -2
- package/src/structures/rules/ITtscLintRuleOptionsMap.ts +88 -7
- package/src/structures/rules/ITtscLintRules.ts +7 -2
- package/src/structures/rules/ITtscLintSolidRules.ts +0 -9
- package/src/structures/rules/ITtscLintTypeScriptRuleOptions.ts +248 -0
- package/src/structures/rules/ITtscLintTypeScriptRules.ts +64 -42
- package/src/structures/rules/ITtscLintUnicornRuleOptions.ts +350 -0
- package/src/structures/rules/ITtscLintUnicornRules.ts +60 -36
- package/src/structures/rules/index.ts +3 -0
|
@@ -27,8 +27,9 @@ export type TtscLintRuleSetting =
|
|
|
27
27
|
| readonly [TtscLintSeverity];
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* Per-rule severity-plus-options setting for rules that accept
|
|
31
|
-
* object.
|
|
30
|
+
* Per-rule severity-plus-options setting for rules that accept one typed
|
|
31
|
+
* options object. Rules with canonical positional option lists expose a
|
|
32
|
+
* dedicated setting type instead.
|
|
32
33
|
*
|
|
33
34
|
* This is the tuple form ESLint users know — `[severity, options]` — kept
|
|
34
35
|
* strongly typed by way of the rule's dedicated options interface (see
|
|
@@ -120,8 +120,9 @@ export interface ITtscLintFormat {
|
|
|
120
120
|
endOfLine?: "lf" | "crlf";
|
|
121
121
|
|
|
122
122
|
/**
|
|
123
|
-
* Import
|
|
124
|
-
* defaults, an object customizes.
|
|
123
|
+
* Import formatting. Off unless present; `true` sorts named specifiers and
|
|
124
|
+
* erased type-only imports with defaults, and an object customizes behavior.
|
|
125
|
+
* Runtime declaration reordering requires an explicit unsafe opt-in.
|
|
125
126
|
*
|
|
126
127
|
* @default false
|
|
127
128
|
*/
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Object form of {@link ITtscLintFormat.sortImports}.
|
|
3
3
|
*
|
|
4
4
|
* The declarative {@link order} array expresses group order, blank-line
|
|
5
|
-
* separation, and special groups all by position.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* separation, and special groups all by position. By default, declaration-level
|
|
6
|
+
* sorting and merging are limited to erased `import type` blocks. Runtime
|
|
7
|
+
* imports retain source order unless {@link unsafeSortRuntimeImports} is set.
|
|
8
8
|
*/
|
|
9
9
|
export interface ITtscLintFormatSortImports {
|
|
10
10
|
/**
|
|
@@ -54,9 +54,26 @@ export interface ITtscLintFormatSortImports {
|
|
|
54
54
|
* Merge a value import and a type-only import of the same module into one
|
|
55
55
|
* declaration with inline `type` specifiers: `import { foo } from "m"` plus
|
|
56
56
|
* `import type { Bar } from "m"` collapse to `import { foo, type Bar } from
|
|
57
|
-
* "m"`.
|
|
57
|
+
* "m"`. Mixed type/value blocks are left unchanged unless
|
|
58
|
+
* {@link unsafeSortRuntimeImports} is also enabled.
|
|
58
59
|
*
|
|
59
60
|
* @default false
|
|
60
61
|
*/
|
|
61
62
|
combineTypeAndValue?: boolean;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Permit declaration-level sorting and merging of runtime-bearing imports.
|
|
66
|
+
*
|
|
67
|
+
* Every default, namespace, named, and bare import can evaluate its module.
|
|
68
|
+
* Reordering those declarations can therefore change program behavior. Keep
|
|
69
|
+
* this disabled unless every imported module in the block is
|
|
70
|
+
* order-independent. Named specifiers inside a declaration and erased `import
|
|
71
|
+
* type` blocks are still sorted when this option is disabled.
|
|
72
|
+
*
|
|
73
|
+
* {@link combineTypeAndValue} only affects mixed type/value blocks when this
|
|
74
|
+
* option is enabled.
|
|
75
|
+
*
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
unsafeSortRuntimeImports?: boolean;
|
|
62
79
|
}
|
|
@@ -95,23 +95,137 @@ export type ITtscLintBoundariesNoPrivateRuleOptions =
|
|
|
95
95
|
export type ITtscLintBoundariesNoUnknownRuleOptions =
|
|
96
96
|
ITtscLintBoundariesElementsOptions;
|
|
97
97
|
|
|
98
|
+
/** One entity selector in a `boundaries/dependencies` policy. */
|
|
99
|
+
export interface ITtscLintBoundariesDependenciesEntitySelectorObject {
|
|
100
|
+
/** Element type glob(s). */
|
|
101
|
+
type?: string | readonly string[];
|
|
102
|
+
|
|
103
|
+
/** Dependency origin glob(s). */
|
|
104
|
+
origin?: "local" | "external" | "core" | readonly string[];
|
|
105
|
+
|
|
106
|
+
/** Import specifier or source-file glob(s). */
|
|
107
|
+
source?: string | readonly string[];
|
|
108
|
+
|
|
109
|
+
/** Element-local path glob(s). */
|
|
110
|
+
path?: string | readonly string[];
|
|
111
|
+
|
|
112
|
+
/** Whether the selected file is a configured entry file. */
|
|
113
|
+
entry?: boolean;
|
|
114
|
+
|
|
115
|
+
/** Whether the selected file is a configured private file. */
|
|
116
|
+
private?: boolean;
|
|
117
|
+
|
|
118
|
+
/** Whether the local target matched no configured element. */
|
|
119
|
+
unknown?: boolean;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Entity selector or legacy element-type shorthand. */
|
|
123
|
+
export type ITtscLintBoundariesDependenciesEntitySelector =
|
|
124
|
+
| string
|
|
125
|
+
| ITtscLintBoundariesDependenciesEntitySelectorObject
|
|
126
|
+
| readonly (string | ITtscLintBoundariesDependenciesEntitySelectorObject)[];
|
|
127
|
+
|
|
128
|
+
/** Metadata selector for the import or re-export itself. */
|
|
129
|
+
export interface ITtscLintBoundariesDependenciesInfoSelector {
|
|
130
|
+
/** TypeScript dependency kind. */
|
|
131
|
+
kind?: "value" | "type" | "typeof" | readonly ("value" | "type" | "typeof")[];
|
|
132
|
+
|
|
133
|
+
/** Import specifier glob(s). */
|
|
134
|
+
source?: string | readonly string[];
|
|
135
|
+
|
|
136
|
+
/** AST dependency kind glob(s), such as `ImportDeclaration`. */
|
|
137
|
+
nodeKind?: string | readonly string[];
|
|
138
|
+
|
|
139
|
+
/** Imported or re-exported name glob(s). */
|
|
140
|
+
specifiers?: string | readonly string[];
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** Complete dependency selector used by an allow/disallow effect. */
|
|
144
|
+
export interface ITtscLintBoundariesDependenciesSelector {
|
|
145
|
+
/** Importing entity selector. */
|
|
146
|
+
from?: ITtscLintBoundariesDependenciesEntitySelector;
|
|
147
|
+
|
|
148
|
+
/** Imported entity selector. */
|
|
149
|
+
to?: ITtscLintBoundariesDependenciesEntitySelector;
|
|
150
|
+
|
|
151
|
+
/** Dependency metadata selector. */
|
|
152
|
+
dependency?:
|
|
153
|
+
| ITtscLintBoundariesDependenciesInfoSelector
|
|
154
|
+
| readonly ITtscLintBoundariesDependenciesInfoSelector[];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/** One allow/disallow effect selector. */
|
|
158
|
+
export type ITtscLintBoundariesDependenciesEffect =
|
|
159
|
+
| ITtscLintBoundariesDependenciesEntitySelector
|
|
160
|
+
| ITtscLintBoundariesDependenciesSelector
|
|
161
|
+
| readonly (
|
|
162
|
+
| string
|
|
163
|
+
| ITtscLintBoundariesDependenciesEntitySelectorObject
|
|
164
|
+
| ITtscLintBoundariesDependenciesSelector
|
|
165
|
+
)[];
|
|
166
|
+
|
|
167
|
+
/** One ordered `boundaries/dependencies` policy. */
|
|
168
|
+
export interface ITtscLintBoundariesDependenciesPolicy {
|
|
169
|
+
/** Importing entity selector. Omit to match every configured source. */
|
|
170
|
+
from?: ITtscLintBoundariesDependenciesEntitySelector;
|
|
171
|
+
|
|
172
|
+
/** Imported entity selector. Omit to match every target. */
|
|
173
|
+
to?: ITtscLintBoundariesDependenciesEntitySelector;
|
|
174
|
+
|
|
175
|
+
/** Dependency metadata selector. */
|
|
176
|
+
dependency?:
|
|
177
|
+
| ITtscLintBoundariesDependenciesInfoSelector
|
|
178
|
+
| readonly ITtscLintBoundariesDependenciesInfoSelector[];
|
|
179
|
+
|
|
180
|
+
/** Selectors whose matching dependencies are allowed. */
|
|
181
|
+
allow?: ITtscLintBoundariesDependenciesEffect;
|
|
182
|
+
|
|
183
|
+
/** Selectors whose matching dependencies are rejected. */
|
|
184
|
+
disallow?: ITtscLintBoundariesDependenciesEffect;
|
|
185
|
+
|
|
186
|
+
/** Legacy dependency-kind filter; `dependency.kind` takes precedence. */
|
|
187
|
+
importKind?: "value" | "type" | "typeof";
|
|
188
|
+
|
|
189
|
+
/** Optional diagnostic override for this policy. */
|
|
190
|
+
message?: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
98
193
|
/**
|
|
99
194
|
* `boundaries/dependencies` rule options.
|
|
100
195
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* policy block. The v1 native port registers the rule name and decodes this
|
|
104
|
-
* config shape but does not yet emit diagnostics (`v1 stub; full validation
|
|
105
|
-
* deferred` — see `rules_boundaries.go`).
|
|
196
|
+
* Policies are evaluated in order and the last matching effect wins. Within one
|
|
197
|
+
* policy, `disallow` takes precedence over `allow`.
|
|
106
198
|
*/
|
|
107
199
|
export interface ITtscLintBoundariesDependenciesRuleOptions extends ITtscLintBoundariesElementsOptions {
|
|
108
200
|
/**
|
|
109
201
|
* Fallback policy when no rule matches.
|
|
110
202
|
*
|
|
111
|
-
* @default "
|
|
203
|
+
* @default "disallow"
|
|
112
204
|
*/
|
|
113
205
|
default?: "allow" | "disallow";
|
|
114
206
|
|
|
115
|
-
/** Ordered dependency policies.
|
|
116
|
-
|
|
207
|
+
/** Ordered dependency policies. Prefer this current upstream name. */
|
|
208
|
+
policies?: readonly ITtscLintBoundariesDependenciesPolicy[];
|
|
209
|
+
|
|
210
|
+
/** Ordered dependency policies; compatibility alias for `policies`. */
|
|
211
|
+
rules?: readonly ITtscLintBoundariesDependenciesPolicy[];
|
|
212
|
+
|
|
213
|
+
/** Evaluate external and `node:` dependencies as well as local targets. */
|
|
214
|
+
checkAllOrigins?: boolean;
|
|
215
|
+
|
|
216
|
+
/** Evaluate local targets that match no configured element. */
|
|
217
|
+
checkUnknownLocals?: boolean;
|
|
218
|
+
|
|
219
|
+
/** Evaluate dependencies within the same configured element root. */
|
|
220
|
+
checkInternals?: boolean;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Global diagnostic override.
|
|
224
|
+
*
|
|
225
|
+
* Supports `{{from.type}}`, `{{from.path}}`, `{{from.origin}}`,
|
|
226
|
+
* `{{to.type}}`, `{{to.path}}`, `{{to.origin}}`, `{{dependency.source}}`,
|
|
227
|
+
* `{{dependency.kind}}`, `{{dependency.nodeKind}}`, and `{{policy.index}}`
|
|
228
|
+
* placeholders.
|
|
229
|
+
*/
|
|
230
|
+
message?: string;
|
|
117
231
|
}
|
|
@@ -76,16 +76,14 @@ export interface ITtscLintBoundariesRules {
|
|
|
76
76
|
"boundaries/no-unknown"?: TtscLintRuleOptionsSetting<ITtscLintBoundariesNoUnknownRuleOptions>;
|
|
77
77
|
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
80
|
-
* intended to replace `element-types` / `entry-point` / `external` /
|
|
81
|
-
* `no-private` / `no-unknown` with a single policy block.
|
|
79
|
+
* Enforce unified, direction-aware dependency policies.
|
|
82
80
|
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
81
|
+
* Policies can select the importing and imported element, dependency origin,
|
|
82
|
+
* resolved path, entry/private/unknown state, import kind, syntax kind, and
|
|
83
|
+
* imported names. TypeScript path aliases are classified by their resolved
|
|
84
|
+
* source file rather than by the written specifier.
|
|
87
85
|
*
|
|
88
|
-
* @reference https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/docs/rules/dependencies.md
|
|
86
|
+
* @reference https://github.com/javierbrea/eslint-plugin-boundaries/blob/master/packages/website/docs/rules/dependencies.md
|
|
89
87
|
*/
|
|
90
88
|
"boundaries/dependencies"?: TtscLintRuleOptionsSetting<ITtscLintBoundariesDependenciesRuleOptions>;
|
|
91
89
|
}
|
|
@@ -7,8 +7,24 @@ import type { TtscLintSeverity } from "../TtscLintSeverity";
|
|
|
7
7
|
* Plugin authors expose rules under their own namespace prefix (`demo/no-demo`,
|
|
8
8
|
* `myplugin/foo-bar`). The signature here accepts any `"<namespace>/<rule>"`
|
|
9
9
|
* key with either the bare severity form, the severity tuple, or the
|
|
10
|
-
* severity-plus-options tuple. Plugins
|
|
11
|
-
*
|
|
10
|
+
* severity-plus-options tuple. Plugins tighten a known rule by augmenting
|
|
11
|
+
* `ITtscLintRuleOptionsMap`; the mapped overlay intersected into
|
|
12
|
+
* `ITtscLintRules` then supersedes this `unknown` fallback for that key. An
|
|
13
|
+
* optionless contributor augments this interface directly with
|
|
14
|
+
* `TtscLintRuleSetting` instead:
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* import type { TtscLintRuleSetting } from "@ttsc/lint";
|
|
18
|
+
*
|
|
19
|
+
* declare module "@ttsc/lint" {
|
|
20
|
+
* interface ITtscLintContributorRules {
|
|
21
|
+
* "demo/no-options"?: TtscLintRuleSetting;
|
|
22
|
+
* }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Contributor namespaces with no imported augmentation retain the compatible
|
|
27
|
+
* `unknown` options slot.
|
|
12
28
|
*
|
|
13
29
|
* @reference https://ttsc.dev/lint/development/rules
|
|
14
30
|
*/
|