All Projects → robertherber → eslint-config-kingstinct-react-native

robertherber / eslint-config-kingstinct-react-native

Licence: other
Eslint configuration for React-native based on Airbnb with some great tweaks

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to eslint-config-kingstinct-react-native

Eslint Config Standard Jsx
ESLint Shareable Config for JSX support in JavaScript Standard Style
Stars: ✭ 79 (+243.48%)
Mutual labels:  eslint, linter
Eslint Watch
ESLint with simple watching capabilities
Stars: ✭ 159 (+591.3%)
Mutual labels:  eslint, linter
Eslint Plugin I18n Json
Fully extendable eslint plugin for JSON i18n translation files.
Stars: ✭ 101 (+339.13%)
Mutual labels:  eslint, linter
Eslint Closure
ESLint Plugin and Config for the Google JavaScript Style Guide
Stars: ✭ 21 (-8.7%)
Mutual labels:  eslint, linter
Sharec
📦 Store your configs in one place and share between projects without any pain
Stars: ✭ 198 (+760.87%)
Mutual labels:  eslint, configuration
Ale Sensible
Pretty, responsive and smooth defaults for a sane ALE, gets you started in 30 seconds
Stars: ✭ 30 (+30.43%)
Mutual labels:  eslint, linter
Hyperapp One
Hyperapp One is a Parcel boilerplate for quickstarting a web application with Hyperapp (V1), JSX, and Prettier.
Stars: ✭ 129 (+460.87%)
Mutual labels:  eslint, airbnb
Esprint
Fast eslint runner
Stars: ✭ 556 (+2317.39%)
Mutual labels:  eslint, linter
Grunt Eslint
Validate files with ESLint
Stars: ✭ 189 (+721.74%)
Mutual labels:  eslint, linter
Eslint Config Standard
ESLint Config for JavaScript Standard Style
Stars: ✭ 2,229 (+9591.3%)
Mutual labels:  eslint, linter
Sublimelinter Eslint
This linter plugin for SublimeLinter provides an interface to ESLint
Stars: ✭ 839 (+3547.83%)
Mutual labels:  eslint, linter
jetrockets-standard
Standard RuboCop configuration for JetRockets with cookies
Stars: ✭ 14 (-39.13%)
Mutual labels:  linter, configuration
Standard
🌟 JavaScript Style Guide, with linter & automatic code fixer
Stars: ✭ 26,433 (+114826.09%)
Mutual labels:  eslint, linter
Lint Staged
🚫💩 — Run linters on git staged files
Stars: ✭ 9,492 (+41169.57%)
Mutual labels:  eslint, linter
Xo
❤️ JavaScript/TypeScript linter (ESLint wrapper) with great defaults
Stars: ✭ 6,277 (+27191.3%)
Mutual labels:  eslint, linter
Zoe
🌀 Zero-config ESLint toolchain with sensible defaults.
Stars: ✭ 113 (+391.3%)
Mutual labels:  eslint, linter
Eslint Config Standard React
ESLint Shareable Config for React/JSX support in JavaScript Standard Style
Stars: ✭ 416 (+1708.7%)
Mutual labels:  eslint, linter
Eslint Plugin Sonarjs
SonarJS rules for ESLint
Stars: ✭ 458 (+1891.3%)
Mutual labels:  eslint, linter
Poetic
Automatically install and maintain ESLint, Prettier, EditorConfig and Airbnb rules for JavaScript, TypeScript and React.
Stars: ✭ 165 (+617.39%)
Mutual labels:  eslint, linter
Eslint Plugin Markdown
Lint JavaScript code blocks in Markdown documents
Stars: ✭ 242 (+952.17%)
Mutual labels:  eslint, linter

eslint-config-kingstinct-react-native

CI Status

Principles

  1. As many autofixable rules as possible, because enforcing standards that don't require extra developer effort is (almost) always a good idea.
  2. Don't error on non-fixable errors (that don't risk causing unforeseen errors).

If you see something that could be improved based on these principles, please submit a pull request! :)

Usage

This is the base eslint config I use for React Native. It's based on the popular Airbnb-config with a few plugin additions:

  • TypeScript
  • import
  • jest
  • json
  • lodash-fp
  • promise
  • react
  • react-native

I've also made some minor changes to the rules, so if you've got other preferences you might want to override some rules. I highly recommend you to use eslint, flowtype with plugins for your texteditor/IDE.

The two main principles are to catch errors early on and to boost productivity (so for example I've disabled react/sort-comp as it's not fixed automatically yet).

  • Enforce lodash-fp instead of lodash.
    • Why? Many lodash methods are mutable which might cause hard-to-debug side effects, especially when using redux . With lodash-fp you're safe.

    • Disable if you really want to use the mutable lodash flavour (not recommended). Add this to your .eslintrc:

      { ...,
          rules: { ...,
            'lodash-fp/use-fp': 0
          }
      }
      

Install

  1. Install the correct versions of each package, which are listed by the command:
npm info "eslint-config-kingstinct-react-native@latest" peerDependencies

Linux/OSX users can run (if you're using NPM)

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

or (if you're using yarn)

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

Which produces and runs a command like:

npm install --save-dev eslint-config-kingstinct-react-native eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.#

Windows users can either install all the peer dependencies manually, or use the install-peerdeps cli tool.

npm install -g install-peerdeps
install-peerdeps --dev eslint-config-kingstinct-react-native

The cli will produce and run a command like:

npm install --save-dev eslint-config-kingstinct-react-native eslint@^#.#.# eslint-plugin-jsx-a11y@^#.#.# eslint-plugin-import@^#.#.# eslint-plugin-react@^#.#.#
  1. Add "extends": "kingstinct-react-native" to your .eslintrc

Previous versions

Previous versions (before 4.0) used flow for type checking.

Running tests

You can run tests with npm test. It will run the lint config on the project itself.

Made by Kingstinct AB

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].