@m-kutnik/eslint-config
my private ESLint config
Last updated 2 months ago by gimpovski .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @m-kutnik/eslint-config 
SYNC missed versions from official npm registry.

eslint-config

My own ESLint config.

Instalation and Usage

You can install ESLint using npm or yarn:

$ npm i eslint -D

Install my config:

$ npm i @m-kutnik/eslint-config -D

JS Configuration:

module.exports = {
  env: {
    browser: true,
    es6: true,
    node: true
  },
  parser: 'babel-eslint',
  extends: [
    '@m-kutnik/eslint-config'
  ]
}

Vue configuration

Firstly install webpack resolver for ESLint:

$ npm i -D eslint-import-resolver-webpack
module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    '@m-kutnik/eslint-config',
    'plugin:vue/recommended',
    'eslint:recommended',
    '@vue/prettier',
  ],
  parserOptions: {
    parser: 'babel-eslint',
  },
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  },
  settings: {
    'import/resolver': {
      webpack: {
        config: './node_modules/@vue/cli-service/webpack.config.js',
      },
    },
  },
}

Excluding files/directories

To exclude files/directories create valid .eslintignore file. Docs are available here

Example:

/dist/**
/node_modules/**

Using ESLint

The Best Way™

Install ESLint locally and create a script in package.json


{
  ...

  "scripts": {
    "lint": "eslint ./src",
    "fix": "eslint --fix ./src"
  },  

  ...  
},

The OK way™

If ESLint is installed locally:

$ npx eslint ./src

If ESLint is installed globally:

$ eslint ./src

Current Tags

  • 1.2.0                                ...           latest (2 months ago)

5 Versions

  • 1.2.0                                ...           2 months ago
  • 1.1.0                                ...           2 months ago
  • 1.0.4                                ...           3 months ago
  • 1.0.3                                ...           3 months ago
  • 1.0.2                                ...           3 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 11
Dependencies (6)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |