Skip to content

Commit

Permalink
chore: reduce number of eslint global ignores (#12303)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored Jun 6, 2024
1 parent 51abc84 commit 6836275
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 19 deletions.
41 changes: 23 additions & 18 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@ import svelte_config from '@sveltejs/eslint-config';
export default [
...svelte_config,
{
languageOptions: {
parserOptions: {
project: true
}
},
rules: {
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/require-await': 'error',
'no-undef': 'off'
}
},
Expand All @@ -23,18 +15,31 @@ export default [
'packages/adapter-cloudflare/files',
'packages/adapter-netlify/files',
'packages/adapter-node/files',
// TODO: figure out if we can ignore these only for @typescript-eslint
]
},
{
languageOptions: {
parserOptions: {
project: true
}
},
rules: {
'@typescript-eslint/await-thenable': 'error',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/require-await': 'error',
},
ignores: [
'packages/adapter-node/rollup.config.js',
'packages/adapter-node/tests/smoke.spec.js',
'packages/adapter-static/test/apps',
'packages/create-svelte/shared',
'packages/create-svelte/templates',
'packages/kit/src/core/sync/create_manifest_data/test/samples',
'packages/kit/test/apps',
'packages/kit/test/build-errors',
'packages/kit/test/prerendering',
'packages/package/test/errors',
'packages/package/test/fixtures'
'packages/adapter-static/test/apps/**/*',
'packages/create-svelte/shared/**/*',
'packages/create-svelte/templates/**/*',
'packages/kit/src/core/sync/create_manifest_data/test/samples/**/*',
'packages/kit/test/apps/**/*',
'packages/kit/test/build-errors/**/*',
'packages/kit/test/prerendering/**/*',
'packages/package/test/errors/**/*',
'packages/package/test/fixtures/**/*'
]
}
];
7 changes: 6 additions & 1 deletion packages/kit/test/apps/amp/playwright.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { config } from '../../utils.js';

config.webServer && (config.webServer.timeout = 45000); // AMP validator needs a long time to get moving
if (config.webServer) {
if (config.webServer instanceof Array) {
throw new Error('Expected a single web server');
}
config.webServer.timeout = 45000; // AMP validator needs a long time to get moving
}

// remove any projects with javaScriptEnabled
const projects = config.projects || [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { json } from '@sveltejs/kit';

if (!building) {
// @ts-expect-error
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
thisvariableisnotdefined;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export function load({ params, parent, url, untrack }) {
untrack(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
params.x;
parent();
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
url.pathname;
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
url.search;
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
export function load({ params, parent, url, untrack }) {
untrack(() => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
params.x;
parent();
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
url.pathname;
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
url.search;
});

Expand Down

0 comments on commit 6836275

Please sign in to comment.