Skip to content

Commit

Permalink
(feat): support JS & JSX files in tsdx lint (#487)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
agilgur5 authored Feb 4, 2020
1 parent a31ee26 commit 655bb53
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ prog
...config,
...appPackageJson.eslint,
},
extensions: ['.ts', '.tsx'],
extensions: ['.ts', '.tsx', '.js', '.jsx'],
fix: opts.fix,
ignorePattern: opts['ignore-pattern'],
});
Expand Down
4 changes: 1 addition & 3 deletions test/fixtures/build-withConfig/errors/ErrorDev.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@

function ErrorDev(message) {
const error = new Error(message);
error.name = 'Invariant Violation';
return error;
}

export default ErrorDev;

export default ErrorDev;
1 change: 0 additions & 1 deletion test/fixtures/build-withConfig/errors/ErrorProd.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

function ErrorProd(code) {
// TODO: replace this URL with yours
let url = 'https://reactjs.org/docs/error-decoder.html?invariant=' + code;
Expand Down
2 changes: 0 additions & 2 deletions test/fixtures/util.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const shell = require('shelljs');
const path = require('path');
const rootDir = process.cwd();
Expand Down
2 changes: 0 additions & 2 deletions test/utils/psKill.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const psTree = require('ps-tree');

// Loops through processes and kills them
Expand Down

0 comments on commit 655bb53

Please sign in to comment.