Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEV: Update linting #2

Merged
merged 1 commit into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/eslint-theme");
11 changes: 11 additions & 0 deletions .github/workflows/discourse-theme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Discourse Theme

on:
push:
branches:
- main
pull_request:

jobs:
ci:
uses: discourse/.github/.github/workflows/discourse-theme.yml@v1
1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/prettier");
1 change: 1 addition & 0 deletions .template-lintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/template-lint");
4 changes: 0 additions & 4 deletions .template-lintrc.js

This file was deleted.

6 changes: 3 additions & 3 deletions javascripts/discourse/components/review-queue-ip-lookup.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { action } from "@ember/object";
import { popupAjaxError } from "discourse/lib/ajax-error";
import IpLookup from "admin/components/ip-lookup";
import AdminUser from "admin/models/admin-user";
import { popupAjaxError } from "discourse/lib/ajax-error";

export default class ReviewQueueIpLookup extends IpLookup {
@action
async lookup() {
if(this.ip == "init") {
if (this.ip === "init") {
let userId = this.userId;
try {
let userInfo = await AdminUser.find(userId);
this.set("ip", userInfo.ip_address);
} catch(e) {
} catch (e) {
popupAjaxError(e);
return; // no need to go further in this case
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{#if this.currentUser.staff}}
<ReviewQueueIpLookup @ip="init" @userId={{reviewable.target_created_by.id}}/>
{{/if}}
<ReviewQueueIpLookup @ip="init" @userId={{reviewable.target_created_by.id}} />
{{/if}}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"author": "faiz",
"license": "MIT",
"private": true,
"devDependencies": {
"eslint-config-discourse": "latest"
"@discourse/lint-configs": "^1.3.7",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"prettier": "^2.8.8"
}
}
1,329 changes: 1,159 additions & 170 deletions yarn.lock

Large diffs are not rendered by default.

Loading