@holadev/eslint-config
v1.0.5
Published
HolaDev eslint config
Downloads
4
Readme
HolaDev Code Style Guidelines
General Information
This repository is meant to serve as the primary source of truth for the HolaDev Code Style Guidelines. It is also published as an npm package here:
https://www.npmjs.com/package/@holadev/eslint-config
Any decisions or updates to this living document should be submitted via PR and discussed.
Default ESLint
This is located in the index.js file. This config extend Ramda, React, Jest, Jasmine, and Node rules.
Using this package as npm dependency
This has been deployed as an npm module: @holadev/eslint-config
You may include it by placing a .eslint.json config in your project with these contents:
Default (less strict):
{
"extends": "@holadev"
}
Install it as a dev dependency in your project:
yarn add @holadev/eslint-config --dev-only
You may see the following documentation on sharable configs:
https://eslint.org/docs/developer-guide/shareable-configs
Running ESLint from the terminal
First, add a lint script to your package.json:
"scripts": {
"lint": "eslint ."
Then run the line command: yarn lint
. This command tells you what ESLint rules are failing, if any. You can automatically fix some breaking rules by running this from the command line: npx eslint --fix
. Then re-run yarn lint to see if the issues were fixed. Some issues will have to be manually fixed in the code.
Submitting proposed changes to this ESLint configuration.
Issue a PR explaining why you want to make the change and any potential impacts in existing dependent projects.
Submit PR and add at least 2 reviewers not only in your project but in other areas (backend, lambas, team leads, etc...)
Formatting Rules General Overview
IDE formatting configurations: Aligning on colons and equals
Jetbrains does support aligning by equals, just not using ESLint. This rule is supported by Jetbrains IDEs (IDEA, Webstorm, etc.) using an XML formatter file. This file is in the IDE/Jetbrains folder. This file can be imported into your Jetbrains IDE.
This file contains other rules as well, which have already been added to the ESLint configurations. The XML file should be kept up to date to NOT conflict with the latest ESLint configuration files.
Visual Studio Code
If you're using Visual Studio Code, you should disable Prettier if you've installed it because Prettier's formatting conflicts with the align on equals sign formatting rule we are following. ESLint does not have an align on equals rule, but you can use the https://marketplace.visualstudio.com/items?itemName=wwm.better-align to align each block manually on the equals signs.
Set up the keybindings.json as described in the instruction to make the formatting call quicker.
Add the settings configuration file in the IDE/VisualStudioCode directory to your editor settings file so that the spacing is correct.
This plugin does not apply all of the ESLint formatting rules that Pretter does when using Prettier-ESLint integration. Instead, in addition to aligning on equals from the IDE, run this from the command line at the root of your directory to automatically fix some ESLint issues:
npx eslint --fix .
Some ESLint issues may have to be fixed manually in the code.
Changelog
1.0.0
- Initial commit
1.0.1
- Fix typo
1.0.2
- Replace babel-eslint for @babel/eslint-parser
1.0.3
- Added babel options
1.0.4
- Fix parserOptions
1.0.5
- Update dependencies