Skip to content

Commit

Permalink
UPDATE readme, contribution and github template files
Browse files Browse the repository at this point in the history
  • Loading branch information
moelders committed Jul 31, 2018
1 parent de0a421 commit dde7a19
Show file tree
Hide file tree
Showing 8 changed files with 104 additions and 57 deletions.
72 changes: 36 additions & 36 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# Updating project specific configurations

This situation can happen when a rule is affecting some project due to specific requirements or behaviors.

To add, update or disable a rule:

1. Test the new configuration:
- What becomes affected?
- Does it warn about new errors?
- Does it change the general coding style?
1. Come to an agreement with your team.
- Evaluate alternatives.
- Make sure everyone is aligned with the change.
- If any, consult the change with a reviewer.
1. Update your project's configuration file accordingly.

# Updating global configurations

The flow for updating this repository is the following:

1. Fork this repository.
1. Create a `feature` or `bugfix` branch based on an existing Jira ticket.
1. Commit, push and create a pull request with your changes.
- You **must** update the global `package.json` version.
- Patch version `+1` if `bugfix`.
- Minor version `+1`, reset patch to `0` if `feature`.
- In case of doubt, ask the maintainers.
- You **must** update the changelog accordingly with the changes.
- Use new version.
- Keep format unified with existing log.
- `# x.y.z` for releases and minor versions, `## x.y.z` for patch versions.
- You **must** update examples accordingly to reflect the changes.
- Your build **must** pass.
1. Wait until someone reviews and approves or requests changes.

> `1`/`"warn"` level is disallowed in any of our global configurations, only `0`/`"off"` or `2`/`"on"` are allowed.
# Contributing

Read the general [adidas contributing guidelines](https://github.com/adidas/adidas-contribution-guidelines/wiki/Contributing).

### Updating a package

Most of the rules have three states: enabled, disabled and warning.

- Disabled: `0`/`"off"`.
- Enabled: `2`/`"on"`.
- Warning: `1`/`"warn"`
- The warning level is disallowed in any of the configurations.

Each configuration is inside the `packages` folder, and it is independent, so, it requires:

- Update the version of its `package.json`.
- Check if the packages with dependencies of the modified one have to update its version too.
- Add the changelog information in its `CHANGELOG.md` on top of the file.

The repository version and changelog should not be updated.

### Checking coding guidelines

Eslint is used to check the JavaScript coding style of the different configurations:

> npm run lint
### Releasing a package

Once the version and changelog of either a package, or several packages, the publication script has to be executed.

> npm run lerna:publish
There is a dry-run mode to test that everything works before executing the NPM publication:

> DRY_RUN=true npm run lerna:publish
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/ADD_UPDATE_RULE.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
---
name: Add/Update rule
about: Adding a rule or changing configuration for existing rules
name: Add/Update rules
about: Adding rules or changing configuration for existing rules
---

**Node/npm version(s)**:

**Package(s) version(s)**:

**Rule name**:
**Rule name(s)**:

**Requirements (package specific version, plugins, ...)**:
**Requirements (package specific version, plugins, etc.)**:

**What does it provide?**:

Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/DISABLE_RULE.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
name: Disable rule
about: Request disabling or removing a rule
name: Disable rules
about: Request disabling or removing rules
---

**Node/npm version(s)**:

**Package(s) version(s)**:

**Rule name**:
**Rule name(s)**:

**Reasoning to disable the rule**:
**Reasoning to disable the rule(s)**:

**Example**:
4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<!--
Give us an overview of your changes
-->
<!-- Give us an overview of your changes -->
2 changes: 1 addition & 1 deletion .meta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
imageUrl: https://github.com/adidas/js-linter-configs/blob/master/logo.png
imageUrl: https://raw.githubusercontent.com/adidas/js-linter-configs/master/logo.png
keywords:
- eslint
- tslint
Expand Down
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
# 1.0.0

- Initial release of `js-linter-configs`.
<!-- The changelog of this project is disabled, please, check and update the changelog of each package accordingly -->
3 changes: 3 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of conduct

Read the general [adidas code of conduct](https://github.com/adidas/adidas-contribution-guidelines/wiki/Contributing#code-of-conduct).
60 changes: 54 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,70 @@

adidas configurations for the different linting tools for JavaScript, TypeScript, CSS/LESS/SASS, etc.

The purpose of these configurations is to define a set of strict rules to validate the coding standards. The adidas standards are based on the most used by the community with some slight changes.

This repository provides configurations for the different JavaScript language versions, from ES5 (which acts as base configuration) to ES9.

These configurations can be used in any project written in JavaScript and TypeScript, it does not matter if it is frontend or backend code.

## Use cases

The main use case of this repository and their linter configuration is to check the code quality of the source code of the project.

The linter tools used to check this configurations display errors if a rule is violated but they never modifies the source code.

adidas is not responsible for the usage of this software for different purposes that the ones described in the use cases.

## Requirements and dependencies

This repository contains different linter configuration which are independent packages. It means that all these packages are published independently but managed all together. [Lerna](https://lernajs.io/) is the tool used to manage them.

[NodeJS/NPM](https://nodejs.org/) are required to work with the repository.

## Installation and running

- In development mode (dependencies of the main package):
> npm install
- Run time (installation of the required configurations):
> npm install CONFIGURATION_PACKAGE_NAME[@VERSION]
The required dependencies of each package are listed in its own `package.json` file as dependency or peer dependency.

Specific instructions about how to run the linter configurations are placed in the `README.md` file of each package.

## FAQ

### Releasing a package
### Maintainers

Check the contributor list and you will be welcome if you want to contribute.

To release a new version of the packages, update `version` field in `package.json`.
### Contributing

This value will be used to update `lerna.json` and publish each of the modules under `packages/` directory.
Check out the [CONTRIBUTING.md](CONTRIBUTING.md) to know how to contribute to this project.

### ESLint Peer Dependencies

By default, `eslint` resolves dependencies in the first level of `node_modules` and won't go any deeper.

As a fix for this, we improved the resolution by adding `require.resolve` to each `extends` entry in our configurations
so it will look for a nested module instead.
As a fix for this, we improved the resolution by adding `require.resolve` to each `extends` entry in our configurations so it will look for a nested module instead.

Be aware that currently there is no way to resolve either relative or absolute paths for the `plugins` section of eslint:
Be aware that currently there is no way to resolve either relative or absolute paths for the `plugins` section of Eslint:

- https://github.com/eslint/eslint/issues/3458
- https://github.com/eslint/eslint/issues/6237

## License and Software Information

© adidas AG

adidas AG publishes this software and accompanied documentation (if any) subject to the terms of the MIT license with the aim of helping the community with our tools and libraries which we think can be also useful for other people. You will find a copy of the MIT license in the root folder of this package. All rights not explicitly granted to you under the MIT license remain the sole and exclusive property of adidas AG.

NOTICE: The software has been designed solely for the purpose of analyzing the code quality by checking the coding guidelines. The software is NOT designed, tested or verified for productive use whatsoever, nor or for any use related to high risk environments, such as health care, highly or fully autonomous driving, power plants, or other critical infrastructures or services.

If you want to contact adidas regarding the software, you can mail us at _[email protected]_.

For further information open the [adidas terms and conditions](https://github.com/adidas/adidas-contribution-guidelines/wiki/Terms-and-conditions) page.

### License

[MIT](LICENSE)

0 comments on commit dde7a19

Please sign in to comment.