Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove guard-for-in #1

Merged
merged 4 commits into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 0.3.1

### students

- Remove `guard-for-in`

## 0.3.0

### maintainers
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Exercism

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
58 changes: 58 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# @exercism/eslint-config-javascript

This is the shared [`eslint`][web-eslint] configuration used by the [JavaScript track][git-javascript] (for students) and the files contributors and maintainers touch. [Shareable configs][web-shareable-configs] are designed to work with the `extends` feature of `.eslintrc` files. This means you can use the same configuration you're used to on [Exercism][web-exercism] in your on projects!

## Usage

To use the configuration for students, open your [eslint configuration][web-eslint-configuration] file, and add the following value to `extends`. For example, for JSON based configuration files:

```json
{
"extends": "@exercism/eslint-config-javascript"
}
```

To use the configuration used by contributors and maintainers, add the following to `extends`:

```json
{
"extends": "@exercism/eslint-config-javascript/maintainers"
}
```

## Students configuration

Find the student configuration [here](index.js). It's goal is to help detect and prevent common problems, without making _any_ decisions about code-style.

The rules are based on:

- [`eslint:recommended`][web-eslint-recommended]
- [`plugin:import`][git-eslint-plugin-import]
- A few extra rules that catch common issues but are not enabled via the recommended plugin. See [this PR][git-javascript-pr-1094] for a bit of discussion and rationale.

Because the [Exercism JavaScript track][git-javascript] is primarily focussing on running the exercises on Node, only `node` and `es2021` are turned on as environment, but when extending this configuration, you can add more (or turn those off).

## Maintainers configuration

Similar to the students configuration, and found [here](maintainers.js), it also includes the [`prettier` plugin][git-eslint-plugin-prettier] because we use [`prettier`][web-prettier] to achieve consistent code formatting. This plugin turns _off_ rules that conflict with formatting.

Additionally, it doesn't have warnings but errors for most/all of the rules in the students configuration.

## Tooling configuration

Because the tooling (such as the [JavaScript Analyzer][git-javascript-analyzer], [Representer][git-javascript-representer], and [Test Runner][git-javascript-test-runner]) are written in TypeScript, they don't use the same configuration files. If you're looking for those, or to build your own tools in TypeScript, go to [@exercism/eslint-config-tooling][git-eslint-config-tooling].

[git-eslint-config-tooling]: https://github.com/exercism/eslint-config-tooling
[git-eslint-plugin-import]: https://github.com/benmosher/eslint-plugin-import
[git-eslint-plugin-prettier]: https://github.com/prettier/eslint-config-prettier
[git-javascript]: https://github.com/exercism/javascript
[git-javascript-analyzer]: https://github.com/exercism/javascript-analyzer
[git-javascript-pr-1094]: https://github.com/exercism/javascript/pull/1094
[git-javascript-representer]: https://github.com/exercism/javascript-representer
[git-javascript-test-runner]: https://github.com/exercism/javascript-test-runner
[web-eslint]: https://eslint.org
[web-eslint-configuration]: https://eslint.org/docs/user-guide/configuring/
[web-eslint-recommended]: https://eslint.org/docs/rules/
[web-exercism]: https://exercism.io
[web-prettier]: https://prettier.io
[web-shareable-configs]: https://eslint.org/docs/developer-guide/shareable-configs
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module.exports = {
'array-callback-return': ['warn', { checkForEach: false }],
'default-param-last': 'error',
eqeqeq: ['warn', 'smart'],
'guard-for-in': 'warn',
'linebreak-style': 'off',
'no-eval': ['error', { allowIndirect: true }],
'no-extend-native': 'warn',
Expand Down
1 change: 0 additions & 1 deletion maintainers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ module.exports = {
'array-callback-return': ['error', { checkForEach: true }],
'default-param-last': 'error',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'linebreak-style': 'off',
'no-eval': ['error', { allowIndirect: true }],
'no-extend-native': 'error',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@exercism/eslint-config-javascript",
"version": "0.3.0",
"version": "0.3.1",
"description": "ESLint configuration for the JavaScript track on Exercism",
"main": "index.js",
"scripts": {
Expand Down