mirror of
https://github.com/go-gitea/gitea
synced 2026-02-03 08:50:36 +00:00
Add knip linter (#36442)
This adds [knip](https://github.com/webpro-nl/knip), a tool to find unused files, dependencies and exports in JS. Fixed all discovered issues. 1. knip apparently has some issue resolving imports from `d.ts` to `.ts` so I worked around it by moving the two affected types to where they are used. 2. I don't know why `modules/fomantic/dropdown.ts` had a new typescript error, but I fixed it. 3. Use named export for `EsbuildPlugin`, I think this was added recently.
This commit is contained in:
+1
-2
@@ -4,7 +4,7 @@ import LicenseCheckerWebpackPlugin from '@techknowlogick/license-checker-webpack
|
||||
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
||||
import MonacoWebpackPlugin from 'monaco-editor-webpack-plugin';
|
||||
import {VueLoaderPlugin} from 'vue-loader';
|
||||
import EsBuildLoader from 'esbuild-loader';
|
||||
import {EsbuildPlugin} from 'esbuild-loader';
|
||||
import {parse} from 'node:path';
|
||||
import webpack, {type Configuration, type EntryObject} from 'webpack';
|
||||
import {fileURLToPath} from 'node:url';
|
||||
@@ -13,7 +13,6 @@ import {env} from 'node:process';
|
||||
import tailwindcss from 'tailwindcss';
|
||||
import tailwindConfig from './tailwind.config.ts';
|
||||
|
||||
const {EsbuildPlugin} = EsBuildLoader;
|
||||
const {SourceMapDevToolPlugin, DefinePlugin, EnvironmentPlugin} = webpack;
|
||||
const formatLicenseText = (licenseText: string) => wrapAnsi(licenseText || '', 80).trim();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user