@imaginary-cloud/eslint-config-react
ESLint React configuration for JS projects based on airbnb and Prettier configs
Last updated a month ago by imaginary-cloud .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @imaginary-cloud/eslint-config-react 
SYNC missed versions from official npm registry.

eslint-config-react

ESLint configuration for React Project. Easy to install and configure, it follows the best code standards from airbnb and uses prettier configuration on code format. Integrated with our prettier configuration configuration

Purpose

This configuration uses airbnb and Prettier configuration plus some extra rules that we find handy for React applications

For more information you can check ESLint and Prettier documentations as well the airbnb and prettier configurations for more information

This package integrates the Prettier rules with ESLint using our configuration. You can check it at @imaginary-cloud/prettier-configuration

How to install

You need ESLint and Prettier installed as development dependencies on your project. You can install them by using npm:

npm install --save-dev eslint prettier

Install all peer dependencies of our configuration, these can be listed by the command:

npm info "@imaginary-cloud/eslint-config-react@latest" peerDependencies

If running npm > v5 you install them by:

npx install-peerdeps --dev @imaginary-cloud/eslint-config-react

If npm < v5, Linux/OSX users can run:

(
  export PKG=@imaginary-cloud/eslint-config-react;
  npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)

How to use

To configure ESLinter and Prettier you can add to your package.json

"eslintConfig": {
  "extends": "@imaginary-cloud/react",
},
"prettier": "@imaginary-cloud/prettier-config"

Or create a .eslintrc and .prettierrc files and add extends: "@imaginary-cloud/react" and "@imaginary-cloud/prettier-config" respectivally. As an example:

<!-- .eslintrc -->
{
  "extends": "@imaginary-cloud/react"
  <!-- you can edit this configuration as usual, check ESLint docs -->
}

<!-- .prettierrc -->
"@imaginary-cloud/prettier-config"

To use ESLint and Prettier you can add this scripts to your package.json file

"lint": "eslint ./ --ignore-path .gitignore",
"lint:fix": "npm run lint -- --fix",
"format": "prettier --write \"{,!(node_modules)/**/}*.js\""

Contributing

How to contribute to this open source library

License

Copyright © 2010-2020 Imaginary Cloud. This library is licensed under the MIT license.

About Imaginary Cloud

Imaginary Cloud

At Imaginary Cloud, we build world-class web & mobile apps. Our Front-end developers and UI/UX designers are ready to create or scale your digital product. Take a look at our website and get in touch! We'll take it from there.

Current Tags

  • 1.0.0                                ...           latest (a month ago)

1 Versions

  • 1.0.0                                ...           a month ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |