bedrock
bedrock copied to clipboard
Add linters for a consistent codebase
We talked about this briefly in Slack - the mix of using double and single quotes in our Jade templates right now is pretty awful. We don't have to limit ourselves to just Jade linting, though:
- Jade: https://github.com/emartech/gulp-jade-lint
- JS: http://eslint.org/
- SCSS: https://github.com/brigade/scss-lint
Yes... I agree we need to have some code linting. But let's not forget we are sometimes designing/prototyping here.
Let's add the linting as an optional step that reports on your code, not as a requirement.
I would start with making it mandatory first. If we run into issues we can make it optional?
No, my experience is that you run into issues where third party code is written in a way that makes it impossible for you to continue without refactoring their code. Especially with Javascript.
We can exclude third party code from linting, which is good practice anyway I think.
Yes, third-party code should definitely not be linted. That's their responsibility. They might also use other rules, so it definitely doesn't make sense to lint that stuff ourselves.
OK sure, but really there are more pressing issues than consistency of single quotes and double quotes.
On Mon, Dec 7, 2015 at 4:02 PM, Thomas Tuts [email protected] wrote:
Yes, third-party code should definitely not be linted. That's their responsibility. They might also use other rules, so it definitely doesn't make sense to lint that stuff ourselves.
— Reply to this email directly or view it on GitHub https://github.com/mono-company/bedrock/issues/49#issuecomment-162549284 .
What I would like is a linter that checks for invalid HTML like $("a a")
. We had this in Ticketmatic. See this code https://gist.github.com/Wolfr/00d425420bc83ff2e89d . It used cheerio ( https://github.com/cheeriojs/cheerio ) .
@thomastuts seemingly I already linked the relevant code from this issue.
Linting is broken (see #174 ) but still a feature I would like to have in general to ensure more code quality.
SCSS lint seems to be deprecated.
I would still like linting when we get back to implementing new features.
It would be nice if we could perhaps add support for https://prettier.io. It goes a step further than simple linting, but I think it can be pretty powerful to avoid mistakes and silly whitespace diffs :-)
I think it can be done - we can experiment with it and decide if it should be part of Bedrock core.
One problem with prettier is that there is no support for my editor Textmate2, so I effectively can’t use it
Verstuurd vanaf mijn iPhone
Op 28 jun. 2018 om 17:19 heeft Xavier Bertels [email protected] het volgende geschreven:
It would be nice if we could perhaps add support for https://prettier.io. It goes a step further than simple linting, but I think it can be pretty powerful to avoid mistakes and silly whitespace diffs :-)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
And I was hoping that 8 supported editors would be enough 😢. Definitely a thing to consider.
Since I can’t be a user maybe it’s something you can add at some point?
I will just conform to the rules set in the spec ;)
I tried switching to VScode 2 weeks ago but there’s just too many textmate things I know to be productive
Verstuurd vanaf mijn iPhone
Op 28 jun. 2018 om 18:56 heeft Xavier Bertels [email protected] het volgende geschreven:
And I was hoping that 8 supported editors would be enough 😢. Definitely a thing to consider.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Closing due to stale.
I am actively working on this again because I actually needed it to validate some code.
At this moment, it works for components in the branch https://github.com/usebedrock/bedrock/tree/feature/linternew