Skip to content

Commit ff35e8d

Browse files
authored
[chore] improvement lint config (#2546)
1 parent e7df4d9 commit ff35e8d

File tree

15 files changed

+20
-16
lines changed

15 files changed

+20
-16
lines changed

.changeset/plenty-files-give.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
Improvement lint config. (@typescript-eslint/no-unused-vars)

packages/adapter-static/test/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function spawn(str, opts) {
7979

8080
child.on('error', reject);
8181

82-
child.on('exit', (code) => {
82+
child.on('exit', () => {
8383
fulfil();
8484
});
8585
});

packages/kit/src/core/create_app/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export function create_app({ manifest_data, output, cwd = process.cwd() }) {
3333
const base = path.relative(cwd, dir);
3434

3535
write_if_changed(`${dir}/manifest.js`, generate_client_manifest(manifest_data, base));
36-
write_if_changed(`${dir}/root.svelte`, generate_app(manifest_data, base));
36+
write_if_changed(`${dir}/root.svelte`, generate_app(manifest_data));
3737
}
3838

3939
/**
@@ -110,9 +110,8 @@ function generate_client_manifest(manifest_data, base) {
110110

111111
/**
112112
* @param {ManifestData} manifest_data
113-
* @param {string} base
114113
*/
115-
function generate_app(manifest_data, base) {
114+
function generate_app(manifest_data) {
116115
// TODO remove default layout altogether
117116

118117
const max_depth = Math.max(

packages/kit/src/core/dev/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ async function create_plugin(config, dir, cwd, get_manifest) {
313313
handle: user_hooks.handle || (({ request, resolve }) => resolve(request)),
314314
handleError:
315315
user_hooks.handleError ||
316-
(({ /** @type {Error & { frame?: string }} */ error, request }) => {
316+
(({ /** @type {Error & { frame?: string }} */ error }) => {
317317
console.error(colors.bold().red(error.message));
318318
if (error.frame) {
319319
console.error(colors.gray(error.frame));

packages/kit/src/runtime/server/page/load_node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ export async function load_node({
218218

219219
if (response) {
220220
const proxy = new Proxy(response, {
221-
get(response, key, receiver) {
221+
get(response, key, _receiver) {
222222
async function text() {
223223
const body = await response.text();
224224

packages/kit/test/apps/amp/src/routes/styles/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as assert from 'uvu/assert';
22

33
/** @type {import('test').TestMaker} */
4-
export default function (test, is_dev) {
4+
export default function (test) {
55
test('only includes CSS for rendered components', '/styles', async ({ page }) => {
66
const style = await page.innerHTML('style[amp-custom]');
77

packages/kit/test/apps/basics/src/routes/asset-import/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as assert from 'uvu/assert';
22

33
/** @type {import('test').TestMaker} */
44
export default function (test, is_dev) {
5-
test('handles static asset imports', '/asset-import', async ({ base, page, js }) => {
5+
test('handles static asset imports', '/asset-import', async ({ base, page }) => {
66
const sources = await page.evaluate(() =>
77
[...document.querySelectorAll('img')].map((img) => img.src)
88
);

packages/kit/test/apps/basics/src/routes/errors/nested-error-page/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as assert from 'uvu/assert';
22

33
/** @type {import('test').TestMaker} */
4-
export default function (test, is_dev) {
4+
export default function (test) {
55
test(
66
'renders the closest error page',
77
'/errors/nested-error-page',

packages/kit/test/apps/basics/src/routes/etag/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function (test) {
55
test(
66
'generates etag/304 for text body',
77
null,
8-
async ({ response, fetch }) => {
8+
async ({ fetch }) => {
99
const r1 = await fetch('/etag/text');
1010
const etag = r1.headers.get('etag');
1111
assert.ok(!!etag);

packages/kit/test/apps/basics/src/routes/load/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as ports from 'port-authority';
33
import * as assert from 'uvu/assert';
44

55
/** @type {import('test').TestMaker} */
6-
export default function (test, is_dev) {
6+
export default function (test) {
77
test('loads', '/load', async ({ page }) => {
88
assert.equal(await page.textContent('h1'), 'bar == bar?');
99
});

packages/kit/test/apps/basics/src/routes/no-hydrate/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as assert from 'uvu/assert';
22

33
/** @type {import('test').TestMaker} */
4-
export default function (test, is_dev) {
4+
export default function (test) {
55
test('does not hydrate page with hydrate=false', '/no-hydrate', async ({ page, js }) => {
66
await page.click('button');
77
assert.equal(await page.textContent('button'), 'clicks: 0');

packages/kit/test/apps/basics/src/routes/no-router/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as assert from 'uvu/assert';
22

33
/** @type {import('test').TestMaker} */
4-
export default function (test, is_dev) {
4+
export default function (test) {
55
test('disables router if router=false', '/no-router/a', async ({ page, clicknav, js }) => {
66
if (js) {
77
await page.click('button');

packages/kit/test/apps/basics/src/routes/no-ssr/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as assert from 'uvu/assert';
22

33
/** @type {import('test').TestMaker} */
4-
export default function (test, is_dev) {
4+
export default function (test) {
55
test('does not SSR page with ssr=false', '/no-ssr', async ({ page, js }) => {
66
if (js) {
77
assert.equal(await page.textContent('h1'), 'content was rendered');

packages/kit/test/apps/basics/src/routes/redirect/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as assert from 'uvu/assert';
22

33
/** @type {import('test').TestMaker} */
4-
export default function (test, is_dev) {
4+
export default function (test) {
55
test('redirect', '/redirect', async ({ base, page, clicknav }) => {
66
await clicknav('[href="/redirect/a"]');
77

packages/kit/test/apps/basics/src/routes/routing/_tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export default function (test, is_dev) {
205205
}
206206
);
207207

208-
test('fallthrough', '/routing/fallthrough-simple/invalid', async ({ page, clicknav }) => {
208+
test('fallthrough', '/routing/fallthrough-simple/invalid', async ({ page }) => {
209209
assert.equal(await page.textContent('h1'), 'Page');
210210
});
211211

0 commit comments

Comments
 (0)