@teleforge/eslint-config

0.12.1 • Public • Published

Teleforge eslint config

Install

We use peer dependencies to allow flexibility, this however does mean you need to manually some extra dev dependencies

Local install

npm install --save-dev eslint @teleforge/eslint-config

Configuration

package.json

{
  "scripts": {
    "lint:find": "eslint --ext .es --ext .js src/",
    "lint:fix": "eslint --fix --ext .es --ext .js src/"
  }
}

.eslintrc.json

{
  "extends": [
    "@teleforge/eslint-config"
  ]
}

Project Layout

By default the import/resolver will look in node_modules and src, to add more locations modify the import/resolver

{
  "settings": {
    "import/resolver": {
      "node": {
        "extensions": [".js", ".es", ".es6", ".json"],
        "moduleDirectory": [
          "node_modules",
          "src"
        ]
      }
    }
  }
}
Example CLI project
├── .eslintrc.json <-- extends @teleforge/eslint-config/cli
├── src
│ └── source.js
└─┬ tests
  ├── .eslintrc.json <-- extends @teleforge/eslint-config/test, optionally root=true
  └── test.js

Usage

We provide 5 options for consumption:

  • @teleforge/eslint-config:
    • base configuration for es6 node and all other configs
    • all node settings
    • no browser settings
    • no testing settings
  • @teleforge/eslint-config/browser
    • many browser specific settings (globals, jquery, etc)
    • no node settings
    • no testing settings
  • @teleforge/eslint-config/cli:
    • leniency's to make CLI applications easier
    • all node settings
    • no browser settings
    • no testing settings
  • @teleforge/eslint-config/library
    • leniency's to make libraries easier
    • all node settings
    • no browser settings
    • no testing settings
  • @teleforge/eslint-config/test
    • mocha testing settings
    • all node settings
    • no browser settings

In all of the configs we explicitly disable all the env configs used in other configs.

TODO

There's a gaping hole in how eslint handling configs with plugins, in that it doesn't. This needs to be rewritten as a plugin. Sources:

Package Sidebar

Install

npm i @teleforge/eslint-config

Weekly Downloads

7

Version

0.12.1

License

MIT

Unpacked Size

15.6 kB

Total Files

10

Last publish

Collaborators

  • enigmalicenses