Closed lerit closed 3 years ago
It follows webpack's semantics so if you would have errors that are produced by other webpack's plugins, they should look the same. Therefore, I don't think we should change the behavior of the plugin. I would suggest changing the context :)
@piotr-oles in fact, eslint plugin output correct: this is my webpack setting:
new ESLintPlugin({
files: ['**/*.js'],
formatter: 'codeframe'
}),
new ForkTsCheckerWebpackPlugin({
formatter: { type: 'codeframe', options: { highlightCode: true } },
typescript: {
enabled: true,
configFile: path.resolve(config.context, 'tsconfig.server.json')
},
eslint: {
enabled: true,
files: ['**/*.js'],
options: {
}
}
})
and output:
i can open eslint file,because it prefix with server
after some research,the reason why eslintplugin work fine: 1.eslintplugin use eslint 2.eslint format base on process.cwd https://github.com/eslint/eslint/blob/022257a71b7579cf88cf3b8b936a696e8d2a09ed/lib/cli-engine/formatters/codeframe.js#L33
Ok, if it improves developer experience, I think it makes sense to change to process.cwd. Would you like to create a PR?
Will be released in few minutes :)
:tada: This issue has been resolved in version 6.0.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Current behavior
i use vscode ,it work fine with v4,when error in console,i can opened the file,but not work after upgrade to v5. for some research,the file location lose 'server' prefix. this line cause the issue: https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/blob/master/src/formatter/WebpackFormatter.ts#L16 this is my folder structure:
the webpack config context is 'server'
Current behavior
Expected behavior
Environment
package.json
]package.json
] 3.9.3package.json
] 7.0.0package.json
] 4.43