-
-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[help wanted] TS ERROR formatter 🤷🏻♂️ #639
Comments
Hello, how did you fixed this issue ? |
Can't remember, but hope it's will help u: "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
"fork-ts-checker-notifier-webpack-plugin": "^3.0.0",
"fork-ts-checker-webpack-plugin": "^6.3.3",
"react-refresh": "^0.10.0",
"react-refresh-typescript": "^2.0.2",
"ts-loader": "^9.2.5",
"typescript": "^4.4.3",
"webpack": "^5.53.0",
"webpack-dev-server": "^4.2.1", const ReactRefreshPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const {
createWebpackFormatter,
createCodeFrameFormatter,
} = require('fork-ts-checker-webpack-plugin/lib/formatter');
const ReactRefreshTypeScript = require('react-refresh-typescript');
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
const ForkTsCheckerNotifierWebpackPlugin = require('fork-ts-checker-notifier-webpack-plugin');
plugins.push(!isEnvProd && new ReactRefreshPlugin({ overlay: false }));
plugins.push(
new ForkTsCheckerWebpackPlugin({
formatter: createWebpackFormatter(createCodeFrameFormatter()),
eslint: {
enabled: eslintEnabled,
files: './**/*.{ts,tsx}',
options: {
baseConfig: eslintConfigTs,
configFile: path.resolve(__dirname, '.eslintrc-ts.js'),
fix: true,
...eslintOptions,
},
},
}),
);
plugins.push(
new ForkTsCheckerNotifierWebpackPlugin({
title: 'TypeScript',
excludeWarnings: false,
}),
);
config.module.rules.push({
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
loader: 'ts-loader',
options: {
transpileOnly: true,
...(!isEnvProd && {
getCustomTransformers: () => ({
before: [ReactRefreshTypeScript()],
}),
}),
}, |
Thank you ! I don't think my issue is exactly the same. It has more to do with transform applied to the file than error formatting. If fork-ts-checker could have applied Have a nice day :) |
Current behavior
How can I get console TS error formatter as codeframe type instead { file, message } object?
Expected behavior
Need TS error forrmatter as in the terminal, like this:
Steps to reproduce the issue
Issue reproduction repository
https://github.com/pmmmwh/react-refresh-webpack-plugin/tree/main/examples/typescript-without-babel
Environment
package.json
]The text was updated successfully, but these errors were encountered: