1.0.3 • Published 4 years ago

@armirage/eslint-config-armirage v1.0.3

Weekly downloads
1
License
BSD-3-Clause
Repository
github
Last release
4 years ago

:earth_americas: :speech_balloon: English\ Table of Contents

 

@armirage/eslint-config-armirage    

GitHub tag (latest by date) GitHub issues Github code size GitHub license armirage-style

A consistent style makes code easier to read, debug, and helps catch errors. It takes a team of 100 programmers to come together and write the next big application, yet it should look as if one person coded it. With the aid of linters, code can be programmatically checked for adherence to a convention. Making everyone's work easy to mesh together into one cohesive source of truth.

 

Table of Contents

About

Shareable configs 2 alter or extend the base rules of ESLint.3 Making it easy to distribute a styling convention among developers. The Armirage JavaScript Style Guide has more details on the linting rules we apply and why.

Install

Open open a terminal in, or change directory to, your working directory. This should be the project folder with NPM's package.json in it.

To install ESLint and Armirage sharable config, run the following commands in the terminal:

npm install eslint @armirage/eslint-config-armirage --save-dev
  • :pencil: NOTE: The sharable config is a scoped npm package and will need to be referenced that way.

This will save both as developer dependencies. Linters are development tools and unnecessary in production builds.

While in the terminal, create the configuration file .eslintrc.json

touch .eslintrc.json
  • :pencil: NOTE: The .eslintrc.json begins with a period. This is a hidden file on many systems. To see it, enable 'show hidden files' for your OS.

To complete installation See Usage.

Usage

Once the eslint-config-armirage package is installed, you can activate the rules in the ESLint configuration file.

// .eslintrc.json

{
  "extends": "@armirage/eslint-config-armirage",
  "rules": {}
}

There are several rules in the eslint:recommended ruleset that Armirage does set. Rules we feel are better handled on a case for case basis. You might want to enforce these rules in your project for a more complete implementation.

// .eslintrc.json

{
  "extends": [
    "eslint:recommended",
    "@armirage/eslint-config-armirage"
  ],
  "rules": {}
}

You can mix in other ESLint sharable configs, and extend them as well. The last ruleset in the array will have precedence.

Options

You can also override individual rules. This can be helpful to apply rules per project. For instance I often use the following:

// .eslintrc.json

{
  "extends": [
    "eslint:recommended",
    "@armirage/eslint-config-armirage"
  ],
  "rules": {
    "prefer-destructuring": ["warn", {"object": true, "array": true}]
  }
}

This gives me the added coverage of the eslint:recommended, the Armirage conventions, and I get warnings when objects or arrays could be de-structured. Something that may be project, intent, maintainability dependent.

How to Contribute

We need more modular rulesets. The base eslint ruleset is ECMAScript 2020. It should be easy to add other modular configs to the package to account for more environments.

Review the Contributing Guidelines for ways to make this repository better.

Open Source Software (OSS) is only as strong as our Community.

Acknowledgements

ESLint for their exhaustive efforts to keep pace with the ECMAScript yearly cycle.

Contact

Armirage Github repositories and @armirage scoped NPM modules are maintained by Armirage, A Technology Solutions company, feel free to contact us!

Footnotes

1: Untitled [child brushing horse] by Chris Bair, licensed under Unsplash :arrow_heading_up:

2: Shareable Configs https://eslint.org/docs/developer-guide/shareable-configs accessed 29 September 2020(#anchor-2)

3: ESLint - Pluggable JavaScript linter https://eslint.org/ accessed 29 September 2020(#anchor-2)

 

 

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago