cli: switch out eslint and ts-checker plugins
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
"@backstage/release-manifests": "workspace:^",
|
||||
"@backstage/types": "workspace:^",
|
||||
"@manypkg/get-packages": "^1.1.3",
|
||||
"@module-federation/enhanced": "^0.9.0",
|
||||
"@octokit/graphql": "^5.0.0",
|
||||
"@octokit/graphql-schema": "^13.7.0",
|
||||
"@octokit/oauth-app": "^4.2.0",
|
||||
@@ -101,9 +102,8 @@
|
||||
"eslint-plugin-react": "^7.37.2",
|
||||
"eslint-plugin-react-hooks": "^5.0.0",
|
||||
"eslint-plugin-unused-imports": "^4.1.4",
|
||||
"eslint-webpack-plugin": "^4.2.0",
|
||||
"eslint-rspack-plugin": "^4.2.1",
|
||||
"express": "^4.17.1",
|
||||
"fork-ts-checker-webpack-plugin": "^9.0.0",
|
||||
"fs-extra": "^11.2.0",
|
||||
"git-url-parse": "^15.0.0",
|
||||
"glob": "^7.1.7",
|
||||
@@ -142,6 +142,7 @@
|
||||
"sucrase": "^3.20.2",
|
||||
"swc-loader": "^0.2.3",
|
||||
"tar": "^6.1.12",
|
||||
"ts-checker-rspack-plugin": "^1.1.5",
|
||||
"ts-morph": "^24.0.0",
|
||||
"undici": "^7.2.3",
|
||||
"util": "^0.12.3",
|
||||
@@ -169,7 +170,6 @@
|
||||
"@backstage/plugin-scaffolder-node-test-utils": "workspace:^",
|
||||
"@backstage/test-utils": "workspace:^",
|
||||
"@backstage/theme": "workspace:^",
|
||||
"@module-federation/enhanced": "^0.9.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
|
||||
"@types/cross-spawn": "^6.0.2",
|
||||
"@types/ejs": "^3.1.3",
|
||||
@@ -189,6 +189,8 @@
|
||||
"@types/yarnpkg__lockfile": "^1.1.4",
|
||||
"del": "^8.0.0",
|
||||
"esbuild-loader": "^4.0.0",
|
||||
"eslint-webpack-plugin": "^4.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^9.0.0",
|
||||
"mini-css-extract-plugin": "^2.4.2",
|
||||
"msw": "^1.0.0",
|
||||
"nodemon": "^3.0.1",
|
||||
@@ -200,6 +202,8 @@
|
||||
"@module-federation/enhanced": "^0.9.0",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
|
||||
"esbuild-loader": "^4.0.0",
|
||||
"eslint-webpack-plugin": "^4.2.0",
|
||||
"fork-ts-checker-webpack-plugin": "^9.0.0",
|
||||
"mini-css-extract-plugin": "^2.4.2",
|
||||
"terser-webpack-plugin": "^5.1.3",
|
||||
"webpack": "~5.96.0",
|
||||
@@ -215,6 +219,12 @@
|
||||
"esbuild-loader": {
|
||||
"optional": true
|
||||
},
|
||||
"eslint-webpack-plugin": {
|
||||
"optional": true
|
||||
},
|
||||
"fork-ts-checker-webpack-plugin": {
|
||||
"optional": true
|
||||
},
|
||||
"mini-css-extract-plugin": {
|
||||
"optional": true
|
||||
},
|
||||
|
||||
@@ -20,8 +20,8 @@ import { rspack, Configuration } from '@rspack/core';
|
||||
|
||||
import { BundlingPaths } from './paths';
|
||||
import { Config } from '@backstage/config';
|
||||
import ESLintPlugin from 'eslint-webpack-plugin';
|
||||
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
||||
import ESLintRspackPlugin from 'eslint-rspack-plugin';
|
||||
import { TsCheckerRspackPlugin } from 'ts-checker-rspack-plugin';
|
||||
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||
import ModuleScopePlugin from 'react-dev-utils/ModuleScopePlugin';
|
||||
import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
|
||||
@@ -156,11 +156,18 @@ export async function createConfig(
|
||||
}
|
||||
|
||||
if (checksEnabled) {
|
||||
const TsCheckerPlugin = webpack
|
||||
? (require('fork-ts-checker-webpack-plugin') as typeof import('fork-ts-checker-webpack-plugin'))
|
||||
: TsCheckerRspackPlugin;
|
||||
const ESLintPlugin = webpack
|
||||
? (require('eslint-webpack-plugin') as typeof import('eslint-webpack-plugin'))
|
||||
: ESLintRspackPlugin;
|
||||
plugins.push(
|
||||
new ForkTsCheckerWebpackPlugin({
|
||||
typescript: { configFile: paths.targetTsConfig, memoryLimit: 4096 },
|
||||
new TsCheckerPlugin({
|
||||
typescript: { configFile: paths.targetTsConfig, memoryLimit: 8192 },
|
||||
}),
|
||||
new ESLintPlugin({
|
||||
cache: false, // Cache seems broken
|
||||
context: paths.targetPath,
|
||||
files: ['**/*.(ts|tsx|mts|cts|js|jsx|mjs|cjs)'],
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user