Skip to content

clounie/eslint-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

eslint-rules

ESLint settings
git clone https://github.com/clounie/eslint-rules.git

Config file

To change the location of the config file default config locations, add a -c <config_file_path> option to the eslint call in package.json

.eslint-local config

To add a local config for eslint, add it using the -c <config_file_path> flag.


Examples:

Each of these belongs in the scripts object in a package.json file.

ESLint, no config:

{
  // ...
  "scripts": {
    "lint": "eslint ."
  }
  // ...
}

Specify Config:

{
  // ...
  "scripts": {
    "lint": "eslint -c __eslint_rules/.eslintrc.js ."
  }
  // ...
}

Specifying which files/directories to lint

{
  // ...
  "scripts": {
    "lint": "eslint '**/*.js' '**/.*.js'"
  }
  // ...
}

With eslint-local: (Make sure you include the extends property in .eslint-local.json if you do this; see example)

{
  // ...
  "scripts": {
    "lint": "eslint .eslint-local.json .",
  }
  // ...
}

With eslint-local + globbing

{
  // ...
  "scripts": {
    "lint": "eslint -c .eslint-local.json '**/*.js' '**/.*.js'"
  }
  // ...
}

About

My default eslint setup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published