npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

eslint-config-teppeis

9.5.1 • Public • Published

eslint-config-teppeis

ESLint config set for me!

NPM version Node.js Version Support Build Status Dependency Status License

Priority

  1. Avoid "Possible Errors"
  2. Keep "Best Practices" if common
  3. Use "Modern Style (ES2015+)" if available
  4. Format "Stylistic Issues" if fixable or use Prettier

This rules is based on eslint:recommended. Only additional or orverwritten rules are specified.

Usage

npm i -D eslint-config-teppeis and specify in your .eslintrc.json:

{
  "extends": "teppeis"
}

Default config equals to teppeis/es2018.

Choose base ECMAScript version

{
  "extends": "teppeis/es2015"
}
  • teppeis/es5
  • teppeis/es2015
  • teppeis/es2016
  • teppeis/es2017
  • teppeis/es2018: equals to teppeis
  • teppeis/es2019

For Closure Compiler coding style

Extends teppeis/+closure after base config.

{
  "extends": ["teppeis/es2015", "teppeis/+closure"]
}

For Node.js

They include eslint-plugin-node.

With specific version

Chose config for specific Node version

{
  "extends": ["teppeis/node-v10"]
}
  • teppeis/node-v6 (v6.6+ for util.inspect.custom)
  • teppeis/node-v8 (v8.10+ for SharedArrayBuffer and Atomics)
  • teppeis/node-v10 (v10.12+ for crypto.generateKeyPair)
  • teppeis/node-v11 (v11.0+ for many globals)

With Babel or other transpilers

Extends teppeis/+node after base config.

{
  "extends": ["teppeis/es2018", "teppeis/+node"]
}

In teppeis/+node, node/no-unsupported-features/es-syntax is disabled. Available ES features depend on the base config.

node/no-unsupported-features/es-builtins and node/no-unsupported-features/node-builtins are enabled. It is assumed that polyfill is not used.

Customize

Use Prettier

Install prettier with --save-exact (recommended).

$ npm i -D -E prettier
# or
$ yarn add -D -E prettier

Override dupulicated or conflicted rules with teppeis/+prettier.

{
  "extends": ["teppeis/es2018", "teppeis/+prettier"]
}

Use Mocha for test

This enables mocha globals like describe or it in **/test/*.js.

{
  "extends": ["teppeis/es2018", "teppeis/+mocha"]
}

For ES Modules

This overrides parserOptions.sourceType.

{
  "extends": ["teppeis/es2018", "teppeis/+module"]
}

For browsers

This adds browser to env.

{
  "extends": ["teppeis/es2018", "teppeis/+browser"]
}

TypeScript (experimental)

{
  "extends": [
    "teppeis/es2019",
    "teppeis/+node",
    "teppeis/+typescript",
    "teppeis/+prettier",
    "teppeis/+mocha"
  ]
}

It enables ES Modules.

License

Licensed under the MIT license. Copyright (c) 2018, Teppei Sato

install

npm i eslint-config-teppeis

Downloadsweekly downloads

422

version

9.5.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability