Comments (5)
Fixed in 1.3.1 🎉
from htmlhint-loader.
Wondering if I need to install htmlhint
as a devDep, require it in my webpack.config.js
, point options.htmlhint
to it...
from htmlhint-loader.
I found the problem:
// index.js - line ~143
const options = Object.assign(
{ // Loader defaults
formatter: defaultFormatter,
emitAs: null, // Can be either warning or error
failOnError: false,
failOnWarning: false,
customRules: [],
configFile: DEFAULT_CONFIG_FILE
},
this.options.htmlhint || {}, // PROBLEM
loaderUtils.getOptions(this) // Loader query string
);
this.options
does not exist in that context as this.options
hasn't actually
been defined yet.
If I remove this line from the Object.assign()
, things work.
I'm not sure of the original intent of the line, so I'm weary to just remove it
in a pull request no questions asked.
@mattlewis92: I'll submit a pull request to remove it, but please let me know
the original intent here and I can update the PR if necessary.
Thanks!
from htmlhint-loader.
I think this line is used to get user defaults from webpack.config:
const path = require('path');
module.exports = {
entry: "./app/entry",
htmlhint: {
user config
}
}
the loader migration guide states explicitly that this feature where deprecated in webpack 3.0.0
https://medium.com/webpack/webpack-4-migration-guide-for-plugins-loaders-20a79b927202
Guideline: Loaders should receive all options via this.query. They should not use other ways to receive options, i. e. no property in webpack options, no environment variable.
- maybe you should check if this.options is set in webpack 2-3 and log a dreprecation warning
- if options is not available ignore it
from htmlhint-loader.
@mattlewis92 Thanks!
from htmlhint-loader.
Related Issues (14)
- How to get it working? HOT 6
- Error when report is generated HOT 1
- got error in a vue project. HOT 3
- simpler custom rules import HOT 5
- Angular inline templates
- Better tests HOT 1
- Latest version stills installs htmlhint 0.9.13 which installs also minimatch 0.3.0 with vulnerabilities HOT 3
- Use `strip-json-comments` before parsing the config file.
- Incorrect config, or something else?
- Custom rules doesn't work HOT 1
- configFile option ignored HOT 1
- Reading configFile throws an error HOT 5
- Suggestion: improve handling of configFile paths HOT 1
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 htmlhint-loader.