1. eslint-config
Linting Config
eslint-config
Package: eslint-config
Created by: dtothefp
Last modified: Fri, 17 Jun 2022 17:53:44 GMT
Version: 0.3.0
License: ISC
Downloads: 15,685
Repository: https://github.com/dtothefp/open-eslint-config

Install

npm install eslint-config
yarn add eslint-config

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

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin