-
-
Notifications
You must be signed in to change notification settings - Fork 608
camelCase: 'only' and camelCase: 'dashesOnly' dont work #457
New issue
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
Comments
Can you link to the lines in the source code please ? :) |
cc @joscha |
@nikitaMe1nikov I have 0.27.1 running here and it seems to work - can you please let us know your css-loader config and the version you are using? |
My mistake, its worked. For some reason, several modules have not been upgraded |
we should probably add a note to the docs on what version from these options are supported - or maybe we could add the same config options validation that webpack 2 has - @michael-ciniawsky what do you think? |
@joscha Options Validation would be optimal, but a note isn't a bad idea also 😛 . For npm i -S ajv // used by webpack v2 lib/validate.js 'use strict'
const Ajv = require('ajv')
class ValidationError extends Error {
constructor (loader, err) {
super(err)
this.err = err
this.message = `${loader} Validation Error\nInvalid options found:\n\n`
err.forEach((msg) => {
this.message += `options${msg.dataPath} ${msg.message}\n`
})
this.hideStack = true
}
}
module.exports = function validateOptions (loader, schema, options) {
const ajv = new Ajv({ allErrors: true, errorDataPath: 'property' })
if (typeof schema === 'string') schema = require(schema)
if (!ajv.validate(schema, options)) {
throw new ValidationError(loader, ajv.errors)
}
} lib/schema.json {
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"config": {
"type": "object",
"description": "PostCSS Config",
"properties": {
"path": {
"type": "string",
"description": "PostCSS Config Path"
},
"ctx": {
"type": "object",
"description": "PostCSS Config Context"
}
},
"additionalProperties": false
},
"parser": {
"type": "string",
"description": "PostCSS Parser"
},
"syntax": {
"type": "string",
"description": "PostCSS Syntax"
},
"stringifier": {
"type": "string",
"description": "PostCSS Stringifier"
},
"plugins": {
"description": "PostCSS Plugins"
},
"sourceMap": {
"type": "string",
"description": "Sourcemaps"
},
"exec": {
"type": "boolean"
},
"rewrite": {
"type": "boolean"
}
},
"additionalProperties": false
} index.js ...
const validateOptions = require('./lib/validate')
const LoaderError = require('./lib/error')
module.exports = function (css, map) {
const loader = this
const cb = loader.async()
const file = loader.resourcePath
const options = loaderUtils.getOptions(loader) || {}
validateOptions('PostCSS Loader', './schema', options)
...
|
As I have understood from a code, these two options aren't realized.
The text was updated successfully, but these errors were encountered: