usebedrock / bedrock

Bedrock is a static site generator to create large-scale HTML prototypes and document design systems
https://bedrockapp.org
Other
206 stars 28 forks source link

Add linters for a consistent codebase #49

Open thomastuts opened 8 years ago

thomastuts commented 8 years ago

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:

Wolfr commented 8 years ago

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.

xavez commented 8 years ago

I would start with making it mandatory first. If we run into issues we can make it optional?

Wolfr commented 8 years ago

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.

xavez commented 8 years ago

We can exclude third party code from linting, which is good practice anyway I think.

thomastuts commented 8 years ago

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.

Wolfr commented 8 years ago

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 notifications@github.com 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 .

Wolfr commented 8 years ago

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 ) .

Wolfr commented 7 years ago

@thomastuts seemingly I already linked the relevant code from this issue.

Wolfr commented 6 years ago

Linting is broken (see #174 ) but still a feature I would like to have in general to ensure more code quality.

Wolfr commented 6 years ago

SCSS lint seems to be deprecated.

Wolfr commented 6 years ago

I would still like linting when we get back to implementing new features.

xavez commented 6 years ago

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 :-)

Wolfr commented 6 years ago

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 notifications@github.com 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.

xavez commented 6 years ago

And I was hoping that 8 supported editors would be enough 😢. Definitely a thing to consider.

Wolfr commented 6 years ago

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 notifications@github.com 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.

Wolfr commented 5 years ago

Closing due to stale.

Wolfr commented 5 years ago

I am actively working on this again because I actually needed it to validate some code.

Wolfr commented 5 years ago

At this moment, it works for components in the branch https://github.com/usebedrock/bedrock/tree/feature/linternew