Skip to content

Commit 74cd999

Browse files
better-salmonwmertens
authored andcommitted
chore(eslint): Update ESLint configurations and fix linting scripts
1 parent ad7178d commit 74cd999

File tree

60 files changed

+129
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+129
-178
lines changed

.changeset/changelog-github-custom.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ const changelogFunctions: ChangelogFunctions = {
1212
'Please provide a repo to this changelog generator like this:\n"changelog": ["@changesets/changelog-github", { "repo": "org/repo" }]'
1313
);
1414
}
15-
if (dependenciesUpdated.length === 0) return '';
15+
if (dependenciesUpdated.length === 0) {
16+
return '';
17+
}
1618

1719
const changesetLink = `- Updated dependencies [${(
1820
await Promise.all(
1921
changesets.map(async (cs) => {
2022
if (cs.commit) {
21-
let { links } = await getInfo({
23+
const { links } = await getInfo({
2224
repo: options.repo,
2325
commit: cs.commit,
2426
});
@@ -45,12 +47,14 @@ const changelogFunctions: ChangelogFunctions = {
4547

4648
let prFromSummary: number | undefined;
4749
let commitFromSummary: string | undefined;
48-
let usersFromSummary: string[] = [];
50+
const usersFromSummary: string[] = [];
4951

5052
const replacedChangelog = changeset.summary
5153
.replace(/^\s*(?:pr|pull|pull\s+request):\s*#?(\d+)/im, (_, pr) => {
52-
let num = Number(pr);
53-
if (!isNaN(num)) prFromSummary = num;
54+
const num = Number(pr);
55+
if (!isNaN(num)) {
56+
prFromSummary = num;
57+
}
5458
return '';
5559
})
5660
.replace(/^\s*commit:\s*([^\s]+)/im, (_, commit) => {
@@ -91,7 +95,7 @@ const changelogFunctions: ChangelogFunctions = {
9195
}
9296
const commitToFetchFrom = commitFromSummary || changeset.commit;
9397
if (commitToFetchFrom) {
94-
let { links } = await getInfo({
98+
const { links } = await getInfo({
9599
repo: options.repo,
96100
commit: commitToFetchFrom,
97101
});

.changeset/giant-carpets-brake.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'create-qwik': patch
3+
'@builder.io/qwik-city': patch
4+
'@builder.io/qwik': patch
5+
---
6+
7+
Fix linting errors which were previously being ignored across the monorepo.

eslint.config.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,26 @@ const ignores = [
2222
'**/tsdoc-metadata.json',
2323
'**/.DS_Store',
2424
'**/*.mp4',
25-
'scripts/**/*',
25+
'scripts',
2626
'**/server/**/*.js',
2727
'**/*.tsbuildinfo',
28-
'packages/docs/api/**/*',
28+
'packages/docs/api',
2929
'packages/docs/public/repl/repl-sw.js*',
30-
'packages/docs/src/routes/examples/apps/**/*',
31-
'packages/docs/src/routes/playground/app/**/*',
32-
'packages/docs/src/routes/tutorial/**/*',
33-
'packages/qwik-labs/lib/**/*',
34-
'packages/qwik-labs/lib-types/**/*',
35-
'packages/qwik-labs/vite/**/*',
30+
'packages/docs/src/routes/examples/apps',
31+
'packages/docs/src/routes/playground/app',
32+
'packages/docs/src/routes/tutorial',
33+
'packages/qwik-labs/lib',
34+
'packages/qwik-labs/lib-types',
35+
'packages/qwik-labs/vite',
3636
'packages/insights/drizzle.config.ts',
3737
'packages/insights/panda.config.ts',
3838
'starters/apps/base',
3939
'starters/apps/library',
4040
'starters/templates',
4141
'**/vite.config.ts',
42+
// packages with eslint.config.mjs
43+
'packages/qwik-labs',
44+
'packages/insights',
4245
];
4346

4447
export default tseslint.config(
@@ -89,6 +92,17 @@ export default tseslint.config(
8992
'@typescript-eslint/no-var-requires': 'off',
9093
curly: 'error',
9194
'no-new-func': 'error',
95+
'@typescript-eslint/no-empty-object-type': 'off',
96+
'@typescript-eslint/no-unused-expressions': 'off',
97+
'@typescript-eslint/no-unsafe-function-type': 'off',
98+
'@typescript-eslint/no-require-imports': 'off',
99+
'@typescript-eslint/no-wrapper-object-types': 'off',
100+
},
101+
},
102+
{
103+
files: ['packages/docs/**/*.{ts,tsx}'],
104+
rules: {
105+
'no-console': 'off',
92106
},
93107
}
94108
);

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@
226226
"link.dist.npm": "cd packages/qwik && npm link && cd ../qwik-city && npm link && cd ../eslint-plugin-qwik && npm link && cd ../qwik-react && npm link",
227227
"link.dist.yarn": "cd packages/qwik && yarn link && cd ../qwik-city && yarn link && cd ../eslint-plugin-qwik && yarn link && cd ../qwik-react && yarn link",
228228
"lint": "pnpm lint.eslint && pnpm lint.prettier && pnpm lint.rust",
229-
"lint.eslint": "eslint --cache \"**/*.ts*\"",
230-
"lint.fix": "eslint --fix \"**/*.ts*\" && pnpm prettier.fix",
229+
"lint.eslint": "eslint --cache \"**/*.ts*\" && pnpm -r --parallel lint",
230+
"lint.fix": "eslint --fix \"**/*.ts*\" && pnpm -r --parallel lint.fix && pnpm prettier.fix",
231231
"lint.prettier": "prettier --cache --check .",
232232
"lint.rust": "make lint",
233233
"lint.syncpack": "syncpack list-mismatches",

packages/create-qwik/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import { runCreateCli } from './src/run-create-cli';
32
import { runCreateInteractiveCli } from './src/run-create-interactive-cli';
43
import { panic, printHeader } from '../qwik/src/cli/utils/utils';

packages/create-qwik/src/run-create-interactive-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { join, relative } from 'node:path';
77
import type { CreateAppResult } from '../../qwik/src/cli/types';
88
import { clearDir } from './helpers/clearDir';
99
import { createApp } from './create-app';
10-
/* eslint-disable no-console */
10+
1111
import fs from 'node:fs';
1212
import { getRandomJoke } from './helpers/jokes';
1313
import { installDepsCli } from './helpers/installDepsCli';

packages/docs/codesandbox.sync.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import { readdirSync, readFileSync, writeFileSync } from 'node:fs';
32
import { join } from 'node:path';
43

packages/docs/contributors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import { fetch } from 'undici';
32
import fs from 'node:fs';
43
import path from 'node:path';

packages/docs/src/components/router-head/router-head.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import { component$ } from '@builder.io/qwik';
32
import { useDocumentHead, useLocation } from '@builder.io/qwik-city';
43
import { Social } from './social';

packages/docs/src/repl/repl-version.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable no-console */
21
import { QWIK_PKG_NAME, bundled } from './bundled';
32

43
const bundledVersion = bundled[QWIK_PKG_NAME].version;

0 commit comments

Comments
 (0)