Skip to content

Commit 655bb53

Browse files
authored
(feat): support JS & JSX files in tsdx lint (#487)
- JS & JSX are already supported in tsdx build, so this is just adding some better parity in tsdx test - more JS & JSX support also means better support for gradual TS migrations - prior to this, JS & JSX files wouldn't be linted unless explicitly included with a glob or something - extensions is also only configurable via CLIEngine, .eslintrc doesn't currently support it - fix errors & warnings in JS test files as TSDX dogfoods its own lint functionality
1 parent a31ee26 commit 655bb53

File tree

5 files changed

+2
-9
lines changed

5 files changed

+2
-9
lines changed

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ prog
593593
...config,
594594
...appPackageJson.eslint,
595595
},
596-
extensions: ['.ts', '.tsx'],
596+
extensions: ['.ts', '.tsx', '.js', '.jsx'],
597597
fix: opts.fix,
598598
ignorePattern: opts['ignore-pattern'],
599599
});
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
21
function ErrorDev(message) {
32
const error = new Error(message);
43
error.name = 'Invariant Violation';
54
return error;
65
}
76

8-
export default ErrorDev;
9-
7+
export default ErrorDev;

test/fixtures/build-withConfig/errors/ErrorProd.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
function ErrorProd(code) {
32
// TODO: replace this URL with yours
43
let url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;

test/fixtures/util.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const shell = require('shelljs');
42
const path = require('path');
53
const rootDir = process.cwd();

test/utils/psKill.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const psTree = require('ps-tree');
42

53
// Loops through processes and kills them

0 commit comments

Comments
 (0)