Skip to content

Commit 50bee18

Browse files
authored
Merge pull request #23 from pgAdmin/upgrade_babel_and_eslint
Upgrade babel and eslint
2 parents e2c7a02 + 5730339 commit 50bee18

File tree

6 files changed

+1765
-1317
lines changed

6 files changed

+1765
-1317
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

babel.config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
["@babel/preset-env", {
4+
"targets": {
5+
"node": true
6+
},
7+
"loose": true
8+
}]]
9+
}

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-parallel",
3-
"version": "1.1.1",
3+
"version": "1.2.0",
44
"main": "lib/linter.js",
55
"description": "Tiny eslint wrapper to allow executing javascript linting in parallel.",
66
"author": "Alan Souza",
@@ -15,21 +15,21 @@
1515
"eslint-parallel": "./lib/cli.js"
1616
},
1717
"dependencies": {
18-
"babel-core": "^6.26.0",
19-
"chalk": "^1.1.3",
18+
"@babel/register": "^7.10.5",
19+
"chalk": "^4.1.0",
2020
"eslint": "^6.1.0",
2121
"text-table": "^0.2.0"
2222
},
2323
"devDependencies": {
24-
"babel-cli": "^6.26.0",
25-
"babel-eslint": "^10.0.3",
26-
"babel-preset-es2015": "^6.9.0"
24+
"@babel/cli": "^7.10.5",
25+
"@babel/core": "^7.10.5",
26+
"@babel/preset-env": "^7.10.4"
2727
},
2828
"peerDependencies": {
2929
"eslint": ">=6.1.0"
3030
},
3131
"scripts": {
32-
"build": "node_modules/.bin/babel src --out-dir lib --copy-files --loose-mode",
32+
"build": "node_modules/.bin/babel src --out-dir lib --copy-files",
3333
"prepublishOnly": "npm run build"
3434
}
3535
}

src/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env node
2-
require('babel-register');
2+
require('@babel/register');
33

44
/**
55
* NPM dependencies

src/linter.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import { fork } from 'child_process';
1010
* NPM dependencies
1111
**/
1212
import { CLIEngine } from 'eslint';
13-
import { listFilesToProcess } from 'eslint/lib/util/glob-utils.js';
14-
import glob from 'glob';
13+
import { FileEnumerator } from 'eslint/lib/cli-engine/file-enumerator';
14+
import { CascadingConfigArrayFactory } from 'eslint/lib/cli-engine/cascading-config-array-factory';
1515

1616
/**
1717
* Local dependencies
@@ -20,6 +20,21 @@ import { formatResults } from './formatter';
2020

2121
const cpuCount = os.cpus().length;
2222

23+
function listFilesToProcess(patterns, options) {
24+
return Array.from(
25+
new FileEnumerator({
26+
...options,
27+
configArrayFactory: new CascadingConfigArrayFactory({
28+
...options,
29+
30+
// Disable "No Configuration Found" error.
31+
useEslintrc: false
32+
})
33+
}).iterateFiles(patterns),
34+
({ filePath, ignored }) => ({ filename: filePath, ignored })
35+
);
36+
}
37+
2338
function hasEslintCache(options) {
2439
const cacheLocation = (
2540
options.cacheFile || options.cacheLocation || path.join(

0 commit comments

Comments
 (0)