Skip to content

ESLint + config bundle based on Airbnb's config, with TypeScript and Prettier support

License

Notifications You must be signed in to change notification settings

shm-open/eslint-config-bundle

Repository files navigation

ESLint Config Bundle Node.js CI

[Chinese version 中文版]

ESLint + config bundle based on Airbnb's config, with TypeScript and Prettier support

Why config bundle

It includes both ESLint + plugins and config files inside this bundle all together. We known that common practice is only ship the config files (like eslint-config-airbnb), but we found config and plugins are always tied to some ESLint version and the compatiliby between ESLint, plugins and config is hard to maintain in client projects, therefore we create this bundle to help - includes ESLint + plugins + config, all shipped with fixed version.

Install

EditorConfig is recommended to use together with this bundle, it helps with basic editor config that can work with Prettier such as the indent_size (which we didn't put into the Prettier config to leave it to EditorConfig)

Install the bundle package as a dev dependency

$ npm install @shm-open/eslint-config-bundle --save-dev

Create .eslintrc.js, .prettierrc.js under project root

Note: you may need change to .cjs ext if current project type is module

  • .prettierrc.js
module.exports = require('@shm-open/eslint-config-bundle/prettier');
  • .eslintrc.js - basic ts/js projects
module.exports = {
    extends: ['@shm-open/eslint-config-bundle']
}
  • .eslintrc.js - React projects
module.exports = {
    extends: ['@shm-open/eslint-config-bundle/react']
}
  • .eslintrc.js - React Native projects
module.exports = {
    extends: ['@shm-open/eslint-config-bundle/react-native']
}
  • .eslintrc.js - Taro projects
module.exports = {
    extends: ['@shm-open/eslint-config-bundle/taro']
}

About

ESLint + config bundle based on Airbnb's config, with TypeScript and Prettier support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •