Comments (12)
@JaKXz I'll look into how webpack plugins work and try to understand what's going into the plugin and what's coming out. But the best result probably is to begin a discussion on stylelint.
from stylelint-webpack-plugin.
I catch similar bug, temporary solution:
const DEV_SERVER = path.basename(require.main.filename) === 'webpack-dev-server.js';
...
new StyleLintPlugin({
fix: !DEV_SERVER,
}),
from stylelint-webpack-plugin.
@renarsvilnis thanks for reporting this. I think it should be discussed upstream in stylelint to see how non-correctable errors should be handled, but perhaps this plugin should also be able to detect this kind of infinite loop...
I'm not sure where to start yet, and don't have the cycles to investigate ATM, so if you think you can put in a failing test then that would be a great start!
from stylelint-webpack-plugin.
@renarsvilnis Have you found a solution or workaround to this problem?
from stylelint-webpack-plugin.
Enabling the caching for stylelint seems to improve the situation a lot, although not all build loops are gone, e.g. when I add a blank line at the end of a CSS rule block I still run into a build loop.
from stylelint-webpack-plugin.
I've create a repo to show this issue.
After npm install
and exec npm start
, it will run into endless status.
from stylelint-webpack-plugin.
Any follow up in this behavior? In my situation, the loop happens even if there is no error in the file.
from stylelint-webpack-plugin.
I would accept a PR that adds @dkrnl's workaround as the default for the fix
option, i.e.
options = assign({
fix: path.basename(require.main.filename) !== 'webpack-dev-server.js',
...
})
but I'm not a fan of that as a complete solution [yet]. Any deeper investigation is welcomed!
from stylelint-webpack-plugin.
Also having this problem with webpack when using the webpack --watch
command.
Here's my setup:
/package.json
{
"name": "LintTest",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "webpack -p",
"watch": "webpack --watch"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.1",
"css-loader": "^0.28.8",
"extract-text-webpack-plugin": "^3.0.2",
"node-sass": "^4.7.2",
"postcss-loader": "^2.0.10",
"sass-loader": "^6.0.6",
"stylelint": "^8.4.0",
"stylelint-webpack-plugin": "^0.9.0",
"webpack": "^3.10.0"
},
"browserslists": [">= 1%", "last 20 versions"]
}
/webpack.config.js:
const path = require("path");
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const StyleLintPlugin = require("stylelint-webpack-plugin");
const config = {
entry: ["./src/js/index.js", "./src/css/main.scss"],
output: {
path: path.resolve(__dirname, "public"),
filename: "js/bundle.js"
},
module: {
rules: [
{
test: /\.js$/,
use: "babel-loader"
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract([
"css-loader",
"postcss-loader",
"sass-loader"
])
}
]
},
plugins: [
new ExtractTextPlugin({
filename: "css/styles.css",
allChunks: true
}),
new StyleLintPlugin({
configFile: ".stylelintrc",
files: "src/**/*.scss",
syntax: "scss",
fix: true
})
]
};
module.exports = config;
/.stylelintrc:
{
"rules": {
"indentation": 2,
"string-quotes": "single",
"color-hex-case": "lower",
"color-hex-length": "short",
"selector-no-qualifying-type": true,
"selector-combinator-space-after": "always",
"selector-attribute-quotes": "always",
"selector-attribute-operator-space-before": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-brackets-space-inside": "never",
"declaration-block-trailing-semicolon": "always",
"declaration-colon-space-before": "never",
"declaration-colon-space-after": "always",
"property-no-vendor-prefix": true,
"value-no-vendor-prefix": true,
"number-leading-zero": "always",
"function-url-quotes": "always",
"font-family-name-quotes": "always-where-required",
"comment-whitespace-inside": "always",
"at-rule-no-vendor-prefix": true,
"selector-pseudo-element-colon-notation": "double",
"selector-no-vendor-prefix": true,
"media-feature-range-operator-space-before": "always",
"media-feature-range-operator-space-after": "always",
"media-feature-parentheses-space-inside": "never",
"media-feature-name-no-vendor-prefix": true,
"media-feature-colon-space-before": "never",
"media-feature-colon-space-after": "always"
}
}
from stylelint-webpack-plugin.
Hi, is there any progress on this? the fix fix: path.basename(require.main.filename) !== 'webpack-dev-server.js',
doesn't work for me
from stylelint-webpack-plugin.
This issus may due to Files created right before watching starts make watching go into a loop, after add time-fix-plugin, it work well with fix: true
config.
from stylelint-webpack-plugin.
Upgrade to latest version, if problem persists reopen this
from stylelint-webpack-plugin.
Related Issues (20)
- I get [object Object] instead of the error message on error HOT 4
- ERROR in Stylelint is not defined HOT 1
- webpack terminates watch if there is an error in the style files HOT 2
- Auto fix not works
- Roadmap v3
- v2.2.0 causes webpack to run longer times HOT 10
- 3.0.0 throws ERR_REQUIRE_ESM on use HOT 3
- Could you provide a compatible version of 2.x for stylelint 14? HOT 5
- update v3.0.1 dependency for stylelint v14
- Option ‘overrides’ dont't work!!! HOT 1
- `@types/stylelint` is deprecated HOT 1
- Remove @types/stylelint since stylelint has it's own types
- Stylelint does not ignore files inside build directory HOT 2
- Add [stylelint] prefix to CLI output for better debugging
- Drop node v12 HOT 1
- DeprecationWarning: [hash] is now [fullhash] HOT 4
- Migrating Stylelint from 13.13.1 to 14.16.0 will stop Webpack process at "92% sealing asset processing StylelintWebpackPlugin_1" HOT 3
- Support stylelint ^15.0.0 HOT 2
- Enable `cache` by default
- Stylelint v16 Breaks Plugin in Webpack HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylelint-webpack-plugin.