#[non_exhaustive]pub struct Js {Show 27 fields
pub enabled: bool,
pub entry: Vec<String>,
pub project: Vec<String>,
pub ignore: Vec<String>,
pub ignore_files: Vec<String>,
pub ignore_dependencies: Vec<String>,
pub ignore_binaries: Vec<String>,
pub ignore_global_binaries: bool,
pub ignore_unresolved: Vec<String>,
pub ignore_workspaces: Vec<String>,
pub ignore_exports_used_in_file: IgnoreExportsUsedInFile,
pub ignore_members: Vec<String>,
pub production: bool,
pub isolate_workspaces: bool,
pub no_gitignore: bool,
pub include_entry_exports: bool,
pub tsconfig: Option<String>,
pub use_tsconfig_files: bool,
pub include_fixtures: bool,
pub discovery: JsDiscovery,
pub cycles: JsCycles,
pub workspaces: IndexMap<String, JsWorkspace>,
pub plugins: IndexMap<String, PluginConfig>,
pub extend_ignore: Vec<String>,
pub extend_ignore_dependencies: Vec<String>,
pub extend_ignore_binaries: Vec<String>,
pub extend_ignore_unresolved: Vec<String>,
}Expand description
[js]
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolRun the JavaScript analysis.
entry: Vec<String>Entry-point globs, added to the ones plugins and package.json provide.
project: Vec<String>Globs of the files that belong to the project.
ignore: Vec<String>Globs of files that are not analysed.
ignore_files: Vec<String>Globs of files, relative to the workspace root, never reported by unused-files; other rules still analyse
them (knip’s ignoreFiles).
ignore_dependencies: Vec<String>Dependencies never reported as unused or unlisted.
ignore_binaries: Vec<String>Binaries never reported as unlisted.
ignore_global_binaries: boolNever report the system and shell tools scripts run (rm, curl, git, docker) as unlisted binaries,
since they are installed globally rather than from npm (knip’s ignoreGlobalBinaries). On by default; turn it
off to have unlisted-binaries report them unless a dependency provides them.
ignore_unresolved: Vec<String>Import specifiers never reported as unresolved. Entries are exact specifiers, globs or regular expressions
(/^@org\/.+$/), see the [js] documentation.
ignore_workspaces: Vec<String>Workspace directories (globs) the JavaScript analysis skips. Manifest and policy rules still check them.
ignore_exports_used_in_file: IgnoreExportsUsedInFileExports that other code in the same file uses are not reported: true for every kind, or a table of kinds.
ignore_members: Vec<String>Enum and namespace member names (globs or regular expressions) never reported as unused.
production: boolAnalyse production code only.
isolate_workspaces: boolknip’s strict mode. Each workspace package uses only the dependencies its own manifest lists: an import is
not satisfied by a containing package or the root. Production code must import from dependencies or
peerDependencies, type-only imports use no package, and required peer dependencies are checked like
dependencies. Set by skif --strict; not a configuration key, so a file never sets it.
no_gitignore: boolFind source files that .gitignore files hide (the git index is not used then). Set by
skif --no-gitignore; not a configuration key.
include_entry_exports: boolReport unused exports of entry files too.
tsconfig: Option<String>The TypeScript configuration of the root package, relative to the workspace root and inside it, used instead
of tsconfig.json for its path aliases and compiler options (knip’s --tsConfig). Other packages keep their
own tsconfig.json.
use_tsconfig_files: boolThe project files of a package with a TypeScript configuration are the files its files names and those its
include selects minus its exclude, instead of the project globs (knip’s --use-tsconfig-files).
include_fixtures: boolReport files in fixtures and __fixtures__ directories as unused, and their unused exports, types and
members, like any other file. Off by default: those directories hold test data that tests load by path.
discovery: JsDiscoveryHow source files are found: auto lists them from the git index and re-lists from disk every directory
modified since the index was written, which gives the walk’s result without walking every directory; git
trusts the index alone (faster, blind to untracked and deleted files); walk always walks. Both index modes
fall back to the walk when the workspace is not in a git work tree with a usable SHA-1 index.
cycles: JsCyclesWhat circular-imports reports.
workspaces: IndexMap<String, JsWorkspace>Per-workspace overrides keyed by directory. The key "." is the root workspace.
plugins: IndexMap<String, PluginConfig>Plugin switches keyed by plugin name.
extend_ignore: Vec<String>Appended to ignore instead of replacing it. Folded away when the configuration is resolved.
extend_ignore_dependencies: Vec<String>Appended to ignore-dependencies instead of replacing it. Folded away when the configuration is resolved.
extend_ignore_binaries: Vec<String>Appended to ignore-binaries instead of replacing it. Folded away when the configuration is resolved.
extend_ignore_unresolved: Vec<String>Appended to ignore-unresolved instead of replacing it. Folded away when the configuration is resolved.
Implementations§
Source§impl Js
impl Js
Sourcepub fn with_entry<I, S>(self, entry: I) -> Js
pub fn with_entry<I, S>(self, entry: I) -> Js
Sets the entry globs.
Sourcepub fn with_project<I, S>(self, project: I) -> Js
pub fn with_project<I, S>(self, project: I) -> Js
Sets the project globs.
Sourcepub const fn with_enabled(self, enabled: bool) -> Js
pub const fn with_enabled(self, enabled: bool) -> Js
Enables or disables the JavaScript analysis.
Sourcepub const fn with_production(self, production: bool) -> Js
pub const fn with_production(self, production: bool) -> Js
Restricts the analysis to production code.
Sourcepub const fn with_isolate_workspaces(self, isolate: bool) -> Js
pub const fn with_isolate_workspaces(self, isolate: bool) -> Js
Makes each workspace package use only the dependencies its own manifest lists, as knip’s --strict does.
Sourcepub fn with_tsconfig(self, path: impl Into<String>) -> Js
pub fn with_tsconfig(self, path: impl Into<String>) -> Js
Uses path, relative to the workspace root, as the TypeScript configuration of the root package.
Sourcepub const fn with_use_tsconfig_files(self, enabled: bool) -> Js
pub const fn with_use_tsconfig_files(self, enabled: bool) -> Js
Takes the project files of each package with a TypeScript configuration from its files, include and
exclude.
Sourcepub fn with_plugin(self, name: impl Into<String>, plugin: PluginConfig) -> Js
pub fn with_plugin(self, name: impl Into<String>, plugin: PluginConfig) -> Js
Switches a plugin on or off, or configures it.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Js
impl<'de> Deserialize<'de> for Js
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Js, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Js, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Js
impl JsonSchema for Js
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for Js
impl Serialize for Js
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Js
Auto Trait Implementations§
impl Forget for Js
impl Freeze for Js
impl RefUnwindSafe for Js
impl Send for Js
impl Sync for Js
impl Unpin for Js
impl UnsafeUnpin for Js
impl UnwindSafe for Js
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more