ESLint config + build fail if PR code does not follow the config #1442

Closed
opened 2025-11-02 04:00:59 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @thehowl on GitHub (Jan 11, 2018).

In an attempt to have JavaScript code that is not an unmanageable mess where there are even mixed " and ' for string literals, I would propose to add an eslint config to gitea; public/js/* would then be checked for errors by the CI, to ensure that we have a consistent style in the JavaScript code.

Originally created by @thehowl on GitHub (Jan 11, 2018). In an attempt to have JavaScript code that is not an unmanageable mess where there are even mixed `"` and `'` for string literals, I would propose to add an [eslint](https://eslint.org/) config to gitea; public/js/* would then be checked for errors by the CI, to ensure that we have a consistent style in the JavaScript code.
GiteaMirror added the type/proposal label 2025-11-02 04:00:59 -06:00
Author
Owner

@lafriks commented on GitHub (Jan 11, 2018):

With prettier.io ;)

@lafriks commented on GitHub (Jan 11, 2018): With prettier.io ;)
Author
Owner

@silverwind commented on GitHub (Jan 11, 2018):

Sounds good. You can add the eslint dependency to package.json, just need to make sure npm install runs before testing.

@silverwind commented on GitHub (Jan 11, 2018): Sounds good. You can add the `eslint` dependency to [`package.json`](https://github.com/go-gitea/gitea/blob/master/package.json), just need to make sure `npm install` runs before testing.
Author
Owner

@sapk commented on GitHub (Jan 16, 2020):

I think it is done now (https://github.com/go-gitea/gitea/blob/master/.eslintrc).
If I am mistaken feel free to re-open.

@sapk commented on GitHub (Jan 16, 2020): I think it is done now (https://github.com/go-gitea/gitea/blob/master/.eslintrc). If I am mistaken feel free to re-open.
Author
Owner

@silverwind commented on GitHub (Jan 16, 2020):

Yes it is. make build will fail on ESLint errors.

@silverwind commented on GitHub (Jan 16, 2020): Yes it is. `make build` will fail on ESLint errors.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1442