WIP: Swap ember-cli-eslint for ESLint#8219
WIP: Swap ember-cli-eslint for ESLint#8219kellyselden wants to merge 2 commits intoember-cli:masterfrom
ember-cli-eslint for ESLint#8219Conversation
|
|
||
| * `ember test` | ||
| * `ember test --server` | ||
| * `<% if (yarn) { %>yarn test<% } else { %>npm test<% } %>` |
There was a problem hiding this comment.
We already have linting mentioned below, so it's a bit redundant to mention the command that runs linting as well. On the other hand, how are people going to learn that ember test no longer lints, and that you should be running npm test to get the old behavior?
Also, we now have a weird mix of npm-scripts wrapped commands and native ember-cli commands. We may need learning team help on resolving this confusion. cc @jenweber @NullVoxPopuli @kennethlarsen
There was a problem hiding this comment.
maybe, just concat the commands together (at least for now?)
like,
yarn lint:js && yarn test
or, we split it out into different travis jobs?
There was a problem hiding this comment.
You mean yarn lint:js && ember test?
It is already split in travis (or should be).
There was a problem hiding this comment.
You mean yarn lint:js && ember test?
idk, I prefix everything with yarn, so I know I'm using the local version
It is already split in travis (or should be).
#biwinning
There was a problem hiding this comment.
Perhaps the test output could indicate that linting is not included. For example, it could say afterwards "to run linting, use npm test." I will have to think about this some.
Beginners aside, this is a tough question because I imagine that many people just do ember test in their CI. I don't use Travis and I'm pretty sure that I just run ember test in CI.
| @@ -15,7 +15,7 @@ | |||
| "lint:hbs": "ember-template-lint .", | |||
| "lint:js": "eslint .", | |||
| "start": "ember serve", | |||
There was a problem hiding this comment.
Should we include this in the start and build commands (and test:all) as well?
There was a problem hiding this comment.
for least suprise, I think it'd make sense to add it.
But, I think just mentioning it in the release notes would be ok if we were to stop running linting before everything.
idk 🤷♂️
blueprints/app/files/package.json
Outdated
| "lint:js": "eslint .", | ||
| "start": "ember serve", | ||
| "test": "ember test" | ||
| "test": "<% if (yarn) { %>yarn lint:hbs<% } else { %>npm run lint:hbs<% } %> && ember test" |
There was a problem hiding this comment.
We could also utilize "pretest" as well. I'm not sure of the advantages of each. This is essentially equivalent:
"pretest": "npm run lint:js",
"test": "ember test"
c69c492 to
546a9cd
Compare
| "lint:js": "eslint .", | ||
| "start": "ember serve", | ||
| "test": "ember test" | ||
| "test": "<% if (yarn) { %>yarn lint:js<% } else { %>npm run lint:js<% } %> && ember test" |
There was a problem hiding this comment.
I left off npm run lint:hbs because there is currently no way that I know to take template linting out of ember test. Once that is possible, we can add it here. @rwjblue correct me if I'm wrong.
There was a problem hiding this comment.
You can remove ember-cli-template-lint and replace with ember-template-lint directly. This will keep Test'em from linting the hbs files, but you can still yarn lint:hbs with no issues.
|
cc @sangm |
| * `ember test` | ||
| * `ember test --server` | ||
| * `<% if (yarn) { %>yarn test<% } else { %>npm test<% } %>` | ||
| * `<% if (yarn) { %>yarn test --server<% } else { %>npm test -- --server<% } %>` |
ff79c38 to
89a3a7a
Compare
| * `ember test` | ||
| * `ember test --server` | ||
| * `<% if (yarn) { %>yarn test<% } else { %>npm test<% } %>` | ||
| * `<% if (yarn) { %>yarn test --server<% } else { %>npm test -- --server<% } %>` |
There was a problem hiding this comment.
@john-kurkowski just pointed out to me that yarn test --server is misleading. One might assume the linting part is watching the build too. This might be a job for something like https://www.npmjs.com/package/eslint-watch? cc @Turbo87 I know you were talking about something like this at one point.
There was a problem hiding this comment.
Right, I do like 1 SPOT to look for all errors in all files, continuously. Today, that's the launched Testem UI. It reminds me of things my editor doesn't, because I switched away from the file with errors.
Running another watch process is an option, sure.
Maybe a commit hook would cover my edge case.
There was a problem hiding this comment.
I don't think a commit hook would solve your live updating needs, that's like a "final check once you're all done", right? not a "while you work" solution.
89a3a7a to
f743166
Compare
ember-cli-eslint for ESLint
f743166 to
49309aa
Compare
49309aa to
0965514
Compare
|
From reading the RFC it looks like there was a discussion about adding the documentation for setting up
This should be a requirement of this PR as without it, it will completely change the workflow of some developers. The testem ui is basically my one-stop-shop for errors, I could add another step but it feels like going backwards rather than forwards. I don't want to have to rely on CI to tell me about linting issues and precommit hooks are a drag. |
0965514 to
ec9a18b
Compare
|
@onlymejosh I added the testem hook @rwjblue Was this what you were thinking? |
|
If there is a linting issue would this stop the rest of the tests running? If so this is still a backwards change in my eyes. It should be the same as it currently is, linting issues should appear in the list of failures. |
I'm sorry you feel this way.
Simply put, thats not going to happen. The RFC (and comment thread) specifically explain the rational, and when implementation is completed a newly generated app will not have the setup you are talking about. However, it is absolutely still a thing you can choose to opt in to (by installing ember-cli-eslint in your particular application). |
|
Ah ok so the solution is to use ember-cli-eslint
Is this what you meant by documenting? I guess I was confused by that comment. As I took it as it would act the same / similarly but it looks like that is not the case? |
|
Any update on this? |
Implementation of ember-cli/rfcs#121.
I already started doing this at work, so I want to get it upstream.