Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions cli/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,11 +1327,9 @@ impl CliOptions {
)?;

Ok(deno_lint::linter::LintConfig {
default_jsx_factory: transpile_options
.jsx_automatic
default_jsx_factory: (!transpile_options.jsx_automatic)
.then(|| transpile_options.jsx_factory.clone()),
default_jsx_fragment_factory: transpile_options
.jsx_automatic
default_jsx_fragment_factory: (!transpile_options.jsx_automatic)
.then(|| transpile_options.jsx_fragment_factory.clone()),
})
}
Expand Down
14 changes: 7 additions & 7 deletions tests/specs/lint/jsx/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"steps": [
{
"if": "windows",
"args": "lint main.jsx",
"output": "main_windows.out",
"exitCode": 1
"args": "lint",
"cwd": "./react",
"output": "react.out",
"exitCode": 0
},
{
"if": "unix",
"args": "lint main.jsx",
"output": "main_unix.out",
"args": "lint",
"cwd": "./react-jsx",
"output": "react-jsx.out",
"exitCode": 1
}
]
Expand Down
1 change: 0 additions & 1 deletion tests/specs/lint/jsx/main.jsx

This file was deleted.

12 changes: 0 additions & 12 deletions tests/specs/lint/jsx/main_windows.out

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
error[no-unused-vars]: `data` is never used
--> [WILDCARD]lint/jsx/main.jsx:1:7
error[no-unused-vars]: `React` is never used
--> [WILDCARD]mod.tsx:1:7
|
1 | const data = <div>hello</div>;
| ^^^^
= hint: If this is intentional, prefix it with an underscore like `_data`
1 | const React = { createElement() {} };
| ^^^^^
= hint: If this is intentional, prefix it with an underscore like `_React`

docs: https://lint.deno.land/rules/no-unused-vars

Expand Down
5 changes: 5 additions & 0 deletions tests/specs/lint/jsx/react-jsx/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"jsx": "react-jsx"
}
}
3 changes: 3 additions & 0 deletions tests/specs/lint/jsx/react-jsx/mod.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const React = { createElement() {} };

const _div = <div />;
1 change: 1 addition & 0 deletions tests/specs/lint/jsx/react.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checked 1 file
1 change: 1 addition & 0 deletions tests/specs/lint/jsx/react/deno.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions tests/specs/lint/jsx/react/mod.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const React = { createElement() {} };

const _div = <div />;