Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
config object
✓ In webpack 1.x config: { module: { preLoaders: [{ test: /\.jsx?$/, loader: 'semistandard', exclude: /node_modules/ }] }, semistandard: { parser: 'babel-eslint' } }
✗ Using 'loader: semistandard-loader' instead of 'loader: semistandard' (webpack resolves from loader name)
This loader is designed for webpack 1.x preLoaders. For webpack 2+, use enforce: 'pre' instead of preLoaders.
webpack require
✓ var webpack = require('webpack');
✗ import webpack from 'webpack'; (ESM import works, but this loader is CJS-only)
The loader itself is CommonJS; mixing with ESM may cause issues in older webpack.
plugin configuration
✓ var config = { ... }; module.exports = config;
✗ Using ES6 export default config; (not supported by webpack 1.x config files)
Webpack 1 expects module.exports; ES6 exports break the config.
Shows how to set up semistandard-loader as a preloader in a webpack 1 configuration file.
// webpack.config.js
var webpack = require('webpack');
var config = {
entry: './index.js',
output: { filename: 'bundle.js' },
module: {
preLoaders: [
{
test: /\.jsx?$/,
loader: 'semistandard',
exclude: /(node_modules|bower_components)/
}
],
loaders: [
// your other loaders
]
},
semistandard: {
// optional: parser: 'babel-eslint'
}
};
module.exports = config;
Debug
Known issues
gotchapreLoaders syntax is webpack 1 only; does not work with webpack 2+ (use enforce: 'pre' instead).fixReplace 'preLoaders' with 'rules' and add 'enforce: 'pre'' to the rule for semistandard.
affects: >=2.0.0
deprecatedPackage has no updates since 2016; semistandard itself may have breaking changes.fixConsider migrating to eslint-loader with eslint-config-semistandard for modern webpack.
affects: *
gotchaThe 'semistandard' key in config is not webpack standard; it's specific to this loader and may conflict with other loaders using similar keys.fixPrefix custom options with loader name or use module.rules options for better isolation.
affects: *
breakingNode.js 0.10/0.12 not supported by modern semistandard dependencies; loader requires Node >= 4.fixUpgrade Node.js to LTS (>= 4) or pin semistandard to an older version.
affects: >=1.0.0 (semistandard 10+)
Errors
Common errors & fixes
Error: Cannot find module 'semistandard'
semistandard not installed or not in node_modules
fixnpm install semistandard --save-dev
WARNING in ./index.js
<text>:1:1: Expected space or tab after // in comment.
Semistandard linting errors reported as warnings by the loader
fixFix the reported linting issues or disable the loader for that file.
Module build failed: SyntaxError: Unexpected token (1:9)
Loader does not transpile code; it runs on raw source before transpilation
fixEnsure the loader is placed as a pre-loader and that your source uses standard JS syntax or configure parser (e.g., babel-eslint).
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
Using preLoaders with webpack 2+
fixMigrate to webpack 2+ configuration: use module.rules with enforce: 'pre'.
Audit
Dependencies
webpackrequiredLoader interface required by webpack 1.x
semistandardrequiredCore linting engine that provides the standard rules plus semicolons