Skip to content

Commit f38eab5

Browse files
committed
refactor: remove the useless getters and setters from CompilerOptions (#858)
1 parent af29d00 commit f38eab5

File tree

4 files changed

+88
-285
lines changed

4 files changed

+88
-285
lines changed

src/tests/pnp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,6 @@ fn test_resolve_tsconfig_extends_with_pnp() {
218218
});
219219

220220
let resolution = resolver.resolve_tsconfig(&fixture).expect("resolved");
221-
let compiler_options = resolution.compiler_options();
221+
let compiler_options = &resolution.compiler_options;
222222
assert_eq!(compiler_options.target, Some("esnext".to_string()));
223223
}

src/tests/tsconfig_extends.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fn test_extend_tsconfig() {
2828
assert_eq!(resolution.include, Some(vec!["include".to_string()]));
2929
assert_eq!(resolution.exclude, Some(vec!["exclude".to_string()]));
3030

31-
let compiler_options = resolution.compiler_options();
31+
let compiler_options = &resolution.compiler_options;
3232
assert_eq!(compiler_options.base_url, Some(f.join("src")));
3333
assert_eq!(compiler_options.allow_js, Some(true));
3434
assert_eq!(compiler_options.emit_decorator_metadata, Some(true));
@@ -72,7 +72,7 @@ fn test_extend_tsconfig_override_behavior() {
7272
});
7373

7474
let resolution = resolver.resolve_tsconfig(&f).expect("resolved");
75-
let compiler_options = resolution.compiler_options();
75+
let compiler_options = &resolution.compiler_options;
7676

7777
// Child should override parent values
7878
assert_eq!(compiler_options.jsx, Some("react".to_string()));
@@ -128,7 +128,7 @@ fn test_extend_tsconfig_multiple_inheritance() {
128128
});
129129

130130
let resolution = resolver.resolve_tsconfig(&f).expect("resolved");
131-
let compiler_options = resolution.compiler_options();
131+
let compiler_options = &resolution.compiler_options;
132132

133133
// Should have settings from all configs in the chain
134134
assert_eq!(compiler_options.experimental_decorators, Some(true));
@@ -149,7 +149,7 @@ fn test_extend_tsconfig_preserves_child_settings() {
149149
});
150150

151151
let resolution = resolver.resolve_tsconfig(&f).expect("resolved");
152-
let compiler_options = resolution.compiler_options();
152+
let compiler_options = &resolution.compiler_options;
153153

154154
// Child should preserve its own settings and not inherit conflicting ones
155155
assert_eq!(compiler_options.jsx, Some("preserve".to_string())); // Child value
@@ -185,7 +185,7 @@ fn test_extend_tsconfig_no_override_existing() {
185185
child_tsconfig.extend_tsconfig(&parent_tsconfig);
186186
let child_built = child_tsconfig.build();
187187

188-
let compiler_options = child_built.compiler_options();
188+
let compiler_options = &child_built.compiler_options;
189189

190190
// Child's jsx should be preserved
191191
assert_eq!(compiler_options.jsx, Some("preserve".to_string()));

src/tests/tsconfig_paths.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fn test_merge_tsconfig() {
272272
let resolver = Resolver::default();
273273
let dir = super::fixture_root().join("tsconfig/cases/merge_compiler_options");
274274
let resolution = resolver.resolve_tsconfig(&dir).expect("resolved");
275-
let compiler_options = resolution.compiler_options();
275+
let compiler_options = &resolution.compiler_options;
276276
assert_eq!(compiler_options.experimental_decorators, Some(true));
277277
assert_eq!(compiler_options.jsx, Some("react-jsx".to_string()));
278278
assert_eq!(compiler_options.jsx_factory, Some("h".to_string()));
@@ -287,7 +287,7 @@ fn test_no_merge_tsconfig() {
287287
let resolver = Resolver::default();
288288
let dir = super::fixture_root().join("tsconfig/cases/no_merge_compiler_options");
289289
let resolution = resolver.resolve_tsconfig(&dir).expect("resolved");
290-
let compiler_options = resolution.compiler_options();
290+
let compiler_options = &resolution.compiler_options;
291291
assert_eq!(compiler_options.experimental_decorators, Some(true));
292292
assert_eq!(compiler_options.jsx, Some("react-jsx".to_string()));
293293
assert_eq!(compiler_options.jsx_factory, Some("h".to_string()));

0 commit comments

Comments
 (0)