We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The plugin doesn't seem to build the path correctly on Windows. The exact same code works fine on Linux.
.eslintrc.yaml
--- root: true env: browser: true node: true es6: true parserOptions: ecmaVersion: 8 sourceType: module plugins: - require-path-exists extends: - eslint:recommended - plugin:require-path-exists/recommended rules: require-path-exists/exists: - error - webpackConfigPath: webpack.config.js
webpack.config.js
module.exports = { resolve: { alias: { '@includes': require('path').resolve(__dirname, 'public', 'global', 'resources', 'js') } } };
grunt eslint gives me this output:
grunt eslint
Warning: Error while loading rule 'require-path-exists/exists': Cannot load Webpack config: Cannot find module 'Z:GitHubProject1webpack.config.js' Use --force to continue.
The text was updated successfully, but these errors were encountered:
This is happening because when a windows path is used in a string, the backslashes have to be escaped. I have found a solution for that.
Add a check to escape backslashes only on windows.
In the file eslint-plugin-require-path-exists/src/exists.js in line 19 this lines have to be added.
if (process.platform === "win32") { pathname = pathname.replace(/\\/g, "\\\\"); }
There will be also necessary to change pathname from const to let, because now we are going to modify that. The final code will be so:
let pathname = path.resolve(fromDir); if (process.platform === "win32") { pathname = pathname.replace(/\\/g, "\\\\"); } if (webpackConfigCache[pathname]) { return webpackConfigCache[pathname]; }
I hope this solution, or other could be added as soon as possible.
Sorry, something went wrong.
No branches or pull requests
The plugin doesn't seem to build the path correctly on Windows. The exact same code works fine on Linux.
.eslintrc.yaml
webpack.config.js
Error
grunt eslint
gives me this output:The text was updated successfully, but these errors were encountered: