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 #62

Merged
merged 1 commit into from
Jan 16, 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
3 changes: 0 additions & 3 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");
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

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.

57 changes: 31 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,52 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
json (2.6.2)
parallel (1.22.1)
parser (3.1.2.1)
json (2.7.1)
language_server-protocol (3.17.0.3)
parallel (1.24.0)
parser (3.3.0.4)
ast (~> 2.4.1)
prettier_print (1.2.0)
racc
prettier_print (1.2.1)
racc (1.7.3)
rainbow (3.1.1)
regexp_parser (2.6.0)
rexml (3.2.5)
rubocop (1.36.0)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.60.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.1.2.1)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.20.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
parser (>= 3.1.1.0)
rubocop-discourse (3.0)
rubocop (>= 1.1.0)
rubocop-rspec (>= 2.0.0)
rubocop-rspec (2.13.2)
rubocop (~> 1.33)
ruby-progressbar (1.11.0)
syntax_tree (5.1.0)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-discourse (3.6.0)
rubocop (>= 1.59.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rspec (2.26.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
ruby-progressbar (1.13.0)
syntax_tree (6.2.0)
prettier_print (>= 1.2.0)
unicode-display_width (2.3.0)
unicode-display_width (2.5.0)

PLATFORMS
arm64-darwin-20
ruby
x86_64-darwin-18
x86_64-darwin-19
x86_64-darwin-20
x86_64-linux

DEPENDENCIES
rubocop-discourse
syntax_tree

BUNDLED WITH
2.3.10
2.5.4
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { withPluginApi } from "discourse/lib/plugin-api";
import I18n from "I18n";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import { CREATE_TOPIC, EDIT, REPLY } from "discourse/models/composer";
import discourseComputed, { observes } from "discourse-common/utils/decorators";
import I18n from "I18n";

const PLUGIN_ID = "discourse-staff-alias";

function initialize(api) {
const currentUser = api.getCurrentUser();

if (currentUser && currentUser.can_act_as_staff_alias) {
if (currentUser?.can_act_as_staff_alias) {
api.modifySelectKit("composer-actions").prependContent((component) => {
if (component.action === CREATE_TOPIC) {
return [
Expand Down Expand Up @@ -176,7 +176,7 @@ export default {
name: "discourse-staff-alias",

initialize(container) {
const siteSettings = container.lookup("site-settings:main");
const siteSettings = container.lookup("service:site-settings");

if (siteSettings.staff_alias_enabled) {
withPluginApi("0.10.0", initialize);
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "discourse-staff-alias",
"version": "0.1.0",
"repository": "https://github.com/discourse/discourse-staff-alias",
"author": "Discourse",
"license": "MIT",
"private": true,
"devDependencies": {
"eslint-config-discourse": "^3.4.0"
"@discourse/lint-configs": "^1.3.5",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"prettier": "^2.8.8"
}
}
1 change: 0 additions & 1 deletion plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# version: 0.1
# authors: tgxworld
# url: https://github.com/discourse/discourse-staff-alias
# transpile_js: true

enabled_site_setting :staff_alias_enabled

Expand Down
12 changes: 6 additions & 6 deletions test/javascripts/acceptance/staff-alias-composer-test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { _clearSnapshots } from "select-kit/components/composer-actions";
import { presentUserIds } from "discourse/tests/helpers/presence-pretender";
import { click, fillIn, visit } from "@ember/test-helpers";
import { skip, test } from "qunit";
import User from "discourse/models/user";
import topicFixtures from "discourse/tests/fixtures/topic";
import { presentUserIds } from "discourse/tests/helpers/presence-pretender";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { cloneJSON } from "discourse-common/lib/object";
import { skip, test } from "qunit";
import { click, fillIn, visit } from "@ember/test-helpers";
import { _clearSnapshots } from "select-kit/components/composer-actions";

const discoursePresenceInstalled = Object.keys(requirejs.entries).any((name) =>
name.includes("/discourse-presence/")
Expand Down
Loading