Skip to content

Commit

Permalink
fix(deno-lint): enable tsx when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Sep 1, 2021
1 parent 36cde05 commit 523e366
Show file tree
Hide file tree
Showing 3 changed files with 1,236 additions and 1,193 deletions.
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
"devDependencies": {
"@napi-rs/cli": "^1.2.1",
"@swc-node/register": "^1.3.4",
"@typescript-eslint/eslint-plugin": "^4.29.3",
"@typescript-eslint/parser": "^4.29.3",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.30.0",
"ava": "^3.15.0",
"benchmark": "^2.1.4",
"codecov": "^3.8.3",
"cross-env": "^7.0.3",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.24.2",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-sonarjs": "^0.10.0",
"husky": "^7.0.2",
"lerna": "^4.0.0",
Expand All @@ -42,7 +42,7 @@
"nyc": "^15.1.0",
"prettier": "^2.3.2",
"tslib": "^2.3.1",
"typescript": "^4.3.5"
"typescript": "^4.4.2"
},
"ava": {
"extensions": ["ts"],
Expand Down
6 changes: 5 additions & 1 deletion packages/deno-lint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ fn lint_command(ctx: CallContext) -> Result<JsBoolean> {
let ts_config = TsConfig {
dynamic_import: true,
decorators: true,
tsx: p.ends_with(".tsx"),
tsx: p
.extension()
.and_then(|ext| ext.to_str())
.map(|ext| ext == "tsx")
.unwrap_or(false),
..Default::default()
};
let syntax = Syntax::Typescript(ts_config);
Expand Down

0 comments on commit 523e366

Please sign in to comment.