Skip to content

Commit 9b839b9

Browse files
dependabot[bot]aivusclaude
authored
Bump eslint from 8.57.1 to 10.5.0 (#637)
* Bump eslint from 8.57.1 to 10.5.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.57.1 to 10.5.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Commits](eslint/eslint@v8.57.1...v10.5.0) --- updated-dependencies: - dependency-name: eslint dependency-version: 10.5.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Migrate ESLint config to flat config for v10 ESLint v9+ requires eslint.config.js and no longer supports .eslintrc.*, and v10 removed the deprecated formatting rules from core. Migrate to flat config: - Replace .eslintrc.yml with eslint.config.js (ESM) - Use @eslint/js for recommended config (string "eslint:recommended" refs are removed in v9+) - Re-add formatting rules via @stylistic/eslint-plugin (1:1 mapping) - Provide Node globals via the globals package - Drop global-require/no-path-concat (Node-only rules removed from core, irrelevant to this ESM codebase) - Fix 3 source issues flagged by v10's updated recommended set (no-useless-assignment, unused catch bindings) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Illia Antypenko <illia@antypenko.dev> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0d60b1b commit 9b839b9

5 files changed

Lines changed: 58 additions & 43 deletions

File tree

.eslintrc.yml

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

eslint.config.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import js from '@eslint/js';
2+
import stylistic from '@stylistic/eslint-plugin';
3+
import globals from 'globals';
4+
5+
export default [
6+
js.configs.recommended,
7+
{
8+
files: ['lib/**/*.js', 'index.mjs'],
9+
plugins: {
10+
'@stylistic': stylistic
11+
},
12+
languageOptions: {
13+
ecmaVersion: 2020,
14+
sourceType: 'module',
15+
globals: {
16+
...globals.node,
17+
...globals.mocha
18+
}
19+
},
20+
rules: {
21+
'consistent-return': 'error',
22+
'curly': 'error',
23+
'default-case': 'error',
24+
'dot-notation': 'error',
25+
'eqeqeq': 'error',
26+
'no-extend-native': 'error',
27+
'no-implicit-coercion': 'error',
28+
'no-loop-func': 'error',
29+
'no-throw-literal': 'error',
30+
'camelcase': 'error',
31+
'consistent-this': ['error', 'self'],
32+
'func-names': 'warn',
33+
'no-console': 'error',
34+
35+
'@stylistic/no-multi-spaces': 'error',
36+
'@stylistic/brace-style': ['error', '1tbs', {allowSingleLine: true}],
37+
'@stylistic/indent': ['error', 'tab', {SwitchCase: 1}],
38+
'@stylistic/linebreak-style': ['error', 'unix'],
39+
'@stylistic/eol-last': 'error',
40+
'@stylistic/quotes': ['error', 'single'],
41+
'@stylistic/semi': 'error',
42+
'@stylistic/space-infix-ops': 'error',
43+
'@stylistic/space-unary-ops': 'error',
44+
'@stylistic/space-before-function-paren': 'warn',
45+
'@stylistic/function-call-spacing': ['warn', 'never'],
46+
'@stylistic/keyword-spacing': 'error',
47+
'@stylistic/space-before-blocks': 'error'
48+
}
49+
}
50+
];

lib/resource.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ class Resource {
1717

1818
createChild (url, filename) {
1919
const child = new Resource(url, filename);
20-
let currentDepth = this.getDepth();
2120

2221
child.parent = this;
23-
child.depth = ++currentDepth;
22+
child.depth = this.getDepth() + 1;
2423

2524
this.children.push(child);
2625

lib/utils/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function getPathnameFromUrl (u) {
4949
const pathname = url.parse(u).pathname;
5050
try {
5151
return decodeURI(pathname);
52-
} catch (e) {
52+
} catch {
5353
return pathname;
5454
}
5555
}
@@ -110,7 +110,7 @@ function sanitizeFilename (filename) {
110110
function normalizeUrl (u, opts) {
111111
try {
112112
return normalize(u, extend({removeTrailingSlash: false, stripHash: true}, opts));
113-
} catch (e) {
113+
} catch {
114114
return u;
115115
}
116116
}

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"scripts": {
1212
"test": "c8 --all --reporter=text --reporter=lcov mocha --recursive --timeout 7000 ./test/unit/ ./test/functional",
1313
"test-e2e": "mocha --timeout 300000 ./test/e2e/*-test.js",
14-
"eslint": "eslint lib/** index.mjs"
14+
"eslint": "eslint lib index.mjs"
1515
},
1616
"repository": {
1717
"type": "git",
@@ -48,9 +48,12 @@
4848
"srcset": "^5.0.0"
4949
},
5050
"devDependencies": {
51+
"@eslint/js": "^10.0.1",
52+
"@stylistic/eslint-plugin": "^5.10.0",
5153
"c8": "^11.0.0",
5254
"chai": "^6.2.0",
53-
"eslint": "^8.5.0",
55+
"eslint": "^10.5.0",
56+
"globals": "^17.7.0",
5457
"mocha": "^11.0.1",
5558
"nock": "^14.0.0",
5659
"sinon": "^21.0.0"

0 commit comments

Comments
 (0)