Skip to content

Commit bbcef8f

Browse files
authored
Merge pull request #1210 from aurelia/deps
chore: upgrade deps
2 parents d8707f4 + 1cb60d4 commit bbcef8f

16 files changed

+86
-77
lines changed

.eslintignore

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

.eslintrc.json

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

eslint.config.mjs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import globals from "globals";
2+
import eslint from "@eslint/js";
3+
4+
export default [
5+
{
6+
ignores: ["lib/build/amodro-trace", "**/dist"],
7+
},
8+
eslint.configs.recommended,
9+
{
10+
languageOptions: {
11+
globals: {
12+
...globals.node,
13+
...globals.jasmine,
14+
},
15+
16+
ecmaVersion: 2019,
17+
sourceType: "commonjs",
18+
},
19+
20+
rules: {
21+
"no-prototype-builtins": 0,
22+
"no-console": 0,
23+
"getter-return": 0,
24+
"no-inner-declarations": 0,
25+
26+
"comma-dangle": ["error", {
27+
arrays: "never",
28+
objects: "never",
29+
imports: "never",
30+
exports: "never",
31+
functions: "never",
32+
}],
33+
},
34+
}
35+
];

lib/build/bundle.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ exports.Bundle = class {
177177
// in AMD module environment. There is special code in lib/build/amodro-trace/write/defines.js
178178
// to bring up global var "moment".
179179
const special = [];
180-
while (true) { // eslint-disable-line no-constant-condition
180+
while (true) {
181181
const idx = sorted.findIndex(f => f.dependencyInclusion && (
182182
f.dependencyInclusion.description.name === 'jquery' ||
183183
f.dependencyInclusion.description.name === 'moment'));
@@ -284,15 +284,17 @@ exports.Bundle = class {
284284
if (base64SourceMap) {
285285
return null;
286286
}
287-
} catch (error) {
287+
} catch {
288288
// we don't want the build to fail when a sourcemap file can't be parsed
289289
return null;
290290
}
291291

292292
let converter;
293293

294294
try {
295-
converter = Convert.fromMapFileSource(file.contents.toString(), parsedPath.dir);
295+
converter = Convert.fromMapFileSource(file.contents.toString(), (filename) =>
296+
fs.readFileSync(path.resolve(parsedPath.dir, filename), 'utf-8')
297+
);
296298
} catch (e) {
297299
logger.error(e);
298300
return null;

lib/build/bundled-source.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ exports.BundledSource = class {
227227

228228
try {
229229
contents = cjsTransform(modulePath, this.contents, forceCjsWrap);
230-
} catch (ignore) {
230+
} catch {
231231
// file is not in amd/cjs format, try native es module
232232
try {
233233
contents = esTransform(modulePath, this.contents);

lib/build/dependency-description.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ exports.DependencyDescription = class {
3535

3636
try {
3737
return fs.readFileSync(p).toString();
38-
} catch (e) {
38+
} catch {
3939
console.log('error', p);
4040
return '';
4141
}

lib/build/dependency-inclusion.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const path = require('path');
22
const SourceInclusion = require('./source-inclusion').SourceInclusion;
3-
const minimatch = require('minimatch');
3+
const { minimatch } = require('minimatch');
44
const Utils = require('./utils');
55
const logger = require('aurelia-logging').getLogger('DependencyInclusion');
66

lib/build/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const Bundler = require('./bundler').Bundler;
33
const PackageAnalyzer = require('./package-analyzer').PackageAnalyzer;
44
const PackageInstaller = require('./package-installer').PackageInstaller;
55
const cacheDir = require('./utils').cacheDir;
6-
const del = require('del');
6+
const fs = require('fs');
77

88
let bundler;
99
let project;
@@ -60,7 +60,7 @@ exports.dest = function(opts) {
6060

6161
exports.clearCache = function() {
6262
// delete cache folder outside of cwd
63-
return del(cacheDir, {force: true});
63+
return fs.promises.rm(cacheDir, { recursive: true, force: true });
6464
};
6565

6666
function buildLoaderConfig(p) {

lib/build/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ exports.getCache = function(hash) {
5858
const filePath = cachedFilePath(hash);
5959
try {
6060
return JSON.parse(fs.readFileSync(filePath));
61-
} catch (e) {
61+
} catch {
6262
// ignore
6363
}
6464
};

lib/cli-options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function definedEnvironments() {
66
let files;
77
try {
88
files = fs.readdirSync('aurelia_project/environments');
9-
} catch (e) {
9+
} catch {
1010
// ignore
1111
}
1212
files && files.forEach(file => {

0 commit comments

Comments
 (0)