diff --git a/CHANGELOG.md b/CHANGELOG.md index 855f646..e68b848 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.3.1 + +### students + +- Remove `guard-for-in` + ## 0.3.0 ### maintainers diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a7527f9 --- /dev/null +++ b/LICENSE @@ -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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..10be621 --- /dev/null +++ b/README.md @@ -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 diff --git a/index.js b/index.js index a521eb3..e8f02cf 100644 --- a/index.js +++ b/index.js @@ -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', diff --git a/maintainers.js b/maintainers.js index 2eeba31..4caabfd 100644 --- a/maintainers.js +++ b/maintainers.js @@ -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', diff --git a/package.json b/package.json index ab7ec02..1362e2c 100644 --- a/package.json +++ b/package.json @@ -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": {