-
Notifications
You must be signed in to change notification settings - Fork 38.1k
Description
- VSCode Version: 1.5.2
- Mac OS Version: 10.11.6
Steps to Reproduce:
Step 1: Create a project that uses webpack to bundle some JS—running it through eslint first and telling eslint to fix any errors where possible:
// package.json
{
"scripts": {
"build": "webpack",
"watch": "webpack --watch"
},
"devDependencies": {
"eslint": "^3.5.0",
"eslint-loader": "^1.5.0",
"webpack": "^1.13.2"
}
}// webpack.config.js
module.exports = {
entry: './index.js',
output: {
filename: 'bundle.js'
},
module: {
preLoaders: [{
test: /\.js$/,
loader: 'eslint',
query: {
fix: true
}
}]
}
}Step 2: Create an .eslintrc file that has a rule that can be automatically fixed—like "semi": [2, "never"]:
// .eslintrc
{
"rules": {
"semi": [2, "never"]
}
}Step 3: Add some code in index.js (the webpack entry file) that breaks this rule:
// index.js
var foo = 'foo';Step 4: Run webpack in watch mode npm run watch
Step 5: Observe that the trailing semi colon in index.js has been automatically removed by eslint and that the file in VS Code reflect this
Step 6: With webpack still watching the file, add the semi colon back in again from within VS Code and then observe that VS Code does not refresh/reload this file when it is fixed a second time by eslint
Step 7: Confirm that index.js has been fixed by inspecting it in your file system or closing the file in VS Code and then opening it again
Notice that VS Code refreshes the file as expected when the file is first fixed, but on each subsequent fix, the file does not reload/refresh in VS Code. This works fine in SublimeText, so I assume it is a bug of VS Code's file watcher.