Package Exports
- eslint-config
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
eslint-config
Configuration for JavaScript code linting.
Gulp
- must be used with
gulp-eslint@2
import eslintConfig from 'eslint-config';
import formatter from 'eslint-friendly-formatter';
gulp.task('lint', () => {
const lintConfig = eslintConfig({
isDev: true,
lintEnv: 'build'
});
return gulp.src(src)
.pipe(eslint(lintConfig))
.pipe(eslint.format(formatter));
});Webpack
import eslintConfig from 'eslint-config';
const {rules, configFile} = eslintConfig({/*options*/});
export default {
entry: //
output: //
eslint: {
rules,
configFile,
formatter,
emitError: false,
emitWarning: false,
failOnWarning: !isDev,
failOnError: !isDev
}
}API
eslint(options)
options.isDev
Type: Boolean
Allows debugger and console as well as being lighter on other rules
options.basic
Type: Boolean
Only applies a small subset of rules
options.lintEnv
Type: String 'build', 'web', 'test'
Changes rules per env
options.react
Type: Boolean
Add rules for React/JSX
options.generate
Type: Boolean
Generate a .eslintrc in your project root