diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0f3702f958..3ba8a5044e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -62,6 +62,7 @@ jobs: matrix: workspace: - backend + - frontend - misskey-js steps: - uses: actions/checkout@v3.3.0 @@ -78,4 +79,5 @@ jobs: cache: 'pnpm' - run: corepack enable - run: pnpm i --frozen-lockfile + - run: pnpm --filter misskey-js build # needed for typecheck - run: pnpm --filter ${{ matrix.workspace }} run typecheck diff --git a/locales/generateDTS.js b/locales/generateDTS.js index 7369dfbb47..c1542ec936 100644 --- a/locales/generateDTS.js +++ b/locales/generateDTS.js @@ -1,6 +1,6 @@ import * as fs from 'node:fs'; import * as yaml from 'js-yaml'; -import * as ts from 'typescript'; +import ts from 'typescript'; function createMembers(record) { return Object.entries(record) diff --git a/packages/frontend/.eslintrc-tsnocheck.cjs b/packages/frontend/.eslintrc-tsnocheck.cjs new file mode 100644 index 0000000000..d110d14065 --- /dev/null +++ b/packages/frontend/.eslintrc-tsnocheck.cjs @@ -0,0 +1,10 @@ +// Split from .eslintrc, so that the default eslintrc can still show error for ts-nocheck +module.exports = { + root: true, + extends: [ + './.eslintrc.cjs', + ], + rules: { + '@typescript-eslint/ban-ts-comment': ['error', { 'ts-nocheck': false }] + } +}; diff --git a/packages/frontend/.eslintrc.js b/packages/frontend/.eslintrc.cjs similarity index 100% rename from packages/frontend/.eslintrc.js rename to packages/frontend/.eslintrc.cjs diff --git a/packages/frontend/.storybook/fakes.ts b/packages/frontend/.storybook/fakes.ts index a4289cff7d..2098fbb86e 100644 --- a/packages/frontend/.storybook/fakes.ts +++ b/packages/frontend/.storybook/fakes.ts @@ -70,6 +70,7 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host = 'mi avatarUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true', avatarBlurhash: 'eQFRshof5NWBRi},juayfPju53WB?0ofs;s*a{ofjuay^SoMEJR%ay', emojis: [], + alsoKnownAs: [], bannerBlurhash: 'eQA^IW^-MH8w9tE8I=S^o{$*R4RikXtSxutRozjEnNR.RQadoyozog', bannerColor: '#000000', bannerUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true', @@ -102,6 +103,7 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host = 'mi isSuspended: false, lang: 'en', location: 'Fediverse', + movedTo: null, notesCount: 65536, pinnedNoteIds: [], pinnedNotes: [], diff --git a/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts b/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts index 18c817e0f5..5355d83021 100644 --- a/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts +++ b/packages/frontend/lib/rollup-plugin-unwind-css-module-class-name.ts @@ -258,6 +258,7 @@ export function unwindCssModuleClassName(ast: estree.Node): void { type: 'ArrayExpression', elements: node.declarations[0].init.arguments[1].elements.slice(0, __cssModulesIndex).concat(node.declarations[0].init.arguments[1].elements.slice(__cssModulesIndex + 1)), }], + optional: false, }, }], kind: 'const', diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 7d3c8b9767..08711dbb9e 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -11,7 +11,8 @@ "test": "vitest --run", "test-and-coverage": "vitest --run --coverage", "typecheck": "vue-tsc --noEmit", - "eslint": "eslint --quiet \"src/**/*.{ts,vue}\"", + "eslint": "pnpm eslint-full -c .eslintrc-tsnocheck.cjs", + "eslint-full": "eslint --quiet \"src/**/*.{ts,vue}\"", "lint": "pnpm typecheck && pnpm eslint" }, "dependencies": { @@ -140,5 +141,6 @@ "vitest-fetch-mock": "0.2.2", "vue-eslint-parser": "9.3.1", "vue-tsc": "1.8.8" - } + }, + "type": "module" } diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index c3f3337c9d..6cc84896e4 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -1,3 +1,4 @@ +// @ts-nocheck /* * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/boot/common.ts b/packages/frontend/src/boot/common.ts index 8f5de88ccd..11daf2e140 100644 --- a/packages/frontend/src/boot/common.ts +++ b/packages/frontend/src/boot/common.ts @@ -1,3 +1,4 @@ +// @ts-nocheck /* * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 7459ea0fa5..765f7feb81 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -1,3 +1,4 @@ +// @ts-nocheck /* * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/boot/sub-boot.ts b/packages/frontend/src/boot/sub-boot.ts index 2cc19f2df3..97257b0b10 100644 --- a/packages/frontend/src/boot/sub-boot.ts +++ b/packages/frontend/src/boot/sub-boot.ts @@ -1,3 +1,4 @@ +// @ts-nocheck /* * SPDX-FileCopyrightText: syuilo and other misskey contributors * SPDX-License-Identifier: AGPL-3.0-only diff --git a/packages/frontend/src/components/MkAbuseReportWindow.vue b/packages/frontend/src/components/MkAbuseReportWindow.vue index 6e0dee6973..cfb96b214d 100644 --- a/packages/frontend/src/components/MkAbuseReportWindow.vue +++ b/packages/frontend/src/components/MkAbuseReportWindow.vue @@ -30,6 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only