|
| 1 | +- Start Date: 2018-08-13 |
| 2 | +- RFC PR: (leave this empty) |
| 3 | + |
| 4 | +# Summary |
| 5 | + |
| 6 | +Remove https://github.com/ember-cli/ember-cli-eslint from projects generated by |
| 7 | +`ember-cli`. |
| 8 | + |
| 9 | +[ember-cli-eslint](https://github.com/ember-cli/ember-cli-eslint) is an addon |
| 10 | +designed to show lint errors during test runs. Tooling around `eslint` has |
| 11 | +improved enough where this feature may no longer be necessary. |
| 12 | + |
| 13 | +To be clear, the proposal is _not_ to remove linting in tests. It is to follow |
| 14 | +the rest of JavaScript community and follow the standard tooling process. |
| 15 | + |
| 16 | +There are multiple ways to run `eslint`: |
| 17 | + |
| 18 | +1. Integration with editors |
| 19 | +2. Utilize precommit hooks with `eslint` |
| 20 | +3. Support a standard way to run `eslint` (such as `yarn lint:js`) |
| 21 | + |
| 22 | +We can also discuss configuring `testem` to automatically run `eslint` as part |
| 23 | +of `yarn test` |
| 24 | + |
| 25 | +# Motivation |
| 26 | + |
| 27 | +1. Improve our build speed |
| 28 | +2. Simplicity. `eslint` is common among JS stack, and integrations with editors |
| 29 | + / precommit-hooks are ubiquitous. Removing this layer of abstraction will |
| 30 | + simplify how `eslint` is used throughout `ember-cli`. Most editors have |
| 31 | + plugins available for `eslint`, and as long as the `.eslint.rc` is not |
| 32 | + removed, we should still see the benefits of `eslint` in our Ember projects. |
| 33 | +3. Hacks required to support features such as [PR #122 |
| 34 | + broccoli-lint-eslint](https://github.com/ember-cli/broccoli-lint-eslint/pull/122#discussion-diff-153937455R28) |
| 35 | + |
| 36 | +# Detailed design |
| 37 | + |
| 38 | +1. Change blueprint to pull in `eslint` as opposed to `ember-cli-eslint` under |
| 39 | + `devDependencies`. |
| 40 | +2. Provide documentation on `eslint` and editor integration as well as precommit hooks |
| 41 | + |
| 42 | +Redefine `npm test` or `yarn test` (depending on whether the `--yarn` option was |
| 43 | +used to create project) to |
| 44 | + |
| 45 | +``` |
| 46 | +ember test && npm run lint:js && npm run lint:hbs |
| 47 | +``` |
| 48 | + |
| 49 | +and |
| 50 | + |
| 51 | +``` |
| 52 | +ember test && yarn lint:js && yarn lint:hbs |
| 53 | +``` |
| 54 | + |
| 55 | + |
| 56 | +# How We Teach This |
| 57 | + |
| 58 | +Providing documentation regarding how to run linting should suffice as well as |
| 59 | +documentation to editor integration. |
| 60 | + |
| 61 | +Deleting abstractions and going towards a explicit path, `eslint` within the |
| 62 | +`ember-cli` ecosystem becomes _easier_ to teach. |
| 63 | + |
| 64 | +# Drawbacks |
| 65 | + |
| 66 | +1. No console warnings during builds |
| 67 | +2. lint failures are no longer included in browser tests |
| 68 | + |
| 69 | +# Alternatives |
| 70 | + |
| 71 | +1. Leave `ember-cli-eslint` alone |
| 72 | + |
| 73 | +# Unresolved questions |
| 74 | + |
| 75 | +N/A |
0 commit comments